{
  "openapi": "3.0.1",
  "info": {
    "title": "X.com (Twitter) Thread Unroller & Scraper",
    "description": "Paste any tweet URL. Get the entire thread unrolled: root, all self-replies, and clean Markdown. Pay per thread ($5/1k base). Optional add-ons: media downloads, full quoted tweets.",
    "version": "0.0",
    "x-build-id": "VaePfUyRl87RfCGGH"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lurkapi~x-twitter-thread-unroller/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lurkapi-x-twitter-thread-unroller",
        "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/lurkapi~x-twitter-thread-unroller/runs": {
      "post": {
        "operationId": "runs-sync-lurkapi-x-twitter-thread-unroller",
        "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/lurkapi~x-twitter-thread-unroller/run-sync": {
      "post": {
        "operationId": "run-sync-lurkapi-x-twitter-thread-unroller",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "tweetUrls"
        ],
        "properties": {
          "tweetUrls": {
            "title": "🧵 Tweet URLs or IDs",
            "type": "array",
            "description": "Paste any tweet from anywhere in the thread. Accepts x.com, twitter.com, mobile.twitter.com, fxtwitter.com, vxtwitter.com URLs, share links, or bare numeric IDs. One entry per thread.",
            "items": {
              "type": "string"
            }
          },
          "downloadMedia": {
            "title": "Download media files ($)",
            "type": "boolean",
            "description": "Download every photo and video attached to any tweet in the thread into the run's key-value store. Charged once per tweet with at least one file downloaded.",
            "default": false
          },
          "includeQuotedTweets": {
            "title": "Include full quoted tweets ($)",
            "type": "boolean",
            "description": "When a tweet in the thread quote-tweets another post, embed the full quoted tweet: text, author, media, counts. Charged once per thread that has at least one quoted tweet.",
            "default": false
          },
          "outputMode": {
            "title": "Output shape",
            "enum": [
              "nested",
              "flat"
            ],
            "type": "string",
            "description": "Nested: one row per thread, all replies attached under threadTweets[]. Best for JSON export. Flat: one row per tweet, ordered root → tail, with threadRootId + threadPosition + inReplyToTweetId fields. Best for CSV / spreadsheet export.",
            "default": "flat"
          },
          "includeRootAsFirstReply": {
            "title": "Include root tweet as the first item (flat mode only)",
            "type": "boolean",
            "description": "In flat mode, emit the root tweet as the first row (position 0). Ignored in nested mode where the root is always at the top.",
            "default": true
          },
          "maxRepliesPerThread": {
            "title": "Max replies per thread",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Hard cap on self-replies collected per thread. Root tweet is always included. Default 50 covers 99% of threads.",
            "default": 50
          },
          "outputId": {
            "title": "id",
            "type": "boolean",
            "description": "Numeric tweet ID.",
            "default": true
          },
          "outputUrl": {
            "title": "url",
            "type": "boolean",
            "description": "Canonical tweet URL.",
            "default": true
          },
          "outputFullText": {
            "title": "fullText",
            "type": "boolean",
            "description": "Full tweet text (long-form notes never 280-char truncated).",
            "default": true
          },
          "outputCreatedAt": {
            "title": "createdAt",
            "type": "boolean",
            "description": "ISO-8601 creation timestamp.",
            "default": true
          },
          "outputLang": {
            "title": "lang",
            "type": "boolean",
            "description": "Source language as returned by X.",
            "default": true
          },
          "outputReplyCount": {
            "title": "replyCount",
            "type": "boolean",
            "description": "Reply count.",
            "default": true
          },
          "outputRetweetCount": {
            "title": "retweetCount",
            "type": "boolean",
            "description": "Retweet count.",
            "default": true
          },
          "outputLikeCount": {
            "title": "likeCount",
            "type": "boolean",
            "description": "Favorite / like count.",
            "default": true
          },
          "outputQuoteCount": {
            "title": "quoteCount",
            "type": "boolean",
            "description": "Quote-tweet count.",
            "default": true
          },
          "outputBookmarkCount": {
            "title": "bookmarkCount",
            "type": "boolean",
            "description": "Bookmark count.",
            "default": true
          },
          "outputViewCount": {
            "title": "viewCount",
            "type": "boolean",
            "description": "View count.",
            "default": true
          },
          "outputConversationId": {
            "title": "conversationId",
            "type": "boolean",
            "description": "Conversation root ID (equal to threadRootId when the tweet is part of a thread).",
            "default": true
          },
          "outputIsReply": {
            "title": "isReply",
            "type": "boolean",
            "description": "Boolean flag for reply tweets.",
            "default": true
          },
          "outputIsRetweet": {
            "title": "isRetweet",
            "type": "boolean",
            "description": "Boolean flag for retweets.",
            "default": true
          },
          "outputIsQuote": {
            "title": "isQuote",
            "type": "boolean",
            "description": "Boolean flag for quote tweets.",
            "default": true
          },
          "outputRetweetedTweet": {
            "title": "retweetedTweet",
            "type": "boolean",
            "description": "Nested retweeted-tweet object when the tweet is a retweet.",
            "default": true
          },
          "outputInReplyTo": {
            "title": "inReplyTo*",
            "type": "boolean",
            "description": "inReplyToTweetId + inReplyToScreenName. Present on every non-root tweet.",
            "default": true
          },
          "outputMentions": {
            "title": "mentions",
            "type": "boolean",
            "description": "@-mentions array.",
            "default": true
          },
          "outputHashtags": {
            "title": "hashtags",
            "type": "boolean",
            "description": "Hashtags array.",
            "default": true
          },
          "outputUrls": {
            "title": "urls",
            "type": "boolean",
            "description": "Expanded URLs in tweet.",
            "default": true
          },
          "outputMedia": {
            "title": "media",
            "type": "boolean",
            "description": "Media array (photos + videos with URLs). Files are downloaded into the KV store only if the Download media add-on is enabled.",
            "default": true
          },
          "outputAuthor": {
            "title": "author",
            "type": "boolean",
            "description": "Author block (id, screenName, name, profileImageUrl, verification flags, followers, bio).",
            "default": true
          },
          "outputQuotedTweet": {
            "title": "quotedTweet",
            "type": "boolean",
            "description": "Nested quoted-tweet object when present.",
            "default": true
          },
          "outputThreadMarkdown": {
            "title": "threadMarkdown",
            "type": "boolean",
            "description": "Clean Markdown export of the full thread. Populated on the root row in nested mode, on the position-0 row in flat mode.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}