{
  "openapi": "3.0.1",
  "info": {
    "title": "Twitter Advanced Search Scraper",
    "description": "Advanced Twitter/X scraper with powerful filtering capabilities. Extract detailed tweet info, user profiles, and media. Supports search by query, user, hashtags, and more.",
    "version": "1.0",
    "x-build-id": "EFPtSbZsgTre0VAkN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mikolabs~Twitter-advanced-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mikolabs-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/mikolabs~Twitter-advanced-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-mikolabs-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/mikolabs~Twitter-advanced-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-mikolabs-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",
        "properties": {
          "query": {
            "title": "Simple Search Query",
            "type": "string",
            "description": "Enter your search terms here for quick and easy Twitter searches. Supports 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.",
            "default": "mikolabs"
          },
          "queryType": {
            "title": "Query Type",
            "enum": [
              "Latest",
              "Top"
            ],
            "type": "string",
            "description": "Choose your search strategy: 'Latest' for real-time, chronological results or 'Top' for the most popular and engaging tweets.",
            "default": "Latest"
          },
          "numberOfTweets": {
            "title": "Number of Tweets",
            "minimum": 20,
            "maximum": 10000,
            "type": "integer",
            "description": "Specify how many tweets you want to collect (20-50000). Our intelligent system automatically handles multiple requests to ensure you get exactly the number you need.",
            "default": 20
          },
          "maxPages": {
            "title": "Max Pages",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of pages to scrape. Each page typically contains 20 tweets. Set higher for comprehensive data collection. Defaults to calculated value based on numberOfTweets.",
            "default": 100
          },
          "searchType": {
            "title": "Search Type",
            "enum": [
              "tweets",
              "users",
              "profile"
            ],
            "type": "string",
            "description": "Select what you want to search: 'tweets' to search for tweets/posts, 'users' to search for X/Twitter users, or 'profile' to scrape a specific user's profile and their tweets. When 'profile' is selected, provide the username in 'From Users' field or use 'query' as username.",
            "default": "tweets"
          },
          "includeUserStats": {
            "title": "Include User Stats with Posts",
            "type": "boolean",
            "description": "When searching tweets/posts, include the author's profile statistics (followers, following, tweets count) with each tweet. This requires an additional request per unique author.",
            "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": "Types of media to include",
            "items": {
              "type": "string"
            }
          },
          "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": "Language filter for tweets"
          },
          "contentEmoticons": {
            "title": "Emoticon Sentiment",
            "enum": [
              "positive",
              "negative"
            ],
            "type": "string",
            "description": "Filter by emoticon sentiment"
          },
          "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"
            }
          },
          "tweetTypesExclude": {
            "title": "Exclude Tweet Types",
            "type": "array",
            "description": "Types of tweets to exclude",
            "items": {
              "type": "string"
            }
          },
          "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"
            }
          },
          "timeSince": {
            "title": "Since Date",
            "type": "string",
            "description": "Start date (YYYY-MM-DD)"
          },
          "timeUntil": {
            "title": "Until Date",
            "type": "string",
            "description": "End date (YYYY-MM-DD)"
          },
          "timeWithinTime": {
            "title": "Within Time",
            "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": "Exact coordinates (lat,long,radius) e.g., '37.7764685,-122.4172004,10km'"
          },
          "geoPlaceId": {
            "title": "Place ID",
            "type": "string",
            "description": "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 Twitter Card (e.g., 'pscp.tv')"
          },
          "cardUrl": {
            "title": "Card URL",
            "type": "string",
            "description": "URL in 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": "Twitter Card name (e.g., 'audio', 'animated_gif', 'player', 'app', 'summary', 'summary_large_image')"
          },
          "proxyUrl": {
            "title": "Proxy URL",
            "type": "string",
            "description": "Optional proxy URL for requests. Format: http://username:password@proxy-server:port. Note: Residential proxy is configured automatically via Apify Console."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}