{
  "openapi": "3.0.1",
  "info": {
    "title": "Tweet X Scraper",
    "description": "Collect public X/Twitter tweets from usernames, from:username queries, tweet URLs, and tweet IDs. Export clean tweet text, author info, engagement metrics, media, links, and run summaries without X login.",
    "version": "0.1",
    "x-build-id": "fLCl3qSj2pqPhpq8k"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/qaseemiqbal~tweet-x-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-qaseemiqbal-tweet-x-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/qaseemiqbal~tweet-x-scraper/runs": {
      "post": {
        "operationId": "runs-sync-qaseemiqbal-tweet-x-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/qaseemiqbal~tweet-x-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-qaseemiqbal-tweet-x-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": {
          "queries": {
            "title": "from:username queries",
            "type": "array",
            "description": "Use simple from:username queries, for example from:apify. Generic keyword, hashtag, mention, cashtag, and advanced X search are currently reported as unsupported because X public search endpoints reject guest requests.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "advancedQuery": {
            "title": "Advanced raw search query",
            "type": "string",
            "description": "Currently unsupported for public guest scraping. Use fromUsers, from:username queries, tweet URLs, or tweet IDs.",
            "default": ""
          },
          "tweetIds": {
            "title": "Tweet IDs",
            "type": "array",
            "description": "Tweet/status IDs to fetch directly.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "tweetUrls": {
            "title": "Tweet URLs",
            "type": "array",
            "description": "Tweet URLs from x.com or twitter.com.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "fromUsers": {
            "title": "Tweets from users",
            "type": "array",
            "description": "Usernames or profile URLs to collect public tweets from.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "hashtags": {
            "title": "Hashtags",
            "type": "array",
            "description": "Currently unsupported for public guest scraping because X public search rejects guest requests.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "mentions": {
            "title": "Mentions",
            "type": "array",
            "description": "Currently unsupported for public guest scraping because X public search rejects guest requests.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "cashtags": {
            "title": "Cashtags",
            "type": "array",
            "description": "Currently unsupported for public guest scraping because X public search rejects guest requests.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Maximum tweets",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum tweet records to output. Error records may be added in addition when includeErrors is enabled.",
            "default": 50
          },
          "sort": {
            "title": "Sort mode",
            "enum": [
              "latest",
              "top",
              "mixed"
            ],
            "type": "string",
            "description": "Search result type to request where supported.",
            "default": "latest"
          },
          "startTime": {
            "title": "Start time",
            "type": "string",
            "description": "ISO 8601 start time, for example 2026-06-01T00:00:00Z. Converted internally to UNIX timestamp windows.",
            "default": ""
          },
          "endTime": {
            "title": "End time",
            "type": "string",
            "description": "ISO 8601 end time, for example 2026-06-15T00:00:00Z. Converted internally to UNIX timestamp windows.",
            "default": ""
          },
          "lookbackMinutes": {
            "title": "Lookback minutes",
            "minimum": 1,
            "maximum": 525600,
            "type": "integer",
            "description": "For scheduled monitoring, collect tweets from the last N minutes when explicit times are not supplied.",
            "default": 60
          },
          "timeWindowMinutes": {
            "title": "Search time window size",
            "minimum": 1,
            "maximum": 1440,
            "type": "integer",
            "description": "Reserved for search-style sources. Generic public search is currently unsupported, so this setting is usually not needed.",
            "default": 240
          },
          "adaptiveTimeWindows": {
            "title": "Adaptive time windows",
            "type": "boolean",
            "description": "Reserved for search-style sources. Disabled by default to minimize request count.",
            "default": false
          },
          "minTimeWindowMinutes": {
            "title": "Minimum adaptive window size",
            "minimum": 1,
            "maximum": 1440,
            "type": "integer",
            "description": "Reserved for search-style sources.",
            "default": 30
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Optional tweet language code such as en, es, fr, de, or ja.",
            "default": ""
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Include reply tweets.",
            "default": true
          },
          "includeRetweets": {
            "title": "Include reposts / native retweets",
            "type": "boolean",
            "description": "Include native retweets/reposts where available.",
            "default": false
          },
          "includeQuotes": {
            "title": "Include quote tweets",
            "type": "boolean",
            "description": "Include quote tweets.",
            "default": true
          },
          "includeImages": {
            "title": "Require images",
            "type": "boolean",
            "description": "Only return tweets with images where supported by the source.",
            "default": false
          },
          "includeVideos": {
            "title": "Require videos",
            "type": "boolean",
            "description": "Only return tweets with videos where supported by the source.",
            "default": false
          },
          "includeLinks": {
            "title": "Require links",
            "type": "boolean",
            "description": "Only return tweets with links where supported by the source.",
            "default": false
          },
          "includeMedia": {
            "title": "Require any media",
            "type": "boolean",
            "description": "Only return tweets with any media where supported by the source.",
            "default": false
          },
          "verifiedOnly": {
            "title": "Verified authors only",
            "type": "boolean",
            "description": "Only return tweets from verified authors when available.",
            "default": false
          },
          "blueVerifiedOnly": {
            "title": "Blue verified authors only",
            "type": "boolean",
            "description": "Only return tweets from blue verified authors when available.",
            "default": false
          },
          "safeOnly": {
            "title": "Safe content only",
            "type": "boolean",
            "description": "Apply safe-content search filter where supported.",
            "default": false
          },
          "minLikes": {
            "title": "Minimum likes",
            "minimum": 0,
            "type": "integer",
            "description": "Post-filter tweets below this like count.",
            "default": 0
          },
          "minRetweets": {
            "title": "Minimum retweets",
            "minimum": 0,
            "type": "integer",
            "description": "Post-filter tweets below this retweet/repost count.",
            "default": 0
          },
          "minReplies": {
            "title": "Minimum replies",
            "minimum": 0,
            "type": "integer",
            "description": "Post-filter tweets below this reply count.",
            "default": 0
          },
          "minViews": {
            "title": "Minimum views",
            "minimum": 0,
            "type": "integer",
            "description": "Post-filter tweets below this view count when views are available.",
            "default": 0
          },
          "outputProfile": {
            "title": "Output profile",
            "enum": [
              "minimal",
              "standard",
              "full"
            ],
            "type": "string",
            "description": "Choose how many fields to include. Minimal is the cheapest default because it reduces storage size.",
            "default": "minimal"
          },
          "includeAuthorDetails": {
            "title": "Include author details",
            "type": "boolean",
            "description": "Include detailed author profile fields in each tweet record when available.",
            "default": true
          },
          "includeRawData": {
            "title": "Include raw source data",
            "type": "boolean",
            "description": "Include raw source payload for debugging and advanced users. This can significantly increase dataset size.",
            "default": false
          },
          "includeErrors": {
            "title": "Include error records",
            "type": "boolean",
            "description": "Push structured error records for unavailable tweets, invalid inputs, or failed work items. Disabled by default to avoid extra dataset items on failed lookups.",
            "default": false
          },
          "deduplicate": {
            "title": "Deduplicate tweets",
            "type": "boolean",
            "description": "Avoid pushing duplicate tweets with the same tweet ID.",
            "default": true
          },
          "persistDedupeState": {
            "title": "Persist dedupe state",
            "type": "boolean",
            "description": "Store seen tweet IDs in the key-value store for resume-heavy runs. Disabled by default to reduce key-value store writes.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify proxy configuration. Disabled by default for the lowest possible cost; enable proxy groups when reliability matters more than cost.",
            "default": {
              "useApifyProxy": false
            }
          },
          "maxConcurrency": {
            "title": "Maximum concurrency",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum number of parallel work items.",
            "default": 5
          },
          "maxPagesPerQuery": {
            "title": "Maximum pages per query",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum result pages to request where pagination is supported. The default is 1 for lowest cost.",
            "default": 1
          },
          "maxRequestRetries": {
            "title": "Maximum request retries",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum retries per request or work item.",
            "default": 1
          },
          "requestTimeoutSecs": {
            "title": "Request timeout",
            "minimum": 10,
            "maximum": 300,
            "type": "integer",
            "description": "Timeout per request in seconds.",
            "default": 30
          },
          "sessionRotation": {
            "title": "Session rotation",
            "type": "boolean",
            "description": "Rotate sessions and proxy IPs when requests fail or blocking is detected. Disabled by default to reduce SessionPool overhead.",
            "default": false
          },
          "monitoringMode": {
            "title": "Monitoring mode",
            "type": "boolean",
            "description": "Use persisted state for scheduled recurring monitoring.",
            "default": false
          },
          "stateKey": {
            "title": "Monitoring state key",
            "type": "string",
            "description": "Key-value store key used to persist last successful monitoring timestamp.",
            "default": "default-monitor"
          },
          "enrichments": {
            "title": "Analytics enrichments",
            "type": "object",
            "description": "Optional deterministic analytics enrichments. Engagement scoring, sentiment, entities, and topics run locally in the Actor.",
            "default": {
              "engagementScore": false,
              "sentiment": false,
              "entities": false,
              "topics": false,
              "topicLabels": []
            }
          },
          "webhookPayloadMode": {
            "title": "Webhook payload mode",
            "enum": [
              "summary",
              "datasetUrl"
            ],
            "type": "string",
            "description": "Controls what summary fields are prepared for downstream webhooks.",
            "default": "summary"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}