{
  "openapi": "3.0.1",
  "info": {
    "title": "All-in-One X/Twitter Scraper",
    "description": "X/Twitter scraper — 10 modes: tweets, profiles, followers, comments, timelines, lists, search & more. From $0.09/1K — up to 90% cheaper than alternatives. Premium residential proxy (~95% success rate). apidojo-compatible output. MCP-ready for AI agents.",
    "version": "0.1",
    "x-build-id": "bAerdR629q7TwmyTx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/get-leads~all-in-one-x-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-get-leads-all-in-one-x-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/get-leads~all-in-one-x-scraper/runs": {
      "post": {
        "operationId": "runs-sync-get-leads-all-in-one-x-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/get-leads~all-in-one-x-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-get-leads-all-in-one-x-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": [
          "scrapeMode"
        ],
        "properties": {
          "scrapeMode": {
            "title": "Scrape Mode",
            "enum": [
              "x-scraper",
              "x-tweet-scraper",
              "x-profile-scraper",
              "x-follower-scraper",
              "x-post-scraper",
              "x-user-search-scraper",
              "x-comment-scraper",
              "x-list-scraper",
              "x-timeline-scraper",
              "x-data-extractor"
            ],
            "type": "string",
            "description": "Choose which X/Twitter scraper to run.",
            "default": "x-tweet-scraper"
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "X/Twitter URLs — automatically detects if tweet URL or profile URL and routes to the right scraper. Supports: tweet URLs (x.com/user/status/123), profile URLs (x.com/username), search URLs, list URLs.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "searchQueries": {
            "title": "Search Queries",
            "type": "array",
            "description": "X/Twitter search queries using advanced search syntax. Supports: keywords, #hashtags, from:user, to:user, since:YYYY-MM-DD, until:YYYY-MM-DD, lang:xx, filter:media, filter:images, filter:videos, min_retweets:N, min_faves:N, -filter:retweets, conversation_id:ID. Used by: x-tweet-scraper, x-user-search-scraper, x-scraper.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "profiles": {
            "title": "Profiles / Handles",
            "type": "array",
            "description": "X/Twitter handles, @usernames, or profile URLs. Duplicates removed. Used by: x-profile-scraper, x-follower-scraper, x-scraper.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "twitterHandles": {
            "title": "Twitter Handles",
            "type": "array",
            "description": "Alias for 'profiles'. X/Twitter handles to scrape. Same as 'profiles' field — provided for compatibility with apidojo format.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "tweetURLs": {
            "title": "Tweet URLs",
            "type": "array",
            "description": "X/Twitter post URLs or tweet IDs. Supports x.com and twitter.com URLs. Used by: x-post-scraper, x-comment-scraper, x-scraper.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "listURLs": {
            "title": "List URLs",
            "type": "array",
            "description": "X/Twitter list URLs. Supports: https://x.com/i/lists/1234567890 or bare list IDs. Used by: x-list-scraper, x-scraper.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "conversationIds": {
            "title": "Conversation IDs",
            "type": "array",
            "description": "Tweet/conversation IDs to scrape replies from. Adds 'conversation_id:' prefix to search queries automatically. Requires login cookies.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "maxResults": {
            "title": "Max Results",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum results per query/profile/tweet. Controls how many tweets, followers, or comments to return per input item.",
            "default": 100
          },
          "sort": {
            "title": "Sort Order",
            "enum": [
              "Latest",
              "Top",
              "Latest + Top"
            ],
            "type": "string",
            "description": "How to sort search results. 'Latest' for chronological, 'Top' for most relevant, 'Latest + Top' runs both and deduplicates.",
            "default": "Latest"
          },
          "followerMode": {
            "title": "Follower Mode",
            "enum": [
              "followers",
              "following"
            ],
            "type": "string",
            "description": "Whether to scrape followers or following list. Only applies to x-follower-scraper.",
            "default": "followers"
          },
          "includeReplies": {
            "title": "Include Replies",
            "type": "boolean",
            "description": "Include reply tweets in profile timelines. Adds '-filter:replies' to queries when disabled.",
            "default": false
          },
          "languageFilter": {
            "title": "Language Filter",
            "type": "string",
            "description": "Filter tweets by language code (ISO 639-1). Examples: en, es, fr, ja, de, pt, ar. Leave empty for all languages.",
            "default": ""
          },
          "tweetLanguage": {
            "title": "Tweet Language (alias)",
            "type": "string",
            "description": "Alias for 'Language Filter'. Same as languageFilter — provided for compatibility with apidojo format. ISO 639-1 code.",
            "default": ""
          },
          "start": {
            "title": "Start Date",
            "type": "string",
            "description": "Only return results after this date. Format: YYYY-MM-DD. Only works with search queries. Adds 'since:' to search query automatically.",
            "default": ""
          },
          "end": {
            "title": "End Date",
            "type": "string",
            "description": "Only return results before this date. Format: YYYY-MM-DD. Only works with search queries. Adds 'until:' to search query automatically.",
            "default": ""
          },
          "minimumFavorites": {
            "title": "Minimum Likes",
            "minimum": 0,
            "type": "integer",
            "description": "Only return tweets with at least this many likes. Adds 'min_faves:' to search queries."
          },
          "minimumRetweets": {
            "title": "Minimum Retweets",
            "minimum": 0,
            "type": "integer",
            "description": "Only return tweets with at least this many retweets. Adds 'min_retweets:' to search queries."
          },
          "minimumReplies": {
            "title": "Minimum Replies",
            "minimum": 0,
            "type": "integer",
            "description": "Only return tweets with at least this many replies. Adds 'min_replies:' to search queries."
          },
          "includeSearchTerms": {
            "title": "Include Search Terms",
            "type": "boolean",
            "description": "If enabled, adds a 'searchTerm' field to each result showing which search query produced it.",
            "default": false
          },
          "onlyVerifiedUsers": {
            "title": "Only Verified Users",
            "type": "boolean",
            "description": "Only return tweets by verified users. Adds 'filter:verified' to search queries.",
            "default": false
          },
          "onlyTwitterBlue": {
            "title": "Only Twitter Blue",
            "type": "boolean",
            "description": "Only return tweets by X Premium (Twitter Blue) subscribers. Adds 'filter:blue_verified' to search queries.",
            "default": false
          },
          "onlyImage": {
            "title": "Only Images",
            "type": "boolean",
            "description": "Only return tweets that contain images. Adds 'filter:images' to search queries.",
            "default": false
          },
          "onlyVideo": {
            "title": "Only Videos",
            "type": "boolean",
            "description": "Only return tweets that contain videos. Adds 'filter:videos' to search queries.",
            "default": false
          },
          "onlyQuote": {
            "title": "Only Quotes",
            "type": "boolean",
            "description": "Only return tweets that are quote tweets. Adds 'filter:quote' to search queries.",
            "default": false
          },
          "author": {
            "title": "From User",
            "type": "string",
            "description": "Only return tweets from this user. Adds 'from:' to search query. Enter handle without @.",
            "default": ""
          },
          "inReplyTo": {
            "title": "In Reply To",
            "type": "string",
            "description": "Only return tweets that are replies to this user. Adds 'to:' to search query.",
            "default": ""
          },
          "mentioning": {
            "title": "Mentioning User",
            "type": "string",
            "description": "Only return tweets mentioning this user. Adds '@' mention to search query.",
            "default": ""
          },
          "geotaggedNear": {
            "title": "Geotagged Near",
            "type": "string",
            "description": "Only return tweets geotagged near this location. Example: 'San Francisco'. Adds 'near:' to search query.",
            "default": ""
          },
          "withinRadius": {
            "title": "Within Radius",
            "type": "string",
            "description": "Maximum distance from geotagged location. Examples: '10km', '25mi'. Use with 'Geotagged Near'.",
            "default": ""
          },
          "loginCookies": {
            "title": "Login Cookies (optional)",
            "type": "string",
            "description": "X/Twitter login cookies for modes that require authentication. Required for: x-tweet-scraper, x-timeline-scraper, x-follower-scraper, x-comment-scraper, x-user-search-scraper, x-list-scraper. Not needed for: x-post-scraper, x-profile-scraper, x-data-extractor. Format: 'auth_token=xxx; ct0=yyy'."
          },
          "customMapFunction": {
            "title": "Custom Map Function",
            "type": "string",
            "description": "JavaScript function to transform each result. Receives the result object and should return the transformed object. Example: (item) => ({ id: item.tweetId, text: item.text, likes: item.likeCount }). Not for filtering — return the object or it won't be saved.",
            "default": ""
          },
          "resumeFromDataset": {
            "title": "Resume From Dataset",
            "type": "string",
            "description": "Dataset ID from a previous run to skip already-scraped items. Useful for resuming failed runs without duplicates.",
            "default": ""
          },
          "proxyTier": {
            "title": "Proxy Tier",
            "enum": [
              "none",
              "residential",
              "custom"
            ],
            "type": "string",
            "description": "Choose your proxy setup. 'None' works for most requests. 'Residential (built-in)' routes all requests through residential IPs — helps avoid rate limits and account flags when using login cookies at scale, adds ~$0.003/result to cover proxy bandwidth. 'Bring your own' lets you supply your own residential proxy URL in proxyConfiguration below (DataImpulse ~$1/GB, Evomi ~$0.49/GB).",
            "default": "residential"
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration (Option A — bring your own)",
            "type": "object",
            "description": "Supply your own proxy. Used when proxyTier is 'Bring your own'. Recommended providers for residential: DataImpulse (https://dataimpulse.com, ~$1/GB) or Evomi (https://evomi.com, ~$0.49/GB).",
            "default": {}
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}