{
  "openapi": "3.0.1",
  "info": {
    "title": "Twitter (X) Data API: Tweets, Profiles, Followers, Search",
    "description": "Get tweets, search results, profiles, followers, following, replies, retweeters, list and community tweets, and trends from X (Twitter) as clean JSON. No login, no browser, no X account needed.",
    "version": "0.1",
    "x-build-id": "0ePN2W3CroberA1Ab"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kiddodev~twitter-x-data-twittrapi/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kiddodev-twitter-x-data-twittrapi",
        "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/kiddodev~twitter-x-data-twittrapi/runs": {
      "post": {
        "operationId": "runs-sync-kiddodev-twitter-x-data-twittrapi",
        "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/kiddodev~twitter-x-data-twittrapi/run-sync": {
      "post": {
        "operationId": "run-sync-kiddodev-twitter-x-data-twittrapi",
        "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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "searchTweets",
              "userTweets",
              "userProfiles",
              "followers",
              "following",
              "tweetReplies",
              "tweetRetweeters",
              "listTweets",
              "communityTweets",
              "trends"
            ],
            "type": "string",
            "description": "What to collect. Each mode reads one of the fields below:<br><b>Search tweets</b>: Search queries.<br><b>User tweets</b>, <b>User profiles</b>, <b>Followers</b>, <b>Following</b>: Usernames or User IDs.<br><b>Tweet replies</b>, <b>Tweet retweeters</b>: Tweet IDs or URLs.<br><b>List tweets</b>: List IDs. <b>Community tweets</b>: Community IDs. <b>Trends</b>: Locations (WOEIDs).",
            "default": "searchTweets"
          },
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "For mode <b>Search tweets</b>. One query per line. X search operators work, for example <code>from:nasa</code>, <code>\"exact phrase\"</code>, <code>lang:en</code>, <code>since:2025-01-01</code>, <code>min_faves:100</code>, <code>-filter:replies</code>. Max 512 characters per query.",
            "items": {
              "type": "string"
            }
          },
          "searchCategory": {
            "title": "Search tab",
            "enum": [
              "Latest",
              "Top",
              "People",
              "Photos",
              "Videos"
            ],
            "type": "string",
            "description": "Which X search tab to read. <b>Latest</b> is newest first. <b>People</b> returns accounts instead of tweets.",
            "default": "Latest"
          },
          "usernames": {
            "title": "Usernames",
            "type": "array",
            "description": "For modes <b>User tweets</b>, <b>User profiles</b>, <b>Followers</b> and <b>Following</b>. One per line: <code>nasa</code>, <code>@nasa</code> or <code>https://x.com/nasa</code>.",
            "items": {
              "type": "string"
            }
          },
          "userIds": {
            "title": "User IDs",
            "type": "array",
            "description": "Numeric X user IDs (rest_id), one per line. Slightly faster than usernames. User profiles are fetched 100 IDs per request.",
            "items": {
              "type": "string"
            }
          },
          "tweetIds": {
            "title": "Tweet IDs or URLs",
            "type": "array",
            "description": "For modes <b>Tweet replies</b> and <b>Tweet retweeters</b>. One per line: the numeric ID or the tweet URL, e.g. <code>https://x.com/nasa/status/1844000000000000001</code>.",
            "items": {
              "type": "string"
            }
          },
          "listIds": {
            "title": "List IDs or URLs",
            "type": "array",
            "description": "For mode <b>List tweets</b>. Numeric list ID or URL, e.g. <code>https://x.com/i/lists/1234567890</code>.",
            "items": {
              "type": "string"
            }
          },
          "communityIds": {
            "title": "Community IDs or URLs",
            "type": "array",
            "description": "For mode <b>Community tweets</b>. Numeric community ID or URL, e.g. <code>https://x.com/i/communities/1234567890</code>.",
            "items": {
              "type": "string"
            }
          },
          "woeids": {
            "title": "Trend locations (WOEID)",
            "type": "array",
            "description": "For mode <b>Trends</b>. Yahoo WOEIDs: <code>1</code> = worldwide, <code>23424977</code> = United States, <code>23424975</code> = United Kingdom, <code>23424829</code> = Germany. Defaults to worldwide.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max items per input",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many results for each query, user, tweet, list, community or location. You pay per result, so this also caps the cost per input.",
            "default": 100
          },
          "maxPages": {
            "title": "Max pages per input",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Safety limit on requests per input. A page usually holds about 20 results. Raise it together with Max items for large pulls.",
            "default": 20
          },
          "includeRaw": {
            "title": "Include raw X data",
            "type": "boolean",
            "description": "Adds a <code>raw</code> field with X's original JSON for each item. Useful for fields this Actor does not flatten. Makes items much larger.",
            "default": 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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}