{
  "openapi": "3.0.1",
  "info": {
    "title": "Twitter (X) Scraper",
    "description": "Collect public X posts, profiles, network members, and regional trends. Filter posts by date, language, media, links, and engagement, then save structured rows to an Apify dataset without X credentials.",
    "version": "5.0",
    "x-build-id": "a3P093n7ZR1c9IEJa"
  },
  "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",
        "required": [
          "target"
        ],
        "properties": {
          "maxNbItemsToScrape": {
            "title": "Maximum results",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many rows. Leave it empty or use 0 to collect all available results."
          },
          "target": {
            "title": "Result type",
            "enum": [
              "searchPosts",
              "searchProfiles",
              "trendingTopics"
            ],
            "type": "string",
            "description": "Choose the kind of data to collect. Use one result type per run."
          },
          "postDiscoveryMethod": {
            "title": "Find posts by",
            "enum": [
              "searchQuery",
              "directPosts",
              "conversationIds",
              "quotedPostIds",
              "sourceUrls"
            ],
            "type": "string",
            "description": "Choose one way to find public posts. Values for the other methods are ignored.",
            "default": "searchQuery"
          },
          "searchQuery": {
            "title": "Search query: Queries",
            "minItems": 1,
            "type": "array",
            "description": "Enter one or more search queries. Each entry is one full query, including any spaces or line breaks. Use plain text or X search syntax, such as OpenAI or from:OpenAI.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "directPostUrls": {
            "title": "Direct post URLs or IDs: Posts",
            "minItems": 1,
            "type": "array",
            "description": "Add one or more public X or Twitter post URLs or numeric IDs to fetch those exact posts.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "conversationIds": {
            "title": "Conversation IDs: IDs",
            "minItems": 1,
            "type": "array",
            "description": "Find public posts in these conversations. Open the original post that started each conversation. Copy the digits after /status/ in its URL, not a reply's ID. For example, https://x.com/NASA/status/2110798512795377741 gives 2110798512795377741. To reach the original post, open earlier posts' timestamp links in new tabs if needed.",
            "items": {
              "type": "string",
              "pattern": "^[0-9]+$"
            }
          },
          "quotedPostIds": {
            "title": "Quoted posts: Posts",
            "minItems": 1,
            "type": "array",
            "description": "Add public post URLs or numeric post IDs to find posts that quote them.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "postSearchUrls": {
            "title": "Source URLs: URLs",
            "minItems": 1,
            "type": "array",
            "description": "Add a JSON array of complete public X or Twitter search, profile, list, or conversation URLs. Each entry is a URL string or an object with a required url string. For example: [\"https://x.com/Alina_with_Ai\"]. The object form is [{\"url\":\"https://x.com/Alina_with_Ai\"}]. To find quotes of a post, choose Quoted posts."
          },
          "hashtags": {
            "title": "Hashtags",
            "minItems": 1,
            "type": "array",
            "description": "Keep posts that contain these hashtags. Enter each tag without #.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "fromUsers": {
            "title": "From authors",
            "minItems": 1,
            "type": "array",
            "description": "Keep only posts written by these handles. Enter each handle without @.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "authorVerification": {
            "title": "Author verification",
            "enum": [
              "any",
              "verified",
              "notVerified"
            ],
            "type": "string",
            "description": "Choose whether to include authors with any status, only verified authors, or authors not marked verified.",
            "default": "any"
          },
          "mentions": {
            "title": "Mentioning users",
            "minItems": 1,
            "type": "array",
            "description": "Keep only posts that mention these handles. Enter each handle without @.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "toUsers": {
            "title": "Replying to users",
            "minItems": 1,
            "type": "array",
            "description": "Keep only posts addressed to these handles. Enter each handle without @.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "searchMode": {
            "title": "Search mode",
            "enum": [
              "latest",
              "top",
              "latestAndTop"
            ],
            "type": "string",
            "description": "Choose how search results are ordered. Latest puts new posts first. Top uses X ranking. Latest + Top runs both and saves each post once.",
            "default": "latest"
          },
          "startDate": {
            "title": "Start date",
            "minLength": 1,
            "type": "string",
            "description": "Only keep posts on or after this date. If you include a time in JSON, use UTC, such as 2026-08-08T17:22:58.797Z. If you leave it empty, the search uses the last 30 days."
          },
          "endDate": {
            "title": "End date",
            "minLength": 1,
            "type": "string",
            "description": "Only keep posts on or before this date. If you include a time in JSON, use UTC, such as 2026-08-08T17:22:58.797Z."
          },
          "language": {
            "title": "Language code",
            "minLength": 1,
            "type": "string",
            "description": "Keep posts in this language code, such as en, es, fr, or ja."
          },
          "placeId": {
            "title": "Place ID",
            "minLength": 1,
            "type": "string",
            "description": "Set an X or Twitter place ID. Find a public post with an attached location and copy its location link. Use the ID after /places/, such as 5a110d312052166f from /places/5a110d312052166f. A city name or address is not a place ID. Many posts have no attached location. Copying the link can show the ID even if opening it asks you to sign in."
          },
          "links": {
            "title": "Links",
            "enum": [
              "include",
              "onlyLinks",
              "onlyWithoutLinks"
            ],
            "type": "string",
            "description": "Choose whether matching posts may include links.",
            "default": "include"
          },
          "media": {
            "title": "Media",
            "enum": [
              "include",
              "onlyMedia",
              "onlyImages",
              "onlyVideos"
            ],
            "type": "string",
            "description": "Choose whether matching posts must contain media.",
            "default": "include"
          },
          "postKinds": {
            "title": "Post kinds",
            "minItems": 1,
            "uniqueItems": true,
            "type": "array",
            "description": "Choose one or more post kinds 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": "Keep only posts with at least this many likes."
          },
          "minReplies": {
            "title": "Minimum replies",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only posts with at least this many replies."
          },
          "minRetweets": {
            "title": "Minimum reposts",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only posts with at least this many reposts."
          },
          "sinceId": {
            "title": "Minimum post ID",
            "minLength": 1,
            "type": "string",
            "description": "Keep posts after this X post ID."
          },
          "maxId": {
            "title": "Maximum post ID",
            "minLength": 1,
            "type": "string",
            "description": "Keep posts at or before this X post ID."
          },
          "includePostClientLabel": {
            "title": "Include post client app",
            "type": "boolean",
            "description": "For Search posts, add the app label used to publish each post, where available. This is charged per post. Leave it off to skip this label.",
            "default": false
          },
          "profileDiscoveryMethod": {
            "title": "Find profiles by",
            "enum": [
              "searchPhrases",
              "directTargets",
              "followers",
              "following",
              "retweeters"
            ],
            "type": "string",
            "description": "Choose how to find public profiles.",
            "default": "searchPhrases"
          },
          "profileSearchQueries": {
            "title": "Search phrases: Queries",
            "minItems": 1,
            "type": "array",
            "description": "Enter one or more X or Twitter People search phrases to find matching public profiles.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "retweeterPostUrlsOrIds": {
            "title": "Post retweeters: Posts",
            "minItems": 1,
            "type": "array",
            "description": "Add one or more public post URLs or IDs. The Actor finds profiles that retweeted them when X exposes that audience.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "profileLookupTargets": {
            "title": "Profile targets",
            "minItems": 1,
            "type": "array",
            "description": "Add public profile handles, complete profile URLs, or numeric user IDs for Handles, URLs, or IDs, Followers, or Following. Enter handles without @.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "includeArchivedVerificationHistory": {
            "title": "Include past verification details",
            "type": "boolean",
            "description": "For Profiles, collect available past X verification evidence. This is charged per profile. This can make the run take much longer. Leave it off to skip this extra history. Current X verification details and dates are still collected.",
            "default": false
          },
          "maxPastVerificationEntriesPerProfile": {
            "title": "Past verification entries per profile",
            "minimum": 0,
            "type": "integer",
            "description": "When Include past verification details is on, save a sample of up to this many past verification entries for each profile, where available. Leave it empty to use 10. Use 0 to collect all available entries. This can take hours for well-known accounts. When the switch is off, no past entries are collected.",
            "default": 10
          },
          "includeUsernameHistory": {
            "title": "Include username history",
            "type": "boolean",
            "description": "For Profiles, add past handles and the dates they changed, where available. This is charged per profile. Leave it off to skip this history.",
            "default": false
          },
          "maxUsernameHistoryEntriesPerProfile": {
            "title": "Past handles per profile",
            "minimum": 0,
            "type": "integer",
            "description": "When Include username history is on, save up to this many past handles for each profile, where available. Leave it empty to use 10. Use 0 to collect all available handles. When the switch is off, no past handles are collected.",
            "default": 10
          },
          "includeAccountRegion": {
            "title": "Include account region",
            "type": "boolean",
            "description": "For Profiles, add the country the account is based in and how accurate that country is, where available. This is charged per profile. Leave it off to skip it.",
            "default": false
          },
          "includeDirectMessagePermission": {
            "title": "Include direct message permission",
            "type": "boolean",
            "description": "For Profiles, add whether each profile accepts direct messages, where available. This is charged per profile. Leave it off to skip it.",
            "default": false
          },
          "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": "Choose one supported region for current trend topics.",
            "default": "1"
          },
          "transformFunction": {
            "title": "Transform each result",
            "type": "string",
            "description": "Optional JavaScript function that takes one result as item and returns one object. Use fixed rules to change the data. For example: (item) => ({ ...item, label: \"X\" }). Leave empty to keep the original data. This applies to every result type."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}