{
  "openapi": "3.0.1",
  "info": {
    "title": "X (Twitter) Scraper - Tweets, Search, Profiles & Lists",
    "description": "Scrape X (Twitter) posts from searches, accounts, lists and conversations. Advanced search filters, Latest or Top, dates, languages, likes and media. Get text, engagement, views, media, links and author data. No X account or API key needed.",
    "version": "0.1",
    "x-build-id": "ewxbxPvIZdwpSBVb4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jmlp~x-twitter-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jmlp-x-twitter-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/jmlp~x-twitter-scraper/runs": {
      "post": {
        "operationId": "runs-sync-jmlp-x-twitter-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/jmlp~x-twitter-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-jmlp-x-twitter-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",
        "properties": {
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "X (Twitter) links, pasted from your browser: a profile (x.com/apify) for its posts, a profile's Replies tab (x.com/apify/with_replies), a post (x.com/apify/status/...), a search (x.com/search?q=...), a hashtag (x.com/hashtag/...) or a list (x.com/i/lists/...). twitter.com links and bare post ids work too.",
            "items": {
              "type": "string"
            }
          },
          "searchTerms": {
            "title": "Search Terms",
            "type": "array",
            "description": "What you would type into X's search, one per line. X's search operators work: \"web scraping\" lang:en, scraping from:apify, #python min_faves:100, (apify OR crawlee) -filter:replies. See https://github.com/igorbrigadir/twitter-advanced-search for the full list.",
            "items": {
              "type": "string"
            }
          },
          "twitterHandles": {
            "title": "Twitter handles",
            "type": "array",
            "description": "Accounts whose posts you want, one per line (elonmusk, @apify, or a profile link). Each is searched as from:handle, so Sort By and every filter below apply. For an account's newest posts fast, paste its profile link into Start URLs instead.",
            "items": {
              "type": "string"
            }
          },
          "conversationIds": {
            "title": "Conversation IDs",
            "type": "array",
            "description": "Posts whose replies you want: the post's id or link, one per line. You get the post and its replies the way the post's page lists them.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Maximum number of items on output",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many unique posts across every search, handle and link. Caps both runtime and cost. Empty means every post found."
          },
          "sort": {
            "title": "Sort By",
            "enum": [
              "Latest",
              "Top",
              "Latest + Top"
            ],
            "type": "string",
            "description": "For searches and handles. Latest goes back in time, newest first, as far as X has posts. Top is X's most relevant posts, a few hundred at most. Latest + Top runs both and drops the posts they share. A pasted search link keeps its own tab (Top or Latest).",
            "default": "Latest"
          },
          "tweetLanguage": {
            "title": "Tweet language",
            "type": "string",
            "description": "Only posts X detected in this language (ISO 639-1 code: en, de, es...)."
          },
          "onlyVerifiedUsers": {
            "title": "Only verified users",
            "type": "boolean",
            "description": "Only posts by verified accounts."
          },
          "onlyTwitterBlue": {
            "title": "Only Twitter Blue",
            "type": "boolean",
            "description": "Only posts by accounts with X Premium (the blue check)."
          },
          "onlyImage": {
            "title": "Only image",
            "type": "boolean",
            "description": "Only posts with an image."
          },
          "onlyVideo": {
            "title": "Only video",
            "type": "boolean",
            "description": "Only posts with a video."
          },
          "onlyQuote": {
            "title": "Only quote",
            "type": "boolean",
            "description": "Only posts that quote another post."
          },
          "author": {
            "title": "Tweet author",
            "type": "string",
            "description": "Only posts by this account (from:). A handle, with or without @."
          },
          "inReplyTo": {
            "title": "In reply to",
            "type": "string",
            "description": "Only replies to this account (to:)."
          },
          "mentioning": {
            "title": "Mentioning",
            "type": "string",
            "description": "Only posts mentioning this account (@handle)."
          },
          "geotaggedNear": {
            "title": "Geotagged near",
            "type": "string",
            "description": "Only posts geotagged near this place (near:), e.g. Prague. Few posts carry a location."
          },
          "withinRadius": {
            "title": "Within radius",
            "type": "string",
            "description": "With Geotagged near: how far from it (within:), e.g. 15km or 10mi."
          },
          "geocode": {
            "title": "Geocode",
            "type": "string",
            "description": "Only posts from within a radius of a point (geocode:latitude,longitude,radius), e.g. 37.7764685,-122.4172004,10km."
          },
          "placeObjectId": {
            "title": "Place object ID",
            "type": "string",
            "description": "Only posts tagged with this X place (place:), e.g. 96683cc9126741d1."
          },
          "minimumRetweets": {
            "title": "Minimum retweets",
            "minimum": 0,
            "type": "integer",
            "description": "Only posts with at least this many reposts (min_retweets:)."
          },
          "minimumFavorites": {
            "title": "Minimum favorites",
            "minimum": 0,
            "type": "integer",
            "description": "Only posts with at least this many likes (min_faves:)."
          },
          "minimumReplies": {
            "title": "Minimum replies",
            "minimum": 0,
            "type": "integer",
            "description": "Only posts with at least this many replies (min_replies:)."
          },
          "start": {
            "title": "Start date",
            "type": "string",
            "description": "Only posts from this day on (since:), YYYY-MM-DD. A date and time (2025-01-31T09:00:00Z) is honoured to the second."
          },
          "end": {
            "title": "End date",
            "type": "string",
            "description": "Only posts up to and including this day (until:), YYYY-MM-DD. A date and time is honoured to the second."
          },
          "includeSearchTerms": {
            "title": "Include Search Terms",
            "type": "boolean",
            "description": "Add a search_term field to each post from a search or handle: the entry it was found with.",
            "default": false
          },
          "includeReposts": {
            "title": "Include reposts in profiles",
            "type": "boolean",
            "description": "For profile links, also return the account's reposts (retweets). Without them a profile is read about eight times faster: X serves its own posts 35 at a time at five times the rate.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Targets at once",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many searches, handles and links are read side by side, 1 to 20. Each takes its turn at the scraper's X accounts, so Maximum items is spread across all of them.",
            "default": 20
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Only for your own X accounts (below) that have no proxy of their own: each of them keeps to one session of this proxy, so it goes out from one IP the way a person's browser does. The scraper's own accounts always use their fixed IPs. Apify's datacenter proxy is the default and works; residential works too. Your own proxies work as well, and are then the only way out: no fallback to Apify Proxy, and never a request without a proxy. Give http or https URLs, with {session} where your provider takes a session id, such as http://user-session-{session}:pass@gate.example.com:7000, and each account gets an IP of its own; {session:8} makes the id 8 characters long. Plain URLs are given out in turn, one per account.",
            "default": {
              "useApifyProxy": true
            }
          },
          "resume": {
            "title": "Checkpoint progress",
            "type": "boolean",
            "description": "Save progress every ~30s so a run that gets migrated or restarted by the platform picks up where it stopped, without repeating posts.",
            "default": true
          },
          "continueFromLastRun": {
            "title": "Continue from last run",
            "type": "boolean",
            "description": "If your previous run with the same input was interrupted - stopped at X's rate limits or the run timeout - scrape only what it missed. Posts already collected stay in THAT run's dataset.",
            "default": false
          },
          "ownAccounts": {
            "title": "Your own X accounts (optional)",
            "type": "string",
            "description": "To scrape with your own X (Twitter) accounts instead of ours: one account per line, its auth_token and ct0 cookies from x.com (browser DevTools > Application > Cookies) as auth_token:ct0. A whole Cookie header works too. To give an account a proxy of its own, add it after a colon: auth_token:ct0:http://user:pass@host:port. Accounts without one go through the Proxy setting above, each keeping to one IP. The run then uses your accounts alone, never ours, with the same care for them: at most half of what X allows each 15 minutes, spread out, and a rest when X pushes back. Stored encrypted."
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}