{
  "openapi": "3.0.1",
  "info": {
    "title": "X (Twitter) Advanced Scraper 𝕏",
    "description": "X (Twitter) with speed and precision. This advanced scraper auto-detects what to collect—tweets, profiles, users, lists, or media-and delivers clean, intelligent filtering. Just enter usernames, URLs, or keywords and let automation do the rest.",
    "version": "0.0",
    "x-build-id": "Ax9BmDGUIvQxkncTW"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mikolabs~x-twitter-advanced-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mikolabs-x-twitter-advanced-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/mikolabs~x-twitter-advanced-scraper/runs": {
      "post": {
        "operationId": "runs-sync-mikolabs-x-twitter-advanced-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/mikolabs~x-twitter-advanced-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-mikolabs-x-twitter-advanced-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "proxyConfiguration"
        ],
        "properties": {
          "searchType": {
            "title": "Search Type",
            "enum": [
              "tweets",
              "users",
              "profile_tweets"
            ],
            "type": "string",
            "description": "When using Search Terms, what to search for"
          },
          "twitterHandles": {
            "title": "Twitter Usernames",
            "type": "array",
            "description": "Enter Twitter usernames to scrape (with or without @). Example: elonmusk, apify",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "listUrls": {
            "title": "Twitter List URLs",
            "type": "array",
            "description": "Enter Twitter/X list URLs to scrape. Format: https://x.com/i/lists/123456 or https://twitter.com/i/lists/123456",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchTerms": {
            "title": "Search Terms",
            "type": "array",
            "description": "Search queries to find tweets or users. For profile search, provide both username and search term. Examples: 'web scraping', 'AI', '#python'",
            "default": [
              "solana"
            ],
            "items": {
              "type": "string"
            }
          },
          "includeReplies": {
            "title": "Include Replies",
            "type": "boolean",
            "description": "Include reply tweets from profiles (automatically switches to 'with replies' mode)",
            "default": true
          },
          "includeRetweets": {
            "title": "Include Retweets",
            "type": "boolean",
            "description": "Include retweets in profile results (automatically switches to 'with replies' mode)",
            "default": true
          },
          "mediaOnly": {
            "title": "Media Only",
            "type": "boolean",
            "description": "Only scrape tweets that contain images or videos",
            "default": false
          },
          "maxItems": {
            "title": "Max Items to Scrape",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of items (tweets/users) to scrape. 0 = unlimited",
            "default": 20
          },
          "maxPages": {
            "title": "Max Pages",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum number of pages to scrape per handle/query",
            "default": 20
          },
          "startDate": {
            "title": "Start Date (From) [YYYY-MM-DD]",
            "type": "string",
            "description": "Filter tweets from this date onwards (YYYY-MM-DD format)",
            "default": ""
          },
          "endDate": {
            "title": "End Date (Until) [YYYY-MM-DD]",
            "type": "string",
            "description": "Filter tweets up to this date (YYYY-MM-DD format)",
            "default": ""
          },
          "location": {
            "title": "Location Filter",
            "type": "string",
            "description": "Filter tweets by location (e.g., 'Los Angeles', 'New York', 'London')",
            "default": ""
          },
          "onlyImages": {
            "title": "Only Images",
            "type": "boolean",
            "description": "Filter tweets that contain images",
            "default": false
          },
          "onlyVideos": {
            "title": "Only Videos",
            "type": "boolean",
            "description": "Filter tweets that contain videos",
            "default": false
          },
          "onlyVerified": {
            "title": "Only Verified Users",
            "type": "boolean",
            "description": "Only include tweets from verified accounts",
            "default": false
          },
          "onlyQuotes": {
            "title": "Only Quote Tweets",
            "type": "boolean",
            "description": "Only include quote tweets",
            "default": false
          },
          "onlyReplies": {
            "title": "Only Reply Tweets",
            "type": "boolean",
            "description": "Only include tweets that are replies to other tweets",
            "default": false
          },
          "onlySelfThreads": {
            "title": "Only Self-Threads",
            "type": "boolean",
            "description": "Only include tweets that are part of a thread (self-replies)",
            "default": false
          },
          "onlyHashtags": {
            "title": "Only Tweets with Hashtags",
            "type": "boolean",
            "description": "Only include tweets that contain hashtags",
            "default": false
          },
          "onlyMentions": {
            "title": "Only Tweets with Mentions",
            "type": "boolean",
            "description": "Only include tweets that contain @mentions",
            "default": false
          },
          "onlyNews": {
            "title": "Only News Links",
            "type": "boolean",
            "description": "Only include tweets with links to news sites",
            "default": false
          },
          "includeNativeRetweets": {
            "title": "Include Native Retweets",
            "type": "boolean",
            "description": "Include native retweets in search results",
            "default": true
          },
          "includeLinks": {
            "title": "Only Tweets with Links",
            "type": "boolean",
            "description": "Filter tweets that contain external links",
            "default": false
          },
          "onlyNativeVideo": {
            "title": "Only Native Twitter Video",
            "type": "boolean",
            "description": "Only include tweets with native Twitter video (not external)",
            "default": false
          },
          "onlyProVideo": {
            "title": "Only Pro Video (Amplify)",
            "type": "boolean",
            "description": "Only include tweets with Twitter Amplify pro video",
            "default": false
          },
          "onlyConsumerVideo": {
            "title": "Only Consumer Video",
            "type": "boolean",
            "description": "Only include tweets with Twitter native consumer video",
            "default": false
          },
          "onlySpaces": {
            "title": "Only Twitter Spaces",
            "type": "boolean",
            "description": "Only include tweets with Twitter Spaces",
            "default": false
          },
          "onlyGIFs": {
            "title": "Only GIFs",
            "type": "boolean",
            "description": "Only include tweets with animated GIFs",
            "default": false
          },
          "onlyPolls": {
            "title": "Only Polls",
            "type": "boolean",
            "description": "Only include tweets containing polls",
            "default": false
          },
          "hasEngagement": {
            "title": "Has Engagement",
            "type": "boolean",
            "description": "Only include tweets with some engagement (replies, likes, retweets)",
            "default": false
          },
          "latestTweets": {
            "title": "Latest Tweets Only (Last 7 Days)",
            "type": "boolean",
            "description": "Only scrape tweets from the last 7 days",
            "default": false
          },
          "safeSearch": {
            "title": "Safe Search",
            "type": "boolean",
            "description": "Enable safe search to filter sensitive content",
            "default": false
          },
          "minLikes": {
            "title": "Minimum Likes",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum number of likes a tweet must have",
            "default": 0
          },
          "minReplies": {
            "title": "Minimum Replies",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum number of replies a tweet must have",
            "default": 0
          },
          "minRetweets": {
            "title": "Minimum Retweets",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum number of retweets a tweet must have",
            "default": 0
          },
          "tweetLanguage": {
            "title": "Tweet Language",
            "type": "string",
            "description": "Filter by language code (e.g., 'en' for English, 'es' for Spanish, 'fr' for French). See ISO 639-1 codes.",
            "default": ""
          },
          "fromUser": {
            "title": "From User",
            "type": "string",
            "description": "Filter tweets from a specific username (e.g., 'elonmusk'). Use with search terms.",
            "default": ""
          },
          "toUser": {
            "title": "To User (Replies)",
            "type": "string",
            "description": "Filter tweets replying to a specific username",
            "default": ""
          },
          "mentionUser": {
            "title": "Mention User",
            "type": "string",
            "description": "Filter tweets mentioning a specific username",
            "default": ""
          },
          "urlDomain": {
            "title": "URL Domain Filter",
            "type": "string",
            "description": "Filter tweets containing links to a specific domain (e.g., 'youtube.com', 'github.com')",
            "default": ""
          },
          "withinRadius": {
            "title": "Within Radius",
            "type": "string",
            "description": "Filter tweets within radius of location (e.g., '10km', '5mi'). Use with location filter.",
            "default": ""
          },
          "sourceClient": {
            "title": "Source Client",
            "type": "string",
            "description": "Filter tweets from specific client (e.g., 'twitter_for_iphone', 'tweetdeck')",
            "default": ""
          },
          "scrapeProfileInfo": {
            "title": "Scrape Profile Info",
            "type": "boolean",
            "description": "Extract detailed profile information (bio, stats, avatar, etc.)",
            "default": true
          },
          "useResidentialProxy": {
            "title": "Use Residential Proxy",
            "type": "boolean",
            "description": "Enable Apify residential proxy for better reliability (requires Apify paid plan)",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Apify proxy configuration (requires paid plan)",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "maxRetries": {
            "title": "Max Retries per Request",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Number of retry attempts for failed requests",
            "default": 5
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}