{
  "openapi": "3.0.1",
  "info": {
    "title": "Twitter (X.com) Tweets & Profiles Scraper: Posts from a Place",
    "description": "Twitter X Tweets Profiles Scraper collects tweets and profile details from any public X (Twitter) account, including bios, follower stats, timestamps, media, hashtags, and engagement metrics. Ideal for research, trend tracking, social listening, and automating structured Twitter/X data extraction",
    "version": "0.1",
    "x-build-id": "hevdV0yUaRFj3pMxx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/simpleapi~twitter-x-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-simpleapi-twitter-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/simpleapi~twitter-x-scraper/runs": {
      "post": {
        "operationId": "runs-sync-simpleapi-twitter-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/simpleapi~twitter-x-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-simpleapi-twitter-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": [
          "startUrls"
        ],
        "properties": {
          "startUrls": {
            "title": "🗺️ X Profiles, Handles or Search Terms",
            "type": "array",
            "description": "Profile URLs (https://x.com/nasa), bare handles (nasa, @nasa), numeric user ids, or search terms. A term with a space, a leading #, or a 'search:' prefix is treated as a search; anything that looks like a handle reads that profile's timeline. Profile timelines work with NO cookie. Example: [\"https://x.com/nasa\", \"search: street food\"].",
            "default": [
              "https://x.com/nasa",
              "search: street food"
            ],
            "items": {
              "type": "string"
            }
          },
          "placeSearchTerms": {
            "title": "📍 Place Search Terms",
            "type": "array",
            "description": "Search terms that always run through the place filters below. Leave the list empty to search on the place filters ALONE (e.g. every recent geo-tagged post in Japan). Example: [\"coffee\", \"traffic\"].",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "onlyGeoTaggedPosts": {
            "title": "🛰️ Only Posts Carrying A Real Place Tag",
            "type": "boolean",
            "description": "Sends X's server-side 'has:geo' operator, so every returned post carries a place object (id, name, full name, type, country, country code). Measured 40/40, 20/20 and 19/19 on live runs. X refuses to combine this with a radius search — if you set a radius as well, the radius wins and this is dropped with a warning in the log.",
            "default": true
          },
          "placeCountry": {
            "title": "🌍 Place Country (ISO-3166 alpha-2)",
            "type": "string",
            "description": "Two-letter country code sent as 'place_country:'. Measured exact: 20/20 rows matched GB, 20/20 JP, 20/20 FR. Combines cleanly with the geo-tag switch above. Example: GB, JP, FR, US, BR.",
            "default": ""
          },
          "placeId": {
            "title": "🏷️ Exact X Place ID",
            "type": "string",
            "description": "X's own place identifier, sent as 'place:'. You can read one off any row this actor returns (the placeId column). Measured exact: 20/20 and 10/10 returned posts carried that same place id. Example: 6863fd050de21120 (Leeds, England).",
            "default": ""
          },
          "nearPlace": {
            "title": "🧭 Near A Named Place",
            "type": "string",
            "description": "Free-text place name sent as 'near:\"…\" within:<radius>km'. Narrows genuinely — a live control run returned 0 % of the same post ids. Volume is small and X does NOT attach a place object to these posts, so use it to find posts published around a place rather than posts tagged to it. Example: London, New York, Tokyo.",
            "default": ""
          },
          "latitude": {
            "title": "📐 Latitude",
            "type": "string",
            "description": "Latitude in decimal degrees, -90 to 90, entered as text so decimals survive. Latitude AND longitude together send 'geocode:<lat>,<lon>,<radius>km' and override the named place above. Example: 40.7128 for New York.",
            "default": ""
          },
          "longitude": {
            "title": "📐 Longitude",
            "type": "string",
            "description": "Longitude in decimal degrees, -180 to 180. Only used when latitude is set as well. Example: -74.0060 for New York.",
            "default": ""
          },
          "radiusKm": {
            "title": "⭕ Radius Around That Place",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Radius in kilometres for the named-place or coordinate search (1-500). Ignored when neither is set. Default is 25.",
            "default": 25
          },
          "onlyWithMedia": {
            "title": "🖼️ Only Posts With A Photo Or Video",
            "type": "boolean",
            "description": "Adds X's server-side 'filter:media' operator to every place search, so the rows come back with pictures attached. Measured 15/15 and 20/20 media-carrying rows on live place runs. Leave off to keep text-only posts too.",
            "default": false
          },
          "mentioningHandle": {
            "title": "💬 Mentioning This Handle",
            "type": "string",
            "description": "Restrict the place search to posts that mention one account. Enter it with or without the @. Example: nasa.",
            "default": ""
          },
          "postLanguage": {
            "title": "🔤 Post Language",
            "type": "string",
            "description": "ISO 639-1 code sent as X's server-side 'lang:' operator, e.g. en, ja, fr, pt. Leave empty for every language.",
            "default": ""
          },
          "verifyGeoFilter": {
            "title": "🔬 Prove The Place Filter Really Applied",
            "type": "boolean",
            "description": "Proves the geographic operator was honoured. For the place-tag, country and place-id filters the proof is free: every returned post must carry a matching place object. For radius searches the same query is re-run WITHOUT its geographic tokens (one extra request) and the two post-id sets are compared — identical sets mean X ignored the operator. The outcome lands on the place_search row as geoFilterVerified / verificationMethod / controlRowCount / controlOverlap, and a filter that was ignored is logged as an error instead of quietly handing you a worldwide sweep.",
            "default": true
          },
          "authToken": {
            "title": "🔑 X auth_token Cookie",
            "type": "string",
            "description": "Your own X session cookie 'auth_token', taken from a logged-in browser. Needed ONLY for search and place filters — profile timelines run fully logged out. Stored encrypted by Apify and never written to the log."
          },
          "ct0": {
            "title": "🔑 X ct0 Cookie",
            "type": "string",
            "description": "Your own X 'ct0' cookie from the same browser session as auth_token. Sent as a cookie and as the x-csrf-token header. Stored encrypted by Apify and never written to the log."
          },
          "sortOrder": {
            "title": "🔃 Sort Order",
            "enum": [
              "newest",
              "oldest",
              "popular"
            ],
            "type": "string",
            "description": "'Newest first' and 'Oldest first' ask X for its chronological ranking and then sort the collected posts by post time; 'Most liked first' asks X for its Top ranking and sorts by like count. The sort runs BEFORE the maximum-posts cut, so 'Most liked first' really does return the most-liked posts. Tip: radius searches ('near'/coordinates) return noticeably more rows on 'Most liked first', because X's chronological index is thin for geography.",
            "default": "newest"
          },
          "maxTweets": {
            "title": "🔢 Maximum Posts Per Target",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Upper bound on posts returned per profile and per search term (1-100). X's own search index hands back roughly 20 posts per page and stops offering a cursor after a page or two on narrow geographic queries, so a place search often returns fewer than this. Default is 10.",
            "default": 10
          },
          "withReplies": {
            "title": "↩️ Include Replies",
            "type": "boolean",
            "description": "Keep posts that are replies to someone else. Turn off for original posts only.",
            "default": true
          },
          "includeUserInfo": {
            "title": "👤 Include The Author Profile Block",
            "type": "boolean",
            "description": "Attach the author's profile object (bio, avatar, join date, follower / following / post / media counts, website, self-typed location) to every post row. Turn off for a slimmer dataset.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy",
            "type": "object",
            "description": "Every outbound request — credential discovery, guest-token activation, profile timelines and searches — goes through this proxy. Residential is the default because X rate-limits datacenter ranges hard.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}