{
  "openapi": "3.0.1",
  "info": {
    "title": "Twitter X Tweets Scraper Scraper - Repost and Quote",
    "description": "Scrape tweets from X (Twitter) by keyword, hashtag, username, or URL. Collect tweet text, author details, timestamps, metrics, media, and replies. Ideal for sentiment analysis, trend tracking, research, monitoring, and building datasets at scale.",
    "version": "0.1",
    "x-build-id": "3sN8Rc8GU9gj1ynWI"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/api-empire~twitter-x-tweets-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-api-empire-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/api-empire~twitter-x-tweets-scraper/runs": {
      "post": {
        "operationId": "runs-sync-api-empire-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/api-empire~twitter-x-tweets-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-api-empire-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 open up",
            "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/NASA/status/2083317461269598348\n\nA post URL returns exactly one row for that post and ignores the post limit — handy for checking one specific repost or quote.",
            "items": {
              "type": "string"
            }
          },
          "resolveSharedPosts": {
            "title": "🔍 Open up reposts and quotes into the original",
            "type": "boolean",
            "description": "On (default): a repost or quote row also carries `original_post` — the shared post's full text, its own engagement counts, and the original author's handle, name, id, follower count, bio and verified badge.\n\nOff: rows are still labelled `share_type`, but `original_post` is null. Turn it off only if you want smaller rows; nothing extra is fetched either way, the data rides inside the same response.",
            "default": true
          },
          "onlySharedPosts": {
            "title": "📤 Keep only what this account shared from someone else",
            "type": "boolean",
            "description": "On: the account's own original posts drop out and you get a clean list of what it amplifies — reposts and quotes only.\n\nWhen this is on the actor keeps reading further back until it has the number of posts you asked for, or until it has looked at 5× that many (minimum 100). If the account shared nothing in that range the run ends with a FAILED status and an accounting row saying how many posts were read — never a silent empty dataset.",
            "default": false
          },
          "minOriginalAuthorFollowers": {
            "title": "📊 Skip originals whose author is smaller than",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Drops shared posts whose ORIGINAL author has fewer followers than this. Set 100000 when you are mapping which big accounts a brand amplifies; leave it at 0 to see everything, small accounts included.\n\nAbove 0 this also drops the account's own original posts (they have no shared author), and drops a quote whose original X refused to hydrate (there is no follower number to test — it is never guessed at). Needs the resolver above to be on. Default: 0.",
            "default": 0
          },
          "maxTweets": {
            "title": "🔢 Matching posts per profile",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many posts to KEEP from each PROFILE (1–1000). With no share filter set this is simply the number of posts collected, exactly as the base actor behaves. With a share filter on it is the number of MATCHING posts.\n\nThe pinned post counts towards this limit and duplicates are removed before anything is charged, so you never get more post rows than you asked for. Single post URLs are not affected. Default: 10.",
            "default": 10
          },
          "sortOrder": {
            "title": "↕️ Row order",
            "enum": [
              "recent",
              "oldest",
              "popular"
            ],
            "type": "string",
            "description": "Re-orders the posts collected in this run. 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.\n\nOn: also the replies that profile wrote to other people (the “Posts and replies” tab). 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
          },
          "listReposters": {
            "title": "👥 List who reposted each post",
            "type": "boolean",
            "description": "Adds `reposter` child rows — one per account X will name as having reposted a collected post — with their handle, display name, follower count, bio, location, verified badge and account age. Each child row also carries the post's declared repost count next to how many accounts were actually collected, because protected and suspended accounts stay in X's counter but are never served.\n\nREQUIRES the X session below (X answers a logged-out caller with an empty 404). Without it the run refuses before spending a request instead of emitting an empty roster. Child rows are billed like post rows.",
            "default": false
          },
          "maxRepostersPerPost": {
            "title": "🔢 Reposters per post",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Caps how many reposter rows are collected for each post (1–5000). Only used when the roster above is on. Default: 100.",
            "default": 100
          },
          "auth_token": {
            "title": "🔑 X session — auth_token cookie",
            "type": "string",
            "description": "Optional. Needed ONLY for “Also read the profile's own replies” and “List who reposted each post”. 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."
          },
          "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 this data 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}