{
  "openapi": "3.0.1",
  "info": {
    "title": "Twitter X Tweets Scraper Scraper With Poll Results",
    "description": "Scrape public tweets from X Twitter with precision. Extract tweet text, timestamps, likes, retweets, replies, hashtags, mentions, and author data. Filter by keywords, profiles, or time range. Ideal for research, monitoring trends, lead generation, and content analysis.",
    "version": "0.1",
    "x-build-id": "BRofeGIiwkaRYV47l"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapio~Twitter-X-Tweets-Scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapio-Twitter-X-Tweets-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/scrapio~Twitter-X-Tweets-Scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapio-Twitter-X-Tweets-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/scrapio~Twitter-X-Tweets-Scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapio-Twitter-X-Tweets-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": [
          "startUrls"
        ],
        "properties": {
          "startUrls": {
            "title": "🗳️ Profiles or post URLs to read polls from",
            "type": "array",
            "description": "One target per line. Accepted forms:\n\n• https://x.com/NASA  or  https://twitter.com/NASA\n• NASA  or  @NASA\n• a numeric user ID, e.g. 11348282\n• a single post: https://x.com/farzyness/status/1887685445791740273\n\nPolls are rare on most accounts, so the most direct way to get one is to paste the poll's own post URL — that returns exactly one row for it and ignores the post limit.",
            "items": {
              "type": "string"
            }
          },
          "maxTweets": {
            "title": "🔢 Posts to read per profile",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many posts to READ from each PROFILE (1–1000). This is the request budget, not a poll quota: the poll filter runs afterwards on the posts already fetched, so asking for 10 posts on an account that polls once a month will usually keep nothing.\n\nMeasured 2026-08-03: @farzyness had exactly 1 poll in its most recent 100 posts, and @NASA, @NASAWebb, @Interior and @BBCBreaking had none. Read deep, or use a post URL.\n\nThe pinned post counts towards this limit and duplicates are removed before anything is charged. Single post URLs are not affected. Default: 10.",
            "default": 10
          },
          "onlyPollPosts": {
            "title": "🗳️ Keep only posts that carried a poll",
            "type": "boolean",
            "description": "Off: every post is returned, and the ones with a poll carry the poll block.\n\nOn: posts without a poll are dropped BEFORE anything is charged, so you pay only for poll rows. A run that keeps three rows is the answer — those three are the polls.\n\nIf a target's posts are all filtered out, the run writes an uncharged row saying how many posts it read and which filter removed them, instead of quietly reporting nothing.",
            "default": false
          },
          "pollStatus": {
            "title": "⏳ Which polls to keep",
            "enum": [
              "any",
              "open",
              "closed"
            ],
            "type": "string",
            "description": "Filter polls by whether voting is still running.\n\n• Any — open and closed polls both kept.\n• Still open — the counts are a mid-flight snapshot and will keep moving. Vote counts ARE published before a poll closes; they are not hidden until the end.\n• Closed — X has marked the counts final, so the numbers no longer change. These are the quotable results.\n\nStatus comes from X's own `counts_are_final` flag, never from comparing the end time to a clock. Choosing anything other than “Any” can only match posts that carry a poll, so ordinary posts are dropped too.",
            "default": "any"
          },
          "includeLinkPreviewCards": {
            "title": "🔗 Also expand non-poll link cards",
            "type": "boolean",
            "description": "A post carries at most one card, and it is either a poll or a link preview. Turn this on to fill the `link_card` column for the link-preview ones: card type, title, description, domain, destination URL, the preview thumbnail, and the embedded player URL on video cards.\n\nOff by default so the default table stays about polls — the column lives in its own “Link cards” dataset view. This reads the same response; it adds no request.",
            "default": false
          },
          "sortOrder": {
            "title": "↕️ Row order",
            "enum": [
              "recent",
              "oldest",
              "popular"
            ],
            "type": "string",
            "description": "Re-orders the rows collected in this run, after filtering. X always serves a timeline newest-first; this setting does not search further back than the posts already fetched.",
            "default": "recent"
          },
          "includeReplies": {
            "title": "💬 Also read the profile's own replies",
            "type": "boolean",
            "description": "Off: the profile's posts, reposts and quotes (the “Posts” tab) — no login needed, and this is where an account's polls normally live.\n\nOn: also the replies that profile wrote to other people (the “Posts and replies” tab), in case a poll was posted as a reply. That surface is available only to a logged-in caller, so it REQUIRES the X session below. Without it the run fails immediately with an explanation rather than quietly returning a partial timeline.",
            "default": false
          },
          "auth_token": {
            "title": "🔑 X session — auth_token cookie",
            "type": "string",
            "description": "Optional. Needed ONLY for “Also read the profile's own replies”. Copy the value of the `auth_token` cookie from an x.com browser session (DevTools → Application → Cookies → x.com).\n\nStored encrypted, sent only to api.x.com, and never written to the dataset or the run log. Nothing about polls requires it."
          },
          "ct0": {
            "title": "🔑 X session — ct0 cookie",
            "type": "string",
            "description": "Optional, and required together with `auth_token`. Copy the value of the `ct0` cookie from the same x.com browser session; it is the CSRF token X checks on every authenticated request.\n\nStored encrypted, sent only to api.x.com, and never written to the dataset or the run log."
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy",
            "type": "object",
            "description": "Off by default. X was measured serving poll cards to a bare Apify datacenter exit, so a proxy is optional. Turn Apify Proxy on if you want a different exit or run at high volume; the actor rotates to a fresh exit once if a request fails before any row was saved.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}