{
  "openapi": "3.0.1",
  "info": {
    "title": "Complete X (Twitter) Scraper 🐦",
    "description": "A powerful, production-ready scraper to extract tweets, users, profiles, lists, and media from X (Twitter) with smart auto-detection, advanced filtering, and structured outputs.",
    "version": "0.0",
    "x-build-id": "BHwGKf2oo9PrlJnbK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/api402~complete-x-twitter-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-api402-complete-x-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/api402~complete-x-twitter-scraper/runs": {
      "post": {
        "operationId": "runs-sync-api402-complete-x-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/api402~complete-x-twitter-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-api402-complete-x-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",
        "properties": {
          "twitterHandles": {
            "title": "👥 Twitter Usernames",
            "type": "array",
            "description": "Enter Twitter usernames to scrape (with or without @). Example: elonmusk, apify",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "listUrls": {
            "title": "📋 Twitter List URLs",
            "type": "array",
            "description": "Enter Twitter/X list URLs to scrape. Format: https://x.com/i/lists/123456 or https://twitter.com/i/lists/123456",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchTerms": {
            "title": "🔍 Search Terms",
            "type": "array",
            "description": "Search queries to find tweets or users. For profile search, provide both username and search term. Examples: 'web scraping', 'AI', '#python'",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchType": {
            "title": "🎯 Search Type",
            "enum": [
              "tweets",
              "users",
              "profile_tweets"
            ],
            "type": "string",
            "description": "When using Search Terms, what to search for",
            "default": "users"
          },
          "includeReplies": {
            "title": "💬 Include Replies",
            "type": "boolean",
            "description": "Include reply tweets from profiles (automatically switches to 'with replies' mode)",
            "default": false
          },
          "includeRetweets": {
            "title": "🔁 Include Retweets",
            "type": "boolean",
            "description": "Include retweets in returned tweet results when available",
            "default": true
          },
          "mediaOnly": {
            "title": "🖼️ Media Only",
            "type": "boolean",
            "description": "Only scrape tweets that contain images or videos",
            "default": false
          },
          "maxItems": {
            "title": "🔢 Max Items to Scrape",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of items (tweets/users) to scrape. 0 = unlimited",
            "default": 100
          },
          "maxPages": {
            "title": "📄 Max Pages",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum number of pages to scrape per handle/query",
            "default": 100
          },
          "startDate": {
            "title": "📅 Start Date (From)",
            "type": "string",
            "description": "Filter tweets from this date onwards (YYYY-MM-DD format)",
            "default": ""
          },
          "endDate": {
            "title": "📅 End Date (Until)",
            "type": "string",
            "description": "Filter tweets up to this date (YYYY-MM-DD format)",
            "default": ""
          },
          "location": {
            "title": "📍 Location Filter",
            "type": "string",
            "description": "Filter tweets by location (e.g., 'Los Angeles', 'New York', 'London')",
            "default": ""
          },
          "onlyImages": {
            "title": "🖼️ Only Images",
            "type": "boolean",
            "description": "Filter tweets that contain images",
            "default": false
          },
          "onlyVideos": {
            "title": "🎥 Only Videos",
            "type": "boolean",
            "description": "Filter tweets that contain videos",
            "default": false
          },
          "onlyVerified": {
            "title": "✅ Only Verified Users",
            "type": "boolean",
            "description": "Only include tweets from verified accounts",
            "default": false
          },
          "onlyQuotes": {
            "title": "🗯️ Only Quote Tweets",
            "type": "boolean",
            "description": "Only include quote tweets",
            "default": false
          },
          "includeNativeRetweets": {
            "title": "🔁 Include Native Retweets",
            "type": "boolean",
            "description": "Include native retweets in search-based tweet results",
            "default": true
          },
          "includeLinks": {
            "title": "🔗 Only Tweets with Links",
            "type": "boolean",
            "description": "Filter tweets that contain external links",
            "default": false
          },
          "latestTweets": {
            "title": "🕒 Latest Tweets Only (Last 7 Days)",
            "type": "boolean",
            "description": "Only scrape tweets from the last 7 days",
            "default": false
          },
          "safeSearch": {
            "title": "🛡️ Safe Search",
            "type": "boolean",
            "description": "Enable safe search to filter sensitive content",
            "default": false
          },
          "minLikes": {
            "title": "❤️ Minimum Likes",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum number of likes a tweet must have",
            "default": 0
          },
          "minReplies": {
            "title": "💬 Minimum Replies",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum number of replies a tweet must have",
            "default": 0
          },
          "minRetweets": {
            "title": "🔁 Minimum Retweets",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum number of retweets a tweet must have",
            "default": 0
          },
          "tweetLanguage": {
            "title": "🌐 Tweet Language",
            "type": "string",
            "description": "Best-effort filter by language code when tweet language is present in the source HTML (e.g., 'en', 'es', 'fr')",
            "default": ""
          },
          "scrapeProfileInfo": {
            "title": "👤 Scrape Profile Info",
            "type": "boolean",
            "description": "Extract detailed profile information (bio, stats, avatar, etc.)",
            "default": true
          },
          "nitterInstance": {
            "title": "⚙️ Nitter Instance",
            "type": "string",
            "description": "Nitter base URL to use for scraping",
            "default": "https://nitter.net"
          },
          "useResidentialProxy": {
            "title": "🏠 Use Residential Proxy",
            "type": "boolean",
            "description": "Enable Apify residential proxy for better reliability (requires Apify paid plan)",
            "default": true
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy Configuration",
            "type": "object",
            "description": "Apify proxy configuration (requires paid plan)",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "proxyCountryCode": {
            "title": "🏳️ Proxy Country Code",
            "type": "string",
            "description": "Optional 2-letter country code for the residential proxy",
            "default": ""
          },
          "maxRetries": {
            "title": "🔄 Max Retries per Request",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Number of retry attempts for failed requests",
            "default": 5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}