{
  "openapi": "3.0.1",
  "info": {
    "title": "X (Twitter) Advanced Search Scraper 𝕏",
    "description": "Advanced X (Twitter) post search with 50+ filters: content, users, geo, time, engagement, media. Dual modes: simple queries or structured filters. Enterprise-grade reliability for precise data extraction",
    "version": "0.0",
    "x-build-id": "Zlykvsd59LY5rq9ot"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/api-ninja~x-twitter-advanced-search/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-api-ninja-x-twitter-advanced-search",
        "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/api-ninja~x-twitter-advanced-search/runs": {
      "post": {
        "operationId": "runs-sync-api-ninja-x-twitter-advanced-search",
        "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/api-ninja~x-twitter-advanced-search/run-sync": {
      "post": {
        "operationId": "run-sync-api-ninja-x-twitter-advanced-search",
        "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": {
          "query": {
            "title": "🔍 Search Query",
            "type": "string",
            "description": "Enter your search terms here for quick and easy X (Twitter) searches. Supports X (Twitter)'s powerful search operators for precise results. You can use this simple search OR configure advanced filters below - at least one must be provided."
          },
          "search_type": {
            "title": "⚙️ Search Type",
            "enum": [
              "Latest",
              "Top",
              "Media",
              "People",
              "Lists"
            ],
            "type": "string",
            "description": "Choose your search strategy: 'Latest' for real-time results, 'Top' for popular tweets, 'Media' for tweets with images/videos, or 'People' for user accounts.",
            "default": "Latest"
          },
          "numberOfTweets": {
            "title": "Number of Tweets",
            "minimum": 20,
            "type": "integer",
            "description": "Specify how many tweets you want to collect (minimum 20, no maximum limit). Our intelligent system automatically handles multiple requests to ensure you get exactly the number you need.",
            "default": 100
          },
          "scrapeAll": {
            "title": "Scrape All Tweets",
            "type": "boolean",
            "description": "When enabled, scrapes all available tweets from your input query, ignoring the 'Number of Tweets' limit. This may significantly increase scraping time and resource usage.",
            "default": false
          },
          "engagementLevel": {
            "title": "Engagement Level Preset",
            "enum": [
              "none",
              "low",
              "medium",
              "high",
              "viral"
            ],
            "type": "string",
            "description": "Smart presets for common engagement scenarios. Choose a preset for instant setup or customize with specific values below for precise control.",
            "default": "none"
          },
          "engagementMinRetweets": {
            "title": "Minimum Retweets",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum number of retweets (shares). Leave empty for no minimum."
          },
          "engagementMaxRetweets": {
            "title": "Maximum Retweets",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of retweets (shares). Leave empty for no maximum."
          },
          "engagementMinLikes": {
            "title": "Minimum Likes",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum number of likes (hearts). Leave empty for no minimum."
          },
          "engagementMaxLikes": {
            "title": "Maximum Likes",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of likes (hearts). Leave empty for no maximum."
          },
          "engagementMinReplies": {
            "title": "Minimum Replies",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum number of replies (comments). Leave empty for no minimum."
          },
          "engagementMaxReplies": {
            "title": "Maximum Replies",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of replies (comments). Leave empty for no maximum."
          },
          "engagementHasEngagement": {
            "title": "Must Have Any Engagement",
            "type": "boolean",
            "description": "Only include tweets that have at least some engagement (likes, retweets, or replies)"
          },
          "mediaTypes": {
            "title": "Media Types",
            "type": "array",
            "description": "Filter tweets by content type. Choose from images, videos, or any media attachments.",
            "items": {
              "type": "string",
              "enum": [
                "media",
                "images",
                "videos",
                "twimg",
                "native_video",
                "consumer_video",
                "pro_video",
                "vine",
                "periscope",
                "spaces"
              ],
              "enumTitles": [
                "Any Media",
                "Images",
                "Videos",
                "Twitter Images",
                "Native Video",
                "Consumer Video",
                "Pro Video",
                "Vine",
                "Periscope",
                "Spaces"
              ]
            }
          },
          "mediaHasLinks": {
            "title": "Has Links",
            "type": "boolean",
            "description": "Must contain links"
          },
          "mediaHasMentions": {
            "title": "Has Mentions",
            "type": "boolean",
            "description": "Must contain mentions"
          },
          "mediaHasHashtags": {
            "title": "Has Hashtags",
            "type": "boolean",
            "description": "Must contain hashtags"
          },
          "mediaNewsOnly": {
            "title": "News Only",
            "type": "boolean",
            "description": "Only tweets with news links"
          },
          "mediaSafeContentOnly": {
            "title": "Safe Content Only",
            "type": "boolean",
            "description": "Exclude potentially sensitive content"
          },
          "usersBlueVerifiedOnly": {
            "title": "Blue Verified Users Only",
            "type": "boolean",
            "description": "Only tweets from blue verified users"
          },
          "usersVerifiedOnly": {
            "title": "Verified Users Only",
            "type": "boolean",
            "description": "Only tweets from verified users"
          },
          "usersFromUsers": {
            "title": "From Users",
            "type": "array",
            "description": "Tweets from specific users (without @)",
            "items": {
              "type": "string"
            }
          },
          "usersToUsers": {
            "title": "To Users",
            "type": "array",
            "description": "Replies to specific users (without @)",
            "items": {
              "type": "string"
            }
          },
          "usersMentionUsers": {
            "title": "Mention Users",
            "type": "array",
            "description": "Tweets mentioning specific users (without @)",
            "items": {
              "type": "string"
            }
          },
          "usersExcludeFromUsers": {
            "title": "Exclude From Users",
            "type": "array",
            "description": "Exclude tweets from specific users (without @)",
            "items": {
              "type": "string"
            }
          },
          "usersListMembers": {
            "title": "From List Members",
            "type": "array",
            "description": "Tweets from members of specific lists (list ID or username/listname)",
            "items": {
              "type": "string"
            }
          },
          "contentLanguage": {
            "title": "Language",
            "enum": [
              "en",
              "es",
              "fr",
              "de",
              "it",
              "pt",
              "ru",
              "ja",
              "ko",
              "zh",
              "ar",
              "hi",
              "nl",
              "sv",
              "no",
              "da",
              "fi",
              "pl",
              "tr",
              "el",
              "iw",
              "th",
              "vi",
              "in",
              "ms",
              "tl"
            ],
            "type": "string",
            "description": "Filter tweets by language. Uses automatic language detection for accurate results."
          },
          "contentEmoticons": {
            "title": "Emoticon Sentiment",
            "enum": [
              "positive",
              "negative"
            ],
            "type": "string",
            "description": "Filter tweets based on emotional tone detected from emojis and emoticons.t"
          },
          "contentKeywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Keywords to search for in tweet content",
            "items": {
              "type": "string"
            }
          },
          "contentExactPhrases": {
            "title": "Exact Phrases",
            "type": "array",
            "description": "Exact phrases to search for (use quotes)",
            "items": {
              "type": "string"
            }
          },
          "contentExcludeKeywords": {
            "title": "Exclude Keywords",
            "type": "array",
            "description": "Keywords to exclude from results",
            "items": {
              "type": "string"
            }
          },
          "contentHashtags": {
            "title": "Hashtags",
            "type": "array",
            "description": "Hashtags to include (without #)",
            "items": {
              "type": "string"
            }
          },
          "contentExcludeHashtags": {
            "title": "Exclude Hashtags",
            "type": "array",
            "description": "Hashtags to exclude (without #)",
            "items": {
              "type": "string"
            }
          },
          "contentCashtags": {
            "title": "Cashtags",
            "type": "array",
            "description": "Stock symbols to include (without $)",
            "items": {
              "type": "string"
            }
          },
          "contentQuestionMarks": {
            "title": "Include Question Marks",
            "type": "boolean",
            "description": "Include tweets with question marks"
          },
          "tweetTypes": {
            "title": "Include Tweet Types",
            "type": "array",
            "description": "Types of tweets to include",
            "items": {
              "type": "string",
              "enum": [
                "original",
                "retweets",
                "quotes",
                "replies",
                "self_threads"
              ],
              "enumTitles": [
                "Original Tweets",
                "Retweets",
                "Quote Tweets",
                "Replies",
                "Self Threads"
              ]
            }
          },
          "tweetTypesExclude": {
            "title": "Exclude Tweet Types",
            "type": "array",
            "description": "Types of tweets to exclude",
            "items": {
              "type": "string",
              "enum": [
                "original",
                "retweets",
                "quotes",
                "replies",
                "self_threads"
              ],
              "enumTitles": [
                "Original Tweets",
                "Retweets",
                "Quote Tweets",
                "Replies",
                "Self Threads"
              ]
            }
          },
          "tweetConversationId": {
            "title": "Conversation ID",
            "type": "string",
            "description": "Tweets that are part of a specific conversation/thread"
          },
          "tweetQuotedTweetId": {
            "title": "Quoted Tweet ID",
            "type": "string",
            "description": "Tweets that quote a specific tweet"
          },
          "tweetQuotedUserId": {
            "title": "Quoted User ID",
            "type": "string",
            "description": "Tweets that quote a specific user (numeric user ID)"
          },
          "tweetPollTypes": {
            "title": "Poll Types",
            "type": "array",
            "description": "Tweets containing polls",
            "items": {
              "type": "string",
              "enum": [
                "poll2choice_text_only",
                "poll3choice_text_only",
                "poll4choice_text_only",
                "poll2choice_image",
                "poll3choice_image",
                "poll4choice_image"
              ],
              "enumTitles": [
                "2 Choice Text Poll",
                "3 Choice Text Poll",
                "4 Choice Text Poll",
                "2 Choice Image Poll",
                "3 Choice Image Poll",
                "4 Choice Image Poll"
              ]
            }
          },
          "timeSince": {
            "title": "Since Date",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$",
            "type": "string",
            "description": "Start date (YYYY-MM-DD)"
          },
          "timeUntil": {
            "title": "Until Date",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$",
            "type": "string",
            "description": "End date (YYYY-MM-DD)"
          },
          "timeWithinTime": {
            "title": "Within Time",
            "pattern": "^(\\d+)\\s*(d|h|m|s)$",
            "type": "string",
            "description": "Search within last X time (e.g., '2d', '3h', '5m', '30s')"
          },
          "timeSinceUnix": {
            "title": "Since Unix Timestamp",
            "minimum": 0,
            "type": "integer",
            "description": "Start time as Unix timestamp in seconds"
          },
          "timeUntilUnix": {
            "title": "Until Unix Timestamp",
            "minimum": 0,
            "type": "integer",
            "description": "End time as Unix timestamp in seconds"
          },
          "timeSinceId": {
            "title": "Since Tweet ID",
            "type": "string",
            "description": "Start after this Snowflake tweet ID"
          },
          "timeMaxId": {
            "title": "Max Tweet ID",
            "type": "string",
            "description": "End at or before this Snowflake tweet ID"
          },
          "geoNear": {
            "title": "Near Location",
            "type": "string",
            "description": "Location to search near"
          },
          "geoWithinRadius": {
            "title": "Within Radius",
            "type": "string",
            "description": "Radius for location search (e.g., '10km', '5mi')"
          },
          "geoGeocode": {
            "title": "Geocode",
            "type": "string",
            "description": "Search using exact coordinates and radius. Format: latitude,longitude,radius (e.g., '37.7764685,-122.4172004,10km')"
          },
          "geoPlaceId": {
            "title": "Place ID",
            "type": "string",
            "description": "X (Twitter) Place Object ID (e.g., '96683cc9126741d1' for USA)"
          },
          "appsSources": {
            "title": "Sources",
            "type": "array",
            "description": "Tweets from specific apps/sources",
            "items": {
              "type": "string"
            }
          },
          "appsExcludeSources": {
            "title": "Exclude Sources",
            "type": "array",
            "description": "Exclude tweets from specific apps/sources",
            "items": {
              "type": "string"
            }
          },
          "cardDomain": {
            "title": "Card Domain",
            "type": "string",
            "description": "Domain name in X (Twitter) Card (e.g., 'pscp.tv')"
          },
          "cardUrl": {
            "title": "Card URL",
            "type": "string",
            "description": "URL in X (Twitter) Card"
          },
          "cardName": {
            "title": "Card Name",
            "enum": [
              "audio",
              "animated_gif",
              "player",
              "app",
              "promo_image_app",
              "summary",
              "summary_large_image",
              "promo_website",
              "promo_image_convo",
              "promo_video_convo",
              "moment"
            ],
            "type": "string",
            "description": "X (Twitter) Card name (e.g., 'audio', 'animated_gif', 'player', 'app', 'summary', 'summary_large_image')"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}