{
  "openapi": "3.0.1",
  "info": {
    "title": "Twitter X Tweets Profiles Scraper",
    "description": "🐦 X (Twitter) Tweets & Profiles Scraper extracts public tweets, bios, followers, hashtags, mentions, links, dates & engagement. 📊 Filter by keywords or usernames and export to CSV/JSON. 🚀 Ideal for social listening, competitor analysis, research & lead gen.",
    "version": "0.1",
    "x-build-id": "HDrsypfsiELWApiLb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/api-empire~twitter-x-tweets-profiles-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-api-empire-twitter-x-tweets-profiles-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-profiles-scraper/runs": {
      "post": {
        "operationId": "runs-sync-api-empire-twitter-x-tweets-profiles-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-profiles-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-api-empire-twitter-x-tweets-profiles-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": "Targets — profile URLs, @usernames or keywords",
            "type": "array",
            "description": "One target per line. Profile URLs, usernames, numeric user IDs and keywords may be mixed.\n\nNote: keyword targets need the optional login cookies below — X's SearchTimeline endpoint returns HTTP 404 to anonymous callers. Profile targets work without any credentials.",
            "items": {
              "type": "string"
            }
          },
          "maxTweets": {
            "title": "Maximum posts per target",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many posts to collect for each target. Paging stops as soon as this many posts pass your filters.\n\nX itself limits what a logged-out client can see: most accounts expose roughly the 100–800 most recent posts, and for very large accounts X returns a ranked 'top posts' page with no pagination cursor. Setting a number higher than X exposes simply returns everything available.",
            "default": 10
          },
          "resultType": {
            "title": "What to output",
            "enum": [
              "tweets",
              "profiles",
              "both"
            ],
            "type": "string",
            "description": "• Tweets — one dataset item per post (each carrying the author profile)\n• Profiles — one dataset item per target account only, no posts\n• Both — the profile item plus its posts",
            "default": "tweets"
          },
          "sortOrder": {
            "title": "Sort order",
            "enum": [
              "newest",
              "oldest",
              "mostLikes",
              "mostRetweets"
            ],
            "type": "string",
            "description": "How posts are ordered before the maximum is applied.\n\n'Newest first' takes the posts straight off the top of the timeline. The other orders first gather a larger pool from the timeline (up to 200 posts, bounded by the run time limit) and then sort it, so 'oldest first' and 'most likes first' reach beyond the first page.",
            "default": "newest"
          },
          "withReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Keep reply posts in the output. Turn off to collect only standalone posts.\n\nWithout login cookies X only exposes an account's own timeline, so the replies available anonymously are self-thread replies. Replies to other accounts need the login cookies below.",
            "default": true
          },
          "includeRetweets": {
            "title": "Include retweets",
            "type": "boolean",
            "description": "Keep retweets (reposts) in the output. Turn off to collect only original posts by the account. Engagement figures on a retweet are those of the original post.",
            "default": true
          },
          "includeUserInfo": {
            "title": "Include author profile with each post",
            "type": "boolean",
            "description": "Attach the full author profile (follower counts, bio, join date, verification) to every post as a nested `user` object. Turn off for slimmer output.",
            "default": true
          },
          "maxRunTimeSecs": {
            "title": "Maximum run time",
            "minimum": 30,
            "maximum": 21600,
            "type": "integer",
            "description": "Hard wall-clock limit. When it is reached the Actor stops paging, keeps everything collected so far and finishes.",
            "default": 900
          },
          "authToken": {
            "title": "X `auth_token` cookie (optional)",
            "type": "string",
            "description": "Optional. The `auth_token` cookie from a logged-in x.com browser session. Supplying it (together with the `ct0` cookie below) unlocks keyword search and the full replies timeline, which X blocks for anonymous callers. Leave empty to run fully anonymously."
          },
          "csrfToken": {
            "title": "X `ct0` cookie (optional)",
            "type": "string",
            "description": "Optional. The `ct0` cookie from the same logged-in x.com session. Required together with `auth_token`."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Route requests through Apify Proxy. Not required — X's guest API answers direct requests — but useful if your runs get rate-limited. If the selected proxy group is unavailable the Actor falls back to RESIDENTIAL and then to a direct connection instead of failing.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}