# X Tweet Engagement Scraper - Replies, Quotes & Retweets (`khadinakbar/x-tweet-engagement-scraper`) Actor

Scrape all engagement on any X (Twitter) post — replies, quote tweets, and retweeters — with author, follower & metric fields. No cookies. MCP-ready.

- **URL**: https://apify.com/khadinakbar/x-tweet-engagement-scraper.md
- **Developed by:** [Khadin Akbar](https://apify.com/khadinakbar) (community)
- **Categories:** Social media, MCP servers, AI
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.00 / 1,000 x engagement items

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## 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

## X Tweet Engagement Scraper — Replies, Quotes & Retweets

Get **all public engagement on any X (Twitter) post in a single run**: replies, quote tweets, and retweeters — returned in one unified dataset, each row tagged with an `engagementType` field. Feed a tweet URL or numeric tweet ID, get back the full conversation and amplification around it. **No cookies, no X login, no browser.**

### What you get

One actor replaces three separate scrapers. For every tweet you supply, it collects:

- **Replies** (`engagementType: "reply"`) — the comments under the tweet, with full text, author, and engagement metrics.
- **Quote tweets** (`engagementType: "quote"`) — accounts that quoted the tweet with their own commentary, with full text and metrics.
- **Retweeters** (`engagementType: "retweet"`) — accounts that amplified the tweet. A retweet carries no text, so these rows contain author fields only (handle, name, followers, bio, verified).

### When to use it

- **Sentiment & brand monitoring** — read what people actually say back (replies + quote commentary) about a launch, ad, or statement.
- **Influencer identification** — find high-follower accounts amplifying a tweet (retweeters + quoters).
- **Virality breakdown** — quantify how a post spread: reply volume vs quote volume vs raw retweets.
- **AI agents / MCP** — single URL in, structured JSON out; ideal as a tool call.

**Not for:** keyword/hashtag search, profile timelines, or follower lists. Use the related actors below. For replies only, the dedicated [x-twitter-replies-scraper](https://apify.com/khadinakbar/x-twitter-replies-scraper) is a lighter option.

### Output

Each dataset row is a flat record. Key fields:

| Field | Description |
|---|---|
| `engagementType` | `reply`, `quote`, or `retweet` |
| `parentTweetId` / `parentTweetUrl` | The tweet you queried |
| `tweetId` / `tweetUrl` | The reply or quote tweet (null for retweets) |
| `text` | Reply or quote text (null for retweets) |
| `authorUsername` / `authorName` / `authorId` | Engaging account |
| `authorFollowers` / `authorVerified` / `authorBio` | Author profile signal |
| `likeCount` / `retweetCount` / `replyCount` / `quoteCount` / `viewCount` | Metrics (reply/quote only) |
| `createdAt` | ISO 8601 timestamp (reply/quote) |
| `quotedTweetId` | For quotes, the quoted source tweet |
| `hashtags` / `mentions` / `urls` / `mediaUrls` | Parsed entities |
| `provider` / `providerPage` / `scrapedAt` | Provenance |

Null/empty fields are omitted from each record rather than emitted as `null`.

### Pricing — Pay Per Event

| Event | Price |
|---|---|
| Actor start | $0.00005 |
| Engagement item (reply, quote, or retweet) | **$0.006** |

You set `maxItems` (default 100) as a hard cap — the actor never charges beyond it, and prints the maximum possible cost at the start of every run. A typical 100-item run costs about **$0.60**. Pay-Per-Usage (compute + proxy) billing is also available; pick whichever model you prefer at run time.

### Input

```json
{
  "tweetUrls": ["https://x.com/OpenAI/status/2065225362544726371"],
  "engagementTypes": ["reply", "quote", "retweet"],
  "rankingMode": "Relevance",
  "maxItems": 100,
  "maxPagesPerType": 3
}
````

- **tweetUrls** (required) — tweet URLs or numeric IDs, up to 50.
- **engagementTypes** — any of `reply`, `quote`, `retweet`. Default: all three.
- **rankingMode** — `Relevance`, `Recency`, or `Likes` (applies to replies and quotes).
- **maxItems** — total billing/dataset cap (1–5000, default 100).
- **maxPagesPerType** — pagination depth per type per tweet (1–50, default 3).
- **includeRaw** — attach the raw provider object to each row (debugging).
- **dedupeItems** — drop duplicates across pages (default true).

### How it works

The actor calls a public-data provider API (SociaVault) server-side, so it needs **no X login and no cookies from you**. It paginates each engagement type with the provider's cursor up to `maxPagesPerType`, normalizes the raw X/Twitter timeline objects into the flat schema above, dedupes, and pushes rows to the dataset. Replies and quotes resolve to tweet objects (with text + metrics); retweets resolve to user objects (author only). A machine-readable run summary is written to the `OUTPUT` and `RUN_SUMMARY` keys in the key-value store.

### MCP / AI agents

This actor is MCP-ready. Exposed as `apify--x-tweet-engagement-scraper`, it takes a narrow input (a tweet URL) and returns compact structured JSON, making it a clean tool call for Claude, ChatGPT, or any MCP client. Errors and empty results return clear status messages rather than crashing.

### FAQ

**Why do retweet rows have no text?** A retweet is a pure amplification on X — there is no comment attached. To capture commentary, use the `quote` type. Retweet rows still give you the amplifier's handle, name, and follower count.

**How deep does it go?** Depth is bounded by `maxItems`, `maxPagesPerType`, and what X exposes publicly. X does not expose the complete retweeter or reply list for high-volume tweets to anyone; you get the publicly visible window.

**Do I need a SociaVault account?** No. The provider key is managed by the actor owner. You only pay the per-event price above.

**Can I scrape multiple tweets at once?** Yes — pass up to 50 tweet URLs/IDs. `maxItems` caps the combined total.

### Related actors

- [x-twitter-replies-scraper](https://apify.com/khadinakbar/x-twitter-replies-scraper) — replies only, lighter.
- [x-tweet-scraper](https://apify.com/khadinakbar/x-tweet-scraper) — tweet content by URL/ID.
- [twitter-profile-followers-scraper](https://apify.com/khadinakbar/twitter-profile-followers-scraper) — profiles + followers.

### Legal & compliance

This actor collects only **publicly available** data from X/Twitter via a third-party public-data API. It does not log in, bypass authentication, or access private or protected content. You are responsible for using the output in compliance with X's Terms of Service, applicable data-protection laws (including GDPR/CCPA where relevant), and any restrictions on personal data. Do not use scraped personal data for unlawful profiling, harassment, or spam.

# Actor input Schema

## `tweetUrls` (type: `array`):

Use this when you need all public engagement on specific X/Twitter posts. Enter full URLs like https://x.com/OpenAI/status/2065225362544726371 or numeric tweet IDs. Defaults to one working public tweet example. This is not for keyword search, profile timelines, or follower lists.

## `engagementTypes` (type: `array`):

Use this to choose which engagement to collect per tweet. reply = replies/comments, quote = quote tweets with commentary, retweet = users who retweeted (no text). Defaults to all three. Retweet rows contain author fields only because a retweet carries no text.

## `rankingMode` (type: `string`):

Use this when choosing how X orders replies and quote tweets. Relevance returns the default ranking, Recency returns newer first, Likes prioritizes liked items. Defaults to Relevance. This has no effect on the retweeter list.

## `maxItems` (type: `integer`):

Use this to cap total engagement rows saved across all tweets and types. The actor stops before charging beyond this limit. Defaults to 100 and supports up to 5000. This is a hard billing and dataset cap, not a per-tweet or per-type target.

## `maxPagesPerType` (type: `integer`):

Use this as a pagination safety valve for each engagement type on each tweet. Higher values collect deeper pages when the provider returns a next cursor. Defaults to 3 and supports up to 50. This does not override maxItems.

## `includeRaw` (type: `boolean`):

Use this for debugging provider field drift or building custom parsers. When enabled, each dataset row includes the raw provider object. Defaults to false for smaller datasets. This is not needed for normal analytics exports.

## `dedupeItems` (type: `boolean`):

Use this to skip duplicate engagement across pages and tweets. The actor dedupes replies and quotes by tweet ID and retweeters by user ID. Defaults to true. Disable only to inspect provider pagination overlap.

## Actor input object example

```json
{
  "tweetUrls": [
    "https://x.com/OpenAI/status/2065225362544726371"
  ],
  "engagementTypes": [
    "reply",
    "quote",
    "retweet"
  ],
  "rankingMode": "Relevance",
  "maxItems": 100,
  "maxPagesPerType": 3,
  "includeRaw": false,
  "dedupeItems": true
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `summary` (type: `string`):

No description

## `runSummary` (type: `string`):

No description

# 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 = {
    "tweetUrls": [
        "https://x.com/OpenAI/status/2065225362544726371"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("khadinakbar/x-tweet-engagement-scraper").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 = { "tweetUrls": ["https://x.com/OpenAI/status/2065225362544726371"] }

# Run the Actor and wait for it to finish
run = client.actor("khadinakbar/x-tweet-engagement-scraper").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 '{
  "tweetUrls": [
    "https://x.com/OpenAI/status/2065225362544726371"
  ]
}' |
apify call khadinakbar/x-tweet-engagement-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=khadinakbar/x-tweet-engagement-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "X Tweet Engagement Scraper - Replies, Quotes & Retweets",
        "description": "Scrape all engagement on any X (Twitter) post — replies, quote tweets, and retweeters — with author, follower & metric fields. No cookies. MCP-ready.",
        "version": "1.0",
        "x-build-id": "b0P29FpjHUMZKojYf"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/khadinakbar~x-tweet-engagement-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-khadinakbar-x-tweet-engagement-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/khadinakbar~x-tweet-engagement-scraper/runs": {
            "post": {
                "operationId": "runs-sync-khadinakbar-x-tweet-engagement-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/khadinakbar~x-tweet-engagement-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-khadinakbar-x-tweet-engagement-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",
                "required": [
                    "tweetUrls"
                ],
                "properties": {
                    "tweetUrls": {
                        "title": "Tweet URLs or IDs",
                        "minItems": 1,
                        "maxItems": 50,
                        "type": "array",
                        "description": "Use this when you need all public engagement on specific X/Twitter posts. Enter full URLs like https://x.com/OpenAI/status/2065225362544726371 or numeric tweet IDs. Defaults to one working public tweet example. This is not for keyword search, profile timelines, or follower lists.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "engagementTypes": {
                        "title": "Engagement types",
                        "type": "array",
                        "description": "Use this to choose which engagement to collect per tweet. reply = replies/comments, quote = quote tweets with commentary, retweet = users who retweeted (no text). Defaults to all three. Retweet rows contain author fields only because a retweet carries no text.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "reply",
                                "quote",
                                "retweet"
                            ],
                            "enumTitles": [
                                "Replies (comments)",
                                "Quote tweets",
                                "Retweeters"
                            ]
                        },
                        "default": [
                            "reply",
                            "quote",
                            "retweet"
                        ]
                    },
                    "rankingMode": {
                        "title": "Reply and quote ranking",
                        "enum": [
                            "Relevance",
                            "Recency",
                            "Likes"
                        ],
                        "type": "string",
                        "description": "Use this when choosing how X orders replies and quote tweets. Relevance returns the default ranking, Recency returns newer first, Likes prioritizes liked items. Defaults to Relevance. This has no effect on the retweeter list.",
                        "default": "Relevance"
                    },
                    "maxItems": {
                        "title": "Maximum items",
                        "minimum": 1,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Use this to cap total engagement rows saved across all tweets and types. The actor stops before charging beyond this limit. Defaults to 100 and supports up to 5000. This is a hard billing and dataset cap, not a per-tweet or per-type target.",
                        "default": 100
                    },
                    "maxPagesPerType": {
                        "title": "Maximum pages per type",
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer",
                        "description": "Use this as a pagination safety valve for each engagement type on each tweet. Higher values collect deeper pages when the provider returns a next cursor. Defaults to 3 and supports up to 50. This does not override maxItems.",
                        "default": 3
                    },
                    "includeRaw": {
                        "title": "Include raw provider payload",
                        "type": "boolean",
                        "description": "Use this for debugging provider field drift or building custom parsers. When enabled, each dataset row includes the raw provider object. Defaults to false for smaller datasets. This is not needed for normal analytics exports.",
                        "default": false
                    },
                    "dedupeItems": {
                        "title": "Dedupe items",
                        "type": "boolean",
                        "description": "Use this to skip duplicate engagement across pages and tweets. The actor dedupes replies and quotes by tweet ID and retweeters by user ID. Defaults to true. Disable only to inspect provider pagination overlap.",
                        "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
