{
  "openapi": "3.0.1",
  "info": {
    "title": "🦅 X/Twitter Scraper & Data Extractor",
    "description": "Extract high-quality data from X (formerly Twitter) with our advanced, auto-routing scraping engine. Pay only for the data you need at an unbeatable price of $0.20 per 1,000 tweets.",
    "version": "0.0",
    "x-build-id": "yZx8ixRCwVFzdicXj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/x402~x-twitter-scraper-data-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-x402-x-twitter-scraper-data-extractor",
        "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/x402~x-twitter-scraper-data-extractor/runs": {
      "post": {
        "operationId": "runs-sync-x402-x-twitter-scraper-data-extractor",
        "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/x402~x-twitter-scraper-data-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-x402-x-twitter-scraper-data-extractor",
        "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",
        "properties": {
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Optional mixed X/Twitter URLs. Supports profile timelines, `/with_replies`, `/media`, list URLs, and search URLs. Tweet URLs are currently skipped with a warning because this build focuses on timeline and search routes."
          },
          "urls": {
            "title": "URLs",
            "type": "array",
            "description": "Alias for Start URLs. Accepts strings or `{ \"url\": \"...\" }` objects."
          },
          "profileUrls": {
            "title": "Profile URLs",
            "type": "array",
            "description": "Optional profile URL alias for timeline, `/with_replies`, and `/media` targets."
          },
          "twitterHandles": {
            "title": "X Handles",
            "type": "array",
            "description": "Usernames to scrape. Accepts handles with or without the `@` prefix. These route through the fast profile timeline path unless you enable replies or media mode.",
            "items": {
              "type": "string"
            }
          },
          "usernames": {
            "title": "Usernames",
            "type": "array",
            "description": "Alias for X Handles.",
            "items": {
              "type": "string"
            }
          },
          "listUrls": {
            "title": "List URLs",
            "type": "array",
            "description": "X list URLs to scrape through the dedicated list timeline route.",
            "items": {
              "type": "string"
            }
          },
          "listIds": {
            "title": "List IDs",
            "type": "array",
            "description": "Numeric X list IDs. Each ID is converted to `https://x.com/i/lists/<id>` and routed through the dedicated list scraper.",
            "items": {
              "type": "string"
            }
          },
          "searchTerms": {
            "title": "Search Terms",
            "type": "array",
            "description": "Run multiple searches in one Actor run. If `searchType` is `profile_tweets` and you provide profile targets, each term is searched inside each profile. Otherwise the terms route to global tweet or user search.",
            "items": {
              "type": "string"
            }
          },
          "searchQuery": {
            "title": "Search Query",
            "type": "string",
            "description": "Single-query alias for Search Terms. Useful for API users who want one search string."
          },
          "query": {
            "title": "Query",
            "type": "string",
            "description": "Alias for Search Query."
          },
          "searchType": {
            "title": "Search Type",
            "enum": [
              "tweets",
              "users",
              "profile_tweets"
            ],
            "type": "string",
            "description": "Choose how `searchTerms`, `searchQuery`, and `query` should route when they are not encoded in start URLs.",
            "default": "tweets"
          },
          "contentFilters": {
            "title": "Structured Content Filters",
            "type": "object",
            "description": "Optional content-level filters that are compiled into a fallback search query only when no explicit search term is provided."
          },
          "userFilters": {
            "title": "Structured User Filters",
            "type": "object",
            "description": "Optional user filters such as `fromUser`, `toUser`, `mentionUser`, and `listId`. These also help build a fallback query when no direct search term is provided."
          },
          "timeFilters": {
            "title": "Structured Time Filters",
            "type": "object",
            "description": "Optional structured time filters. `sinceDate` and `untilDate` are used as aliases for Start Date and End Date."
          },
          "geoFilters": {
            "title": "Structured Geo Filters",
            "type": "object",
            "description": "Optional structured location filters. `nearPlace` is used as an alias for Location."
          },
          "engagementFilters": {
            "title": "Structured Engagement Filters",
            "type": "object",
            "description": "Optional structured engagement thresholds used as aliases for the top-level minimum metrics."
          },
          "mediaFilters": {
            "title": "Structured Media Filters",
            "type": "object",
            "description": "Optional structured media filters used as aliases for image, video, and link filtering when present."
          },
          "tweetTypeFilters": {
            "title": "Structured Tweet Type Filters",
            "type": "object",
            "description": "Optional structured tweet-type filters used as aliases for quote-only, verified-only, and safe-search controls."
          },
          "fromUser": {
            "title": "From User",
            "type": "string",
            "description": "Fallback search builder input. When no explicit search term is provided, this compiles into a `from:<username>` query fragment."
          },
          "toUser": {
            "title": "To User",
            "type": "string",
            "description": "Fallback search builder input. When no explicit search term is provided, this compiles into a `to:<username>` query fragment."
          },
          "mentionedUser": {
            "title": "Mentioned User",
            "type": "string",
            "description": "Fallback search builder input. When no explicit search term is provided, this compiles into an `@username` query fragment."
          },
          "mentionUser": {
            "title": "Mention User Alias",
            "type": "string",
            "description": "Alias for Mentioned User."
          },
          "listIdFilter": {
            "title": "List ID Filter",
            "type": "string",
            "description": "Fallback search builder input. When no explicit search term is provided, this compiles into a `list:<id>` query fragment."
          },
          "includeReplies": {
            "title": "Include Replies",
            "type": "boolean",
            "description": "Route manual profile targets through the profile-with-replies tab.",
            "default": false
          },
          "mediaOnly": {
            "title": "Media Only",
            "type": "boolean",
            "description": "Route manual profile targets through the profile media tab.",
            "default": false
          },
          "scrapeProfileInfo": {
            "title": "Scrape Profile Info",
            "type": "boolean",
            "description": "Push a free profile row alongside tweet results when profile metadata is available.",
            "default": true
          },
          "respectProfileSubpages": {
            "title": "Respect Profile Subpages",
            "type": "boolean",
            "description": "When enabled, `.../with_replies` and `.../media` URLs keep their explicit route instead of inheriting the global profile mode.",
            "default": true
          },
          "includeRetweets": {
            "title": "Include Retweets",
            "type": "boolean",
            "description": "Return retweets in profile-based results when available.",
            "default": true
          },
          "includeNativeRetweets": {
            "title": "Include Native Retweets In Search",
            "type": "boolean",
            "description": "Include native retweets in search-based tweet results.",
            "default": true
          },
          "maxItems": {
            "title": "Max Items Per Target",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of rows to attempt per target or search term. Set `0` for no cap.",
            "default": 100
          },
          "startDate": {
            "title": "Start Date (YYYY-MM-DD)",
            "type": "string",
            "description": "Optional inclusive start date in `YYYY-MM-DD` format."
          },
          "sinceDate": {
            "title": "Since Date Alias (YYYY-MM-DD)",
            "type": "string",
            "description": "Alias for Start Date."
          },
          "endDate": {
            "title": "End Date (YYYY-MM-DD)",
            "type": "string",
            "description": "Optional inclusive end date in `YYYY-MM-DD` format."
          },
          "untilDate": {
            "title": "Until Date Alias (YYYY-MM-DD)",
            "type": "string",
            "description": "Alias for End Date."
          },
          "latestTweets": {
            "title": "Latest Tweets Only",
            "type": "boolean",
            "description": "Shortcut for setting the search start date to the last 7 days when `startDate` is empty.",
            "default": false
          },
          "location": {
            "title": "Location",
            "type": "string",
            "description": "Optional location filter for supported search routes."
          },
          "nearPlace": {
            "title": "Near Place Alias",
            "type": "string",
            "description": "Alias for Location."
          },
          "onlyImages": {
            "title": "Only Images",
            "type": "boolean",
            "description": "Keep only rows that contain image media.",
            "default": false
          },
          "onlyVideos": {
            "title": "Only Videos",
            "type": "boolean",
            "description": "Keep only rows that contain video media.",
            "default": false
          },
          "onlyVerified": {
            "title": "Only Verified Authors",
            "type": "boolean",
            "description": "Keep only rows from verified authors.",
            "default": false
          },
          "onlyQuotes": {
            "title": "Only Quote Tweets",
            "type": "boolean",
            "description": "Keep only quote tweets.",
            "default": false
          },
          "includeLinks": {
            "title": "Only Tweets With Links",
            "type": "boolean",
            "description": "Keep only rows that contain external URLs.",
            "default": false
          },
          "safeSearch": {
            "title": "Safe Search",
            "type": "boolean",
            "description": "Enable the source's safe-search flag when available.",
            "default": false
          },
          "minLikes": {
            "title": "Minimum Likes",
            "minimum": 0,
            "type": "integer",
            "description": "Drop tweets below this like threshold.",
            "default": 0
          },
          "minReplies": {
            "title": "Minimum Replies",
            "minimum": 0,
            "type": "integer",
            "description": "Drop tweets below this reply threshold.",
            "default": 0
          },
          "minRetweets": {
            "title": "Minimum Retweets",
            "minimum": 0,
            "type": "integer",
            "description": "Drop tweets below this retweet threshold.",
            "default": 0
          },
          "tweetLanguage": {
            "title": "Tweet Language",
            "enum": [
              "",
              "en",
              "es",
              "fr",
              "de",
              "it",
              "pt",
              "ja",
              "ko",
              "zh-cn",
              "ar",
              "hi",
              "tr"
            ],
            "type": "string",
            "description": "Best-effort language filter using the source language code when the HTML exposes it.",
            "default": ""
          },
          "useResidentialProxy": {
            "title": "Use Residential Proxy",
            "type": "boolean",
            "description": "Enable Apify residential proxy for better reliability.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Optional Apify proxy configuration override.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "proxyCountryCode": {
            "title": "Proxy Country Code",
            "type": "string",
            "description": "Optional 2-letter country code to pin the proxy country.",
            "default": ""
          },
          "maxRetries": {
            "title": "Max Retries Per Request",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Bounded retry count for network requests.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}