# Twitter (X) Thread Scraper: Extract Complete Conversations (`fastcrawler/twitter-x-thread-scraper-extract-complete-conversations`) Actor

Extract complete X (Twitter) threads and conversations. Just input a tweet URL to scrape the main post and all connected replies. Export structured data (JSON/CSV) perfect for analytics, AI agents, and custom workflows. Run via API, schedule tasks, and integrate seamlessly.

- **URL**: https://apify.com/fastcrawler/twitter-x-thread-scraper-extract-complete-conversations.md
- **Developed by:** [fastcrawler](https://apify.com/fastcrawler) (community)
- **Categories:** Social media, Agents, MCP servers
- **Stats:** 26 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$20.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#rental-actors

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## 🧵 Twitter (X) Thread Scraper: Extract Complete Conversations

**Twitter (X) Thread Scraper** is a powerful and reliable Apify actor designed to effortlessly extract full threads and conversations from X (formerly Twitter). 

Instead of manually copying tweets or dealing with complex API rate limits, this tool automatically collects the root tweet and all connected replies, delivering clean, structured data ready for your next project.

---

### 🚀 Why use this Scraper? (Top Use Cases)
Adding context to data is crucial. This scraper is built for professionals who need complete conversational data:
- **🤖 AI Agents & LLM Training:** Extract high-quality, contextual dialogue and reasoning data to feed your custom models or AI workflows.
- **📊 Analytics & Market Research:** Analyze audience sentiment, engagement metrics, and discussions around specific topics or brands.
- **🗄️ Content Archiving & Curation:** Backup valuable multi-part tutorials, industry insights, and discussions before they get lost.

---

### ✨ Key Features
- **🎯 Full Thread Extraction:** Input a tweet URL and automatically scrape the main post plus all connected replies from the author.
- **🔄 Flexible Input Options:** Scrape a single tweet URL, a bulk list of URLs, or use targeted keyword searches.
- **📦 Rich Data Points:** Collect comprehensive metadata including tweet text, Tweet IDs, author details (handles, names), precise timestamps, media URLs (images/videos), and full engagement metrics (likes, reposts, quotes).
- **🛠 Developer-Friendly Exports:** Download your scraped datasets in structured formats like **JSON, CSV, XML, or Excel**.
- **⚡️ Scalable & Reliable:** Built with robust error handling to support large-scale scraping runs and seamlessly integrate with Apify API and webhooks.

---

### 🛠 How it Works (Input Configuration)
You can configure the scraper by providing one of the following inputs:
1. **Single Tweet URL** → Scrapes the entire thread originating from that specific tweet.
2. **List of Tweet URLs** → Processes multiple thread URLs in a single run.
3. **Keyword Search** → Finds top tweets matching your keywords and extracts their full threads.

**Example Input (JSON):**
```json
{
  "tweetId": "1966378394427470005"
}

````

***

### 💡 Seamless Integration

Once your run is complete, you can effortlessly connect the extracted data to your favorite tools, databases, or AI platforms using the Apify API, Make, or Zapier.

### 📊 Output Example

The scraper returns clean, structured data designed for easy parsing. Here is a sample output of a scraped thread showing the root tweet and its connected replies:

````json
[
  {
    "tweetId": "1966378394427470005",
    "text": "Just shipped the new Twitter (X) Thread Scraper! 🚀\n\nExtract complete conversations for your AI agents and analytics. Thread below on how to use it 👇",
    "createdAt": "2026-05-19T10:00:00.000Z",
    "author": {
      "userName": "indie_dev_daily",
      "name": "Dev Maker",
      "isVerified": true,
      "followers": 24500
    },
    "media": [],
    "metrics": {
      "likes": 856,
      "reposts": 142,
      "replies": 38,
      "quotes": 12
    },
    "isReply": false,
    "conversationId": "1966378394427470005",
    "url": "[https://x.com/indie_dev_daily/status/1966378394427470005](https://x.com/indie_dev_daily/status/1966378394427470005)"
  },
  {
    "tweetId": "1966378450123450001",
    "text": "1/ Flexible Inputs 🛠️\n\nYou can input a single tweet URL, a bulk list, or use keyword searches. The scraper will traverse the entire thread and fetch all connected replies seamlessly.",
    "createdAt": "2026-05-19T10:02:15.000Z",
    "author": {
      "userName": "indie_dev_daily",
      "name": "Dev Maker",
      "isVerified": true,
      "followers": 24500
    },
    "media": [
      {
        "type": "photo",
        "url": "[https://pbs.twimg.com/media/ExampleScraperConfig.jpg](https://pbs.twimg.com/media/ExampleScraperConfig.jpg)"
      }
    ],
    "metrics": {
      "likes": 210,
      "reposts": 25,
      "replies": 4,
      "quotes": 1
    },
    "isReply": true,
    "inReplyToTweetId": "1966378394427470005",
    "conversationId": "1966378394427470005",
    "url": "[https://x.com/indie_dev_daily/status/1966378450123450001](https://x.com/indie_dev_daily/status/1966378450123450001)"
  }
]

# Actor input Schema

## `tweetId` (type: `string`):

The id of tweet you want to get the data from.

## Actor input object example

```json
{
  "tweetId": "tweet_id"
}
````

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "tweetId": "tweet_id"
};

// Run the Actor and wait for it to finish
const run = await client.actor("fastcrawler/twitter-x-thread-scraper-extract-complete-conversations").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "tweetId": "tweet_id" }

# Run the Actor and wait for it to finish
run = client.actor("fastcrawler/twitter-x-thread-scraper-extract-complete-conversations").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "tweetId": "tweet_id"
}' |
apify call fastcrawler/twitter-x-thread-scraper-extract-complete-conversations --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=fastcrawler/twitter-x-thread-scraper-extract-complete-conversations",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Twitter (X) Thread Scraper: Extract Complete Conversations",
        "description": "Extract complete X (Twitter) threads and conversations. Just input a tweet URL to scrape the main post and all connected replies. Export structured data (JSON/CSV) perfect for analytics, AI agents, and custom workflows. Run via API, schedule tasks, and integrate seamlessly.",
        "version": "0.0",
        "x-build-id": "omU003nBWZad0CUwa"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/fastcrawler~twitter-x-thread-scraper-extract-complete-conversations/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-fastcrawler-twitter-x-thread-scraper-extract-complete-conversations",
                "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/fastcrawler~twitter-x-thread-scraper-extract-complete-conversations/runs": {
            "post": {
                "operationId": "runs-sync-fastcrawler-twitter-x-thread-scraper-extract-complete-conversations",
                "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/fastcrawler~twitter-x-thread-scraper-extract-complete-conversations/run-sync": {
            "post": {
                "operationId": "run-sync-fastcrawler-twitter-x-thread-scraper-extract-complete-conversations",
                "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": [
                    "tweetId"
                ],
                "properties": {
                    "tweetId": {
                        "title": "id of the tweet",
                        "type": "string",
                        "description": "The id of tweet you want to get the data from."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
