{
  "openapi": "3.0.1",
  "info": {
    "title": "X (Twitter) Advanced Search Scraper & API",
    "description": "Search public X (Twitter) posts by keyword, hashtag, or account. Filter by date, language, media, and engagement. Run up to 25 searches and export tweets, author profiles, metrics, and X Articles as JSON or CSV for social listening and competitor research. No X login or X API key required.",
    "version": "0.1",
    "x-build-id": "u2PN0S40ZmWGQ2tCh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/arjun_code~x-twitter-advanced-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-arjun_code-x-twitter-advanced-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/arjun_code~x-twitter-advanced-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-arjun_code-x-twitter-advanced-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/arjun_code~x-twitter-advanced-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-arjun_code-x-twitter-advanced-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",
        "required": [
          "searchMode",
          "maxPostsPerQuery"
        ],
        "properties": {
          "searchQueries": {
            "title": "Keywords or search queries",
            "maxItems": 25,
            "type": "array",
            "description": "Enter one search per line, such as AI agents or from:OpenAI. Each line runs separately with the same filters. Enter up to 25 lines per run.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "searchMode": {
            "title": "Result order",
            "enum": [
              "Latest",
              "Top"
            ],
            "type": "string",
            "description": "Choose Latest posts for the newest results or Top posts for X's relevance ranking.",
            "default": "Latest"
          },
          "maxPostsPerQuery": {
            "title": "Posts to save per search",
            "minimum": 0,
            "type": "integer",
            "description": "Set a maximum for each search. Start with 5 to preview results. Enter 0 to collect all results X makes available for that search.",
            "default": 100
          },
          "language": {
            "title": "Post language",
            "enum": [
              "",
              "ar",
              "bn",
              "bg",
              "ca",
              "zh",
              "cs",
              "da",
              "nl",
              "en",
              "fi",
              "fr",
              "de",
              "el",
              "gu",
              "he",
              "hi",
              "hu",
              "id",
              "it",
              "ja",
              "kn",
              "ko",
              "ms",
              "mr",
              "no",
              "fa",
              "pl",
              "pt",
              "ro",
              "ru",
              "sr",
              "sk",
              "es",
              "sv",
              "ta",
              "th",
              "tr",
              "uk",
              "ur",
              "vi"
            ],
            "type": "string",
            "description": "Choose Any language to search across languages, or select one language. The sample search uses English.",
            "default": ""
          },
          "exactPhrase": {
            "title": "Exact phrase",
            "type": "string",
            "description": "Match a phrase in the same word order, such as artificial intelligence. Enter the phrase without quotation marks."
          },
          "anyWords": {
            "title": "Any of these words or phrases",
            "type": "array",
            "description": "Enter one word or phrase per line. For example, enter ChatGPT and Claude on separate lines to match either term.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "hashtags": {
            "title": "Hashtags to include",
            "type": "array",
            "description": "Enter tags such as #AI or #MachineLearning, one per line. Posts can match any listed tag. The # is optional.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "cashtags": {
            "title": "Stock and crypto symbols",
            "type": "array",
            "description": "Enter symbols such as $AAPL or $BTC, one per line. Posts can match any listed symbol. The $ is optional.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "fromUsers": {
            "title": "Posts from accounts",
            "type": "array",
            "description": "Find posts written by the accounts you list.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "toUsers": {
            "title": "Replies to accounts",
            "type": "array",
            "description": "Find replies sent to the accounts you list.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "mentionUsers": {
            "title": "Posts mentioning accounts",
            "type": "array",
            "description": "Find posts that mention the accounts you list.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "startDate": {
            "title": "Posted on or after",
            "type": "string",
            "description": "Include posts published on or after this UTC date."
          },
          "endDate": {
            "title": "Posted on or before",
            "type": "string",
            "description": "Include posts through the end of this UTC date."
          },
          "postType": {
            "title": "Post type",
            "enum": [
              "any",
              "originals",
              "replies",
              "retweets",
              "quotes"
            ],
            "type": "string",
            "description": "Original posts excludes replies, reposts, and quote posts. Choose Any post type to include them all.",
            "default": "any"
          },
          "mediaType": {
            "title": "Media or links",
            "enum": [
              "any",
              "media",
              "images",
              "videos",
              "links"
            ],
            "type": "string",
            "description": "Choose images, videos, links, or any media. Choose Any content to include posts with or without attachments.",
            "default": "any"
          },
          "minLikes": {
            "title": "Minimum likes",
            "minimum": 0,
            "type": "integer",
            "description": "Include posts with at least this many likes.",
            "default": 0
          },
          "minRetweets": {
            "title": "Minimum reposts",
            "minimum": 0,
            "type": "integer",
            "description": "Include posts that have been reposted at least this many times.",
            "default": 0
          },
          "minReplies": {
            "title": "Minimum replies",
            "minimum": 0,
            "type": "integer",
            "description": "Include posts with at least this many replies.",
            "default": 0
          },
          "excludeWords": {
            "title": "Words or phrases to exclude",
            "type": "array",
            "description": "Enter one word or phrase per line. For example, add giveaway to leave out posts that match it.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "excludeHashtags": {
            "title": "Hashtags to exclude",
            "type": "array",
            "description": "Leave out posts with the hashtags you list. Enter one per line, with or without #.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "excludeFromUsers": {
            "title": "Exclude posts from accounts",
            "type": "array",
            "description": "Leave out posts written by the accounts you list. Use usernames, @handles, or profile URLs, one per line.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}