{
  "openapi": "3.0.1",
  "info": {
    "title": "Twitter (X) Scraper",
    "description": "The best Apify Twitter (X) scraper. It offers a variety of filter options without needing any account credentials.",
    "version": "0.3",
    "x-build-id": "qNXLeB6ut1eKkgK4i"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/maximedupre~twitter-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-maximedupre-twitter-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/maximedupre~twitter-scraper/runs": {
      "post": {
        "operationId": "runs-sync-maximedupre-twitter-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/maximedupre~twitter-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-maximedupre-twitter-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",
        "properties": {
          "target": {
            "title": "What to collect",
            "enum": [
              "searchPosts",
              "searchProfiles",
              "trendingTopics"
            ],
            "type": "string",
            "description": "🎯 Choose the dataset row type for this run. Search posts emits post rows; Search profiles emits profile rows; Trending topics emits trend rows.",
            "default": "searchPosts"
          },
          "trendRegionId": {
            "title": "Trend region",
            "enum": [
              "1",
              "23424740",
              "23424747",
              "23424748",
              "23424750",
              "23424753",
              "23424765",
              "23424757",
              "23424768",
              "23424775",
              "23424782",
              "23424787",
              "23424796",
              "23424800",
              "23424801",
              "23424802",
              "23424819",
              "23424829",
              "23424824",
              "23424833",
              "23424834",
              "23424848",
              "23424846",
              "23424803",
              "23424852",
              "23424853",
              "23424856",
              "23424860",
              "23424863",
              "23424868",
              "23424870",
              "23424874",
              "23424873",
              "23424901",
              "23424900",
              "23424909",
              "23424916",
              "23424908",
              "23424910",
              "23424898",
              "23424922",
              "23424924",
              "23424919",
              "23424934",
              "23424923",
              "23424925",
              "23424935",
              "23424930",
              "23424936",
              "23424938",
              "23424948",
              "23424942",
              "23424950",
              "23424954",
              "23424957",
              "23424960",
              "23424969",
              "23424976",
              "23424738",
              "23424975",
              "23424977",
              "23424982",
              "23424984"
            ],
            "type": "string",
            "description": "📍 Trending topics only. Select a verified Twitter/X trend region. Region choices come from Twitter/X's live trend-location source, so runs avoid fake or unsupported locations.",
            "default": "1"
          },
          "profileSearchQueries": {
            "title": "People search queries",
            "minItems": 1,
            "type": "array",
            "description": "👤 Search profiles only. Enter one or more X/Twitter People search queries. This discovers matching accounts; it does not scrape profile detail pages.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "postSearchUrls": {
            "title": "Post search URLs",
            "minItems": 1,
            "type": "array",
            "description": "🔗 Search posts only. Paste X/Twitter search, profile, list, or status URLs. Status URLs search for posts quoting that status; they do not fetch the status itself or scrape its full thread.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "searchQuery": {
            "title": "Search query",
            "minLength": 1,
            "type": "string",
            "description": "🔎 Search posts only. Plain text or X/Twitter search syntax, such as openai, from:OpenAI, or \"web scraping\" lang:en -filter:retweets."
          },
          "hashtags": {
            "title": "Hashtags",
            "minItems": 1,
            "type": "array",
            "description": "🔎 Search posts only. Hashtags matching posts must contain. Do not include #.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "fromUsers": {
            "title": "From authors",
            "minItems": 1,
            "type": "array",
            "description": "👤 Search posts only. Only include posts written by these handles. Do not include @.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "mentions": {
            "title": "Mentioning users",
            "minItems": 1,
            "type": "array",
            "description": "💬 Search posts only. Only include posts that mention these handles. Do not include @.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "toUsers": {
            "title": "Replying to users",
            "minItems": 1,
            "type": "array",
            "description": "↩️ Search posts only. Only include posts addressed to these handles. Do not include @.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "searchMode": {
            "title": "Search mode",
            "enum": [
              "latest",
              "top",
              "latestAndTop"
            ],
            "type": "string",
            "description": "🧭 Search posts only. Latest returns newest matching posts first. Top preserves X top-search ranking. Latest + Top runs both and deduplicates posts by ID.",
            "default": "latest"
          },
          "startDate": {
            "title": "Start date",
            "minLength": 1,
            "type": "string",
            "description": "🗓️ Search posts only. Only include posts on or after this date. When omitted, Search posts uses the last 30 days."
          },
          "endDate": {
            "title": "End date",
            "minLength": 1,
            "type": "string",
            "description": "🗓️ Search posts only. Only include posts on or before this date."
          },
          "language": {
            "title": "Language code",
            "minLength": 1,
            "type": "string",
            "description": "🌐 Search posts only. Only include posts in a language code such as en, es, fr, or ja."
          },
          "near": {
            "title": "Near",
            "minLength": 1,
            "type": "string",
            "description": "📍 Search posts only. Place name for X/Twitter location search, such as New York or San Francisco. Add Within for a tighter radius."
          },
          "within": {
            "title": "Within",
            "minLength": 1,
            "type": "string",
            "description": "📍 Search posts only. Radius for Near, such as 10mi or 25km."
          },
          "geocode": {
            "title": "Geocode",
            "minLength": 1,
            "type": "string",
            "description": "📍 Search posts only. Latitude, longitude, and radius, such as 37.776,-122.417,10km."
          },
          "placeId": {
            "title": "Place ID",
            "minLength": 1,
            "type": "string",
            "description": "📍 Search posts only. X/Twitter place ID."
          },
          "links": {
            "title": "Links",
            "enum": [
              "include",
              "onlyLinks",
              "onlyWithoutLinks"
            ],
            "type": "string",
            "description": "🔗 Search posts only. Choose whether matching posts may include links.",
            "default": "include"
          },
          "media": {
            "title": "Media",
            "enum": [
              "include",
              "onlyMedia",
              "onlyImages",
              "onlyVideos"
            ],
            "type": "string",
            "description": "🖼️ Search posts only. Choose whether matching posts must contain media.",
            "default": "include"
          },
          "shouldIncludeOriginalPosts": {
            "title": "Original posts",
            "type": "boolean",
            "description": "📄 Search posts only. Keep original posts in the output.",
            "default": true
          },
          "shouldIncludeQuotePosts": {
            "title": "Quote posts",
            "type": "boolean",
            "description": "💬 Search posts only. Keep quote posts in the output.",
            "default": true
          },
          "shouldIncludeReplies": {
            "title": "Replies",
            "type": "boolean",
            "description": "↩️ Search posts only. Keep replies in the output.",
            "default": true
          },
          "shouldIncludeReposts": {
            "title": "Reposts",
            "type": "boolean",
            "description": "🔁 Search posts only. Keep reposts without added text in the output.",
            "default": false
          },
          "minLikes": {
            "title": "Minimum likes",
            "minimum": 0,
            "type": "integer",
            "description": "❤️ Search posts only. Only include posts with at least this many likes."
          },
          "minReplies": {
            "title": "Minimum replies",
            "minimum": 0,
            "type": "integer",
            "description": "💬 Search posts only. Only include posts with at least this many replies."
          },
          "minRetweets": {
            "title": "Minimum reposts",
            "minimum": 0,
            "type": "integer",
            "description": "🔁 Search posts only. Only include posts with at least this many reposts."
          },
          "shouldIncludePromotedPosts": {
            "title": "Include promoted posts",
            "type": "boolean",
            "description": "📣 Search posts only. Keep promoted search results in the output.",
            "default": false
          },
          "sinceId": {
            "title": "Minimum post ID",
            "minLength": 1,
            "type": "string",
            "description": "⏭️ Search posts only. Restrict the search to posts after this X post ID."
          },
          "maxId": {
            "title": "Maximum post ID",
            "minLength": 1,
            "type": "string",
            "description": "⏮️ Search posts only. Restrict the search to posts at or before this X post ID."
          },
          "maxNbItemsToScrape": {
            "title": "Maximum items across the whole run",
            "minimum": 0,
            "type": "integer",
            "description": "🔢 Optional cap applied across the whole Twitter/X run. Use `0` for all available rows for the selected target, or keep a small cap such as `25` for a starter run.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}