{
  "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": "3.0",
    "x-build-id": "Dg9TESpLzbNzRWFzP"
  },
  "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": {
          "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 complete public X or Twitter search, profile, list, or conversation URLs. To find quotes of a post URL, choose Quoted posts.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "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."
          },
          "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, include available past verification badge details, up to the history limit per profile. Leave it off to skip this history, whatever the limit. Current verification details and the verification start date are still collected.",
            "default": false
          },
          "archivedVerificationHistoryLimit": {
            "title": "Past verification entries per profile",
            "minimum": 0,
            "type": "integer",
            "description": "For Profiles with past verification details on, collect a sample of up to this many past badge entries per profile, where available. Leave it empty to use 3. Use 0 for all available entries. Full history can take a long time. With past verification details off, no past badge entries are collected.",
            "default": 3
          },
          "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"
          },
          "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."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}