{
  "openapi": "3.0.1",
  "info": {
    "title": "X Advanced Search Scraper: Public Posts, No Login",
    "description": "Search public X (Twitter) posts by keyword, phrase, hashtag, account, language, date and engagement. Every filter is verified on the post. No login or cookies.",
    "version": "0.1",
    "x-build-id": "Z6XGw5oswDt5FsEs0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automation-lab~x-advanced-public-post-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automation-lab-x-advanced-public-post-search-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/automation-lab~x-advanced-public-post-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-automation-lab-x-advanced-public-post-search-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/automation-lab~x-advanced-public-post-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-automation-lab-x-advanced-public-post-search-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": {
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "One search per line, written like X search. Each line is a separate search with its own limit. Supported: plain words (all required, whole-word match, not case or accent sensitive), \"exact phrases\" (the words in that order), -excluded words, a OR b, #hashtags, $cashtags, @mentions, from:, to:, lang:, since:, until: (exclusive, as on X), min_faves:, min_retweets:, min_replies:, url:, filter:media, filter:images, filter:videos, filter:links, filter:replies, -filter:replies, -filter:quote, filter:verified. Words and phrases also match the author's handle and name and expanded links, not only the post body. Words joined by OR form an any-of group, and separate groups must all hold. Filters that can't be honored stop the run with a clear error before any charge: near:, within: and similar operators need a login on X, negated operators such as -lang: or -min_faves: aren't supported, and neither are repeated filters that can't both hold, such as lang:en lang:es. A repeated date or engagement filter keeps the stricter value.",
            "items": {
              "type": "string"
            }
          },
          "searchUrls": {
            "title": "X search URLs",
            "type": "array",
            "description": "Links such as https://x.com/search?q=bitcoin. The q= value is read as one search term. Other parameters in the link, such as f=live, are ignored; use Sort order instead.",
            "items": {
              "type": "string"
            }
          },
          "allWords": {
            "title": "All of these words",
            "type": "array",
            "description": "Each word must appear in the post. Combined with every search term, or forms the search when there are none. Whole-word match, not case or accent sensitive. The match covers post text, expanded links, and the author's handle and name.",
            "items": {
              "type": "string"
            }
          },
          "exactPhrases": {
            "title": "This exact phrase",
            "type": "array",
            "description": "The words must appear together in this order. Punctuation and case between them must match X's text, apart from repeated spaces and letter case. Like all text filters, it also matches the author's handle and name and expanded links.",
            "items": {
              "type": "string"
            }
          },
          "anyWords": {
            "title": "Any of these words",
            "type": "array",
            "description": "At least one must appear. Words or phrases both work. Any OR group in a search term must hold as well, so this narrows that search instead of widening it.",
            "items": {
              "type": "string"
            }
          },
          "excludeWords": {
            "title": "None of these words",
            "type": "array",
            "description": "Posts containing any of these words or phrases are dropped. The check also covers the author's handle and name and expanded links.",
            "items": {
              "type": "string"
            }
          },
          "hashtags": {
            "title": "Hashtags",
            "type": "array",
            "description": "Every hashtag must be on the post. With or without the #. Matching is exact, not by prefix.",
            "items": {
              "type": "string"
            }
          },
          "cashtags": {
            "title": "Cashtags",
            "type": "array",
            "description": "Every cashtag must be on the post. With or without the $.",
            "items": {
              "type": "string"
            }
          },
          "fromUsers": {
            "title": "From these accounts",
            "type": "array",
            "description": "Posts written by any of these accounts. Username, @username or profile link. Up to 20 per search. This mode also reads the account's latest and highlighted public posts directly from X, so it finds more than a keyword search. Don't combine with from: in a search term.",
            "items": {
              "type": "string"
            }
          },
          "toUsers": {
            "title": "Replying to these accounts",
            "type": "array",
            "description": "Posts that reply directly to any of these accounts. Don't combine with to: in a search term.",
            "items": {
              "type": "string"
            }
          },
          "mentioning": {
            "title": "Mentioning these accounts",
            "type": "array",
            "description": "Every account listed must be @-mentioned in the post.",
            "items": {
              "type": "string"
            }
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "X's language code, such as en, es or pt. Posts X labelled with another language are dropped. A search term with a different lang: stops the run with a clear error."
          },
          "since": {
            "title": "From date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Posts on or after this UTC date, YYYY-MM-DD. Long ranges are split into smaller date windows automatically so older posts are reached."
          },
          "until": {
            "title": "Until date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Posts before this UTC date, YYYY-MM-DD. Exclusive, like until: on X: 2026-11-01 ends on 31 October."
          },
          "minLikes": {
            "title": "Minimum likes",
            "minimum": 0,
            "type": "integer",
            "description": "Only posts with at least this many likes. 0 means no minimum.",
            "default": 0
          },
          "minReposts": {
            "title": "Minimum reposts",
            "minimum": 0,
            "type": "integer",
            "description": "Only posts with at least this many reposts. 0 means no minimum.",
            "default": 0
          },
          "minReplies": {
            "title": "Minimum replies",
            "minimum": 0,
            "type": "integer",
            "description": "Only posts with at least this many replies. 0 means no minimum.",
            "default": 0
          },
          "minViews": {
            "title": "Minimum views",
            "minimum": 0,
            "type": "integer",
            "description": "Only posts with at least this many views. 0 means no minimum.",
            "default": 0
          },
          "mediaType": {
            "title": "Media",
            "enum": [
              "any",
              "media",
              "images",
              "videos",
              "links"
            ],
            "type": "string",
            "description": "Keep only posts with this kind of content. Videos include animated GIFs. Links means an external link.",
            "default": "any"
          },
          "replies": {
            "title": "Replies",
            "enum": [
              "include",
              "exclude",
              "only"
            ],
            "type": "string",
            "description": "Include replies, drop them, or keep only replies. The index holds far fewer replies than original posts, so Only replies usually returns less.",
            "default": "include"
          },
          "includeQuotes": {
            "title": "Include quote posts",
            "type": "boolean",
            "description": "Turn off to drop posts that quote another post.",
            "default": true
          },
          "verifiedOnly": {
            "title": "Verified authors only",
            "type": "boolean",
            "description": "Keep only posts from accounts with X's verified badge.",
            "default": false
          },
          "sortBy": {
            "title": "Sort order",
            "enum": [
              "latest",
              "top",
              "relevance"
            ],
            "type": "string",
            "description": "Order of the results within each search. Latest: newest first. Top: most liked first. Relevance: the search index's own order. Latest and Top sort the matching posts this run found (up to 1.2 times the limit); they aren't X's own Latest and Top tabs. Results are written when the search finishes; Relevance writes them as they are found.",
            "default": "latest"
          },
          "maxItems": {
            "title": "Maximum posts per search",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "The most posts to deliver for each search term. You pay a small start fee per run plus each delivered post, so a run with no matches still costs the start fee. The real number can be lower when the index has no more matching posts. Each post is delivered once per run, even if it matches several searches.",
            "default": 50
          },
          "maxPostsToScan": {
            "title": "Maximum posts to scan per search",
            "minimum": 10,
            "maximum": 50000,
            "type": "integer",
            "description": "The most candidate posts to read per search. Scanned posts that don't match aren't charged. Leave empty for automatic: up to 8 times the limit and at least 300. Set a lower number to end a search sooner, or a higher one to read further into a search with many matches. In both cases a search stops early when too few scanned posts match, because scanning isn't charged, so a higher number doesn't force a deeper scan of a very narrow filter."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}