{
  "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": "VqIJP7HisaudhmXuG"
  },
  "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-post-scraper",
              "x-profile-scraper",
              "x-search-scraper",
              "x-hashtag-scraper",
              "x-timeline-scraper",
              "x-follower-scraper",
              "x-following-scraper",
              "x-comment-scraper",
              "x-list-scraper",
              "x-data-extractor",
              "x-scraper",
              "x-user-search-scraper"
            ],
            "type": "string",
            "description": "Choose which X/Twitter scraper to run.",
            "default": "x-post-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-search-scraper, x-hashtag-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-timeline-scraper, x-follower-scraper, x-following-scraper. Note: 'twitterHandles' is the preferred field name; 'profiles' is kept for backward compatibility.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "twitterHandles": {
            "title": "Twitter Handles",
            "type": "array",
            "description": "X/Twitter handles to scrape. This is the preferred field name for usernames. Same as 'profiles' field (both are read). Used by: x-profile-scraper, x-timeline-scraper, x-follower-scraper, x-following-scraper.",
            "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-data-extractor.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "listURLs": {
            "title": "List URLs",
            "type": "array",
            "description": "X/Twitter list URLs. Must use full URL format: https://x.com/i/lists/1234567890 (bare list IDs are not supported). Used by: x-list-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. Applies to x-follower-scraper. For a dedicated following-list mode, use x-following-scraper instead.",
            "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
          },
          "hydrateFullUser": {
            "title": "Hydrate Full User (follower / following / user-search)",
            "type": "boolean",
            "description": "OFF (default): follower, following, and user-search modes return X's list-endpoint user object — core identity + counts + bio, but without highlights_info / verification_info (X trims those fields on list endpoints). ON: after the list call, make a follow-up UserByScreenName request for each user in parallel to fill canHighlightTweets, verifiedSince, fuller professional data. Doubles the GraphQL call count for those three modes; use when you need Q10 fields on enumerated users. Off-by-default keeps pricing unchanged.",
            "default": false
          },
          "fields": {
            "title": "Output Fields (sparse)",
            "type": "array",
            "description": "Optional allow-list of top-level output fields to keep on every result. Leave empty (default) to return the full object shape. Example: [\"tweetId\",\"text\",\"likeCount\",\"createdAt\",\"author\"]. Use this to shrink dataset payloads for Google Sheets / HubSpot / CSV integrations. The fields `type`, `input`, `error`, `message` are always preserved so error items are never truncated.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "useCrossRunCache": {
            "title": "Cross-run response cache (24h TTL)",
            "type": "boolean",
            "description": "Cache parsed tweets + profiles in a named KV store for 24 hours. When the same tweet URL or username is scraped again within the TTL, the cached result is returned without hitting X — lower cost, faster, and lighter load on your proxy pool. Great for polling integrations (e.g. hourly monitoring). The cache is per-actor and keyed by tweetId / handle; it is automatically bypassed for authenticated-only fields that require fresh data.",
            "default": false
          },
          "ignoreCrossRunCache": {
            "title": "Ignore cross-run cache (bypass hits, still write)",
            "type": "boolean",
            "description": "When useCrossRunCache is on, force a MISS on every key for this run but still write fresh values back to the cache. Useful for debugging stale output without clearing the KV store manually.",
            "default": false
          },
          "dryRun": {
            "title": "Dry run — validate without scraping",
            "type": "boolean",
            "description": "Parse inputs, check cookies, validate the GraphQL doc IDs, and exit WITHOUT making any network calls. Emits a single `{type: 'dry-run', ...}` item summarising what would have happened. Use for pre-production smoke tests and CI validation.",
            "default": false
          },
          "completionWebhookUrl": {
            "title": "Completion webhook URL",
            "type": "string",
            "description": "When the run finishes, POST a JSON body `{event, runId, actorId, datasetId, summary}` to this URL. Non-blocking: webhook failures are logged but never fail the run. Great for Slack/Teams/n8n notifications without polling the Apify API.",
            "default": ""
          },
          "onlyIfChangedSince": {
            "title": "Only emit tweets/users newer than",
            "type": "object",
            "description": "Two forms: (a) {since: 'ISO 8601 date'} — drops items with createdAt ≤ cutoff; (b) {dataset: 'DATASET_ID'} — loads all tweetIds + latest createdAt from a prior dataset and filters against that; (c) both (takes the newer of the two cutoffs). Cuts cost dramatically for hourly / daily polling integrations.",
            "default": {}
          },
          "inputCsv": {
            "title": "Bulk input CSV URL",
            "type": "string",
            "description": "Optional HTTPS URL of a CSV file; each non-empty row is routed into the matching input array based on its shape: tweet URLs → tweetURLs, profile URLs / @handles → profiles, everything else → searchQueries. Header row is auto-detected. Lets you bypass Apify's input-size limit when batching thousands of handles.",
            "default": ""
          },
          "jsonLogs": {
            "title": "Structured JSON logs",
            "type": "boolean",
            "description": "Emit newline-delimited JSON log lines to stdout (one event per line) with fields {t, lvl, runId, actorId, build, message, ...extra}. Pipes straight into Cloudwatch / Datadog / Loki / any JSON-aware log sink. Default off — human-readable Apify text logs still appear in the console.",
            "default": false
          },
          "emitPerInputLedger": {
            "title": "Per-input ledger in summary",
            "type": "boolean",
            "description": "When true, adds a `perInput: [{input, status, itemsEmitted, errorCategory}]` array to the run summary and to the KV store's `summary` key. Shows which of your inputs actually produced results and which failed — useful when batching 100s of handles. Capped at 500 entries to keep the summary small.",
            "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 with attached photos. Appends 'filter:images' to the query AND applies a client-side post-filter that drops tweets whose match was only a card thumbnail (e.g. YouTube embed previews). Strict: every returned item has at least one photo in its media array.",
            "default": false
          },
          "onlyVideo": {
            "title": "Only Videos",
            "type": "boolean",
            "description": "Only return tweets with attached videos or GIFs. Appends 'filter:videos' to the query AND applies a client-side post-filter that drops tweets matching only via a video card (e.g. broadcast player links). Strict: every returned item has at least one video/GIF in its media array.",
            "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": "Your X/Twitter cookies (REQUIRED for 7 of 12 modes)",
            "type": "string",
            "description": "Customer-supplied: paste your OWN X/Twitter cookies from a logged-in browser session. Format: 'auth_token=xxx; ct0=yyy'. Get them from DevTools → Application → Cookies → x.com — copy `auth_token` (HttpOnly) and `ct0` into a single semicolon-separated string. Multi-cookie pool supported via `|||` separator (e.g. 'auth_token=A; ct0=1|||auth_token=B; ct0=2') for hot-rotation across runs.\n\n**REQUIRED for**: x-search-scraper, x-hashtag-scraper, x-timeline-scraper, x-follower-scraper, x-following-scraper, x-comment-scraper, x-list-scraper.\n**Not needed for**: x-post-scraper, x-profile-scraper, x-data-extractor.\n\n**Important: this actor does NOT include any X/Twitter cookies for customer runs.** When a mode requires authentication, you must paste **your own** cookies into this field. There is no shared cookie pool, no built-in fallback, and no operator-side cookie injection — every authenticated run uses the cookies you provide, attributing the activity to *your* X account. (Operator daily-tests use the same `loginCookies` input field, with cookies passed by the daily-test orchestrator.)\n\nMigration note (2026-05-08): the `X_LOGIN_COOKIES` environment-variable fallback has been removed. Earlier versions of this actor would silently fall back to the env var if `loginCookies` was empty; that path is closed for the customer-vs-operator cookie boundary."
          },
          "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 Evomi residential IPs — helps avoid rate limits and account flags when using login cookies at scale. Bandwidth cost is negligible in practice (<$0.0001 per result at typical response sizes, included in pricing). 'Bring your own' lets you supply your own residential proxy URL in proxyConfiguration below (DataImpulse ~$1/GB, Evomi ~$0.49/GB). NOTE: Apify Proxy is not supported — this actor guarantees Evomi-only traffic.",
            "default": "residential"
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration (Option A — bring your own)",
            "type": "object",
            "description": "Supply your own proxy URL(s) via the 'proxyUrls' array. 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). IMPORTANT: Apify Proxy is NOT supported — selecting 'Use Apify Proxy' in this picker will cause the run to fail with a clear error message. This actor is Evomi-only by policy.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}