{
  "openapi": "3.0.1",
  "info": {
    "title": "Twitter (X) Scraper",
    "description": "Collect public Twitter/X posts, profile search matches, profile network members, and regional trends. Export text, links, author data, media, engagement counts, and source details.",
    "version": "0.4",
    "x-build-id": "RrQRfXhcv9QQ10s2z"
  },
  "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": "Target",
            "enum": [
              "searchPosts",
              "searchProfiles",
              "networkMembers",
              "trendingTopics"
            ],
            "type": "string",
            "description": "Choose the kind of rows to collect."
          },
          "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. Choose a Twitter/X trend region from the supported list.",
            "default": "1"
          },
          "profileSearchQueries": {
            "title": "People search queries",
            "minItems": 1,
            "type": "array",
            "description": "Search profiles only. Enter one or more Twitter/X People search queries. This finds matching accounts but does not open each profile page.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "directPostUrls": {
            "title": "Direct post URLs",
            "minItems": 1,
            "type": "array",
            "description": "Search posts only. Add public X/Twitter post URLs to collect those exact posts.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "directPostIds": {
            "title": "Direct post IDs",
            "minItems": 1,
            "type": "array",
            "description": "Search posts only. Add numeric public X/Twitter post IDs to collect those exact posts.",
            "items": {
              "type": "string",
              "pattern": "^[0-9]+$"
            }
          },
          "conversationIds": {
            "title": "Conversation IDs",
            "minItems": 1,
            "type": "array",
            "description": "Search posts only. Find public posts that belong to these conversations.",
            "items": {
              "type": "string",
              "pattern": "^[0-9]+$"
            }
          },
          "quotedPostIds": {
            "title": "Quoted post IDs",
            "minItems": 1,
            "type": "array",
            "description": "Search posts only. Find public posts that quote these post IDs.",
            "items": {
              "type": "string",
              "pattern": "^[0-9]+$"
            }
          },
          "postSearchUrls": {
            "title": "Post search URLs",
            "minItems": 1,
            "type": "array",
            "description": "Search posts only. Add Twitter/X search, profile, list, or post URLs. A post URL finds posts that quote it. It does not fetch that post or 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 puts new posts first. Top uses Twitter/X's ranking. Latest + Top runs both, and each post is saved once.",
            "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"
          },
          "postKinds": {
            "title": "Post kinds",
            "minItems": 1,
            "uniqueItems": true,
            "type": "array",
            "description": "Search posts only. Choose one or more kinds of posts to keep.",
            "items": {
              "type": "string",
              "enum": [
                "originalPosts",
                "quotePosts",
                "replies",
                "reposts"
              ],
              "enumTitles": [
                "Original posts",
                "Quote posts",
                "Replies",
                "Reposts"
              ]
            },
            "default": [
              "originalPosts",
              "quotePosts",
              "replies"
            ]
          },
          "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."
          },
          "networkProfileHandles": {
            "title": "Network profile handles",
            "minItems": 1,
            "type": "array",
            "description": "Profile network members only. Add public profile handles without @.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "networkType": {
            "title": "Network type",
            "enum": [
              "followers",
              "following"
            ],
            "type": "string",
            "description": "Profile network members only. Choose followers or accounts followed by the profile.",
            "default": "followers"
          },
          "maxNbItemsToScrape": {
            "title": "Maximum items across the whole run",
            "minimum": 1,
            "type": "integer",
            "description": "🔢 Stop after this many rows across the whole run. Leave it empty to return all available results until the source is exhausted."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}