# X (Twitter) Post Detail Scraper (`xtracto/x-post-detail-scraper`) Actor

Get full detail for any public X (Twitter) tweet by ID or URL. Returns text, media (photos/videos), engagement counts (likes/retweets/replies/views), entities (hashtags/URLs/mentions), and author info. HTTP-only, no login.

- **URL**: https://apify.com/xtracto/x-post-detail-scraper.md
- **Developed by:** [Farhan Febrian Nauval](https://apify.com/xtracto) (community)
- **Categories:** Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.15 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 (Twitter) Post Detail Scraper

Fetch the full detail of any public X (Twitter) tweet by URL or status ID — text, media, engagement counters, author, timestamp, mentions, and hashtags — in clean structured JSON.

### Why use this actor

- **No account / no login required** — paste a tweet URL or status ID and get the data back.
- **No API key needed** — X's official API is paid and rate-limited; this actor returns the same data the public web app shows.
- **Full tweet text** — including long-form (premium) tweets over 280 characters, returned in `full_text`.
- **Media URLs** — every photo size and video bitrate variant is included in `extended_entities.media`.
- **Engagement counters** — like, retweet, reply, quote, bookmark, and view counts in one shot.
- **Author snapshot** — handle, display name, followers, profile image, verified status captured at scrape time.
- **Bulk input** — pass a mix of URLs and status IDs in one run; one clean dataset row per tweet.
- **Stable JSON output** suitable for pipelines, spreadsheets, and databases — every row carries `_input`, `_source`, `_scrapedAt` envelope fields so you can join results back to your input list.

### How it works

1. You provide a list of tweet URLs (`https://twitter.com/jack/status/20`, `https://x.com/jack/status/20`) or bare status IDs (`20`).
2. The actor fetches each tweet the same way X's web app does, then assembles a flat JSON record with full text, media, counters, and author.
3. Results stream into your dataset, ready to download as JSON, CSV, or Excel.

You do not need to manage scrapers, browsers, or rotating IPs — all handled internally. If the primary path is unavailable for an older tweet, the actor automatically falls back to a secondary source so you still get a result.

### Input

```json
{
  "tweets": [
    "https://twitter.com/jack/status/20",
    "1445078208190291973"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["DATACENTER"]
  }
}
````

| Field | Type | Description |
|---|---|---|
| `tweets` | array | List of tweet URLs or status IDs. Accepts `twitter.com/<user>/status/<id>`, `x.com/<user>/status/<id>`, mobile URLs, and bare numeric IDs. Mix freely. |
| `proxyConfiguration` | object | Apify Proxy settings. Datacenter proxy works for most cases; switch to residential for very large jobs. |

### Output

Input: `https://twitter.com/jack/status/20`

```json
{
  "_input": "https://twitter.com/jack/status/20",
  "_source": "S1-primary",
  "_scrapedAt": "2026-05-18T11:04:30.976327+00:00",
  "rest_id": "20",
  "id_str": "20",
  "conversation_id_str": "20",
  "user_id_str": "12",
  "created_at": "Tue Mar 21 20:50:14 +0000 2006",
  "lang": "en",
  "full_text": "just setting up my twttr",
  "display_text_range": [0, 24],
  "favorite_count": 311853,
  "retweet_count": 126211,
  "reply_count": 17883,
  "quote_count": 6481,
  "bookmark_count": 21449,
  "views": { "state": "Enabled" },
  "is_quote_status": false,
  "source": "<a href=\"http://twitter.com\" rel=\"nofollow\">Twitter Web Client</a>",
  "entities": {
    "hashtags": [],
    "symbols": [],
    "urls": [],
    "user_mentions": []
  },
  "author": {
    "rest_id": "12",
    "screen_name": "jack",
    "name": "jack",
    "description": "no state is the best state",
    "created_at": "Tue Mar 21 20:50:14 +0000 2006",
    "followers_count": 7537422,
    "friends_count": 3,
    "statuses_count": 30509,
    "media_count": 2963,
    "listed_count": 33146,
    "favourites_count": 38827,
    "is_blue_verified": true,
    "profile_banner_url": "https://pbs.twimg.com/profile_banners/12/1742427520",
    "url": "https://t.co/ZEpOg6rn5L"
  }
}
```

| Field | Type | Description |
|---|---|---|
| `_input` | string | The URL or ID exactly as you supplied it. Use this to join results back to your input list. |
| `_source` | string | Internal tag for the path used to fetch the record. `S1-primary` is the fastest, richest path; `S2-fallback` is a simpler shape used when the primary path is unavailable. |
| `_scrapedAt` | string | ISO-8601 UTC timestamp when the record was scraped. |
| `rest_id` | string | Numeric tweet ID as a string. Stable identifier. |
| `id_str` | string | Same as `rest_id`; kept for compatibility with older tooling. |
| `conversation_id_str` | string | ID of the root tweet in the conversation thread. Equals `rest_id` for top-level tweets. |
| `user_id_str` | string | Numeric ID of the author. |
| `created_at` | string | Tweet publication time in X's native format. |
| `lang` | string | Auto-detected language code (e.g. `en`, `id`, `ja`). |
| `full_text` | string | Complete tweet text, including long-form content beyond 280 characters. |
| `display_text_range` | array | `[start, end]` character offsets of the visible portion (excludes trailing media URLs). |
| `favorite_count` | integer | Like count at scrape time. |
| `retweet_count` | integer | Retweet count. |
| `reply_count` | integer | Reply count. |
| `quote_count` | integer | Quote tweet count. |
| `bookmark_count` | integer | Bookmark count. |
| `views` | object | View counter. `count` (string) is present when public; `state` indicates whether counts are exposed. |
| `is_quote_status` | boolean | `true` if this tweet quotes another tweet. |
| `source` | string | Client used to post the tweet (HTML snippet — typically "Twitter for iPhone", "Twitter Web Client", etc.). |
| `entities` | object | Parsed entities: `hashtags`, `user_mentions`, `urls`, `symbols`. |
| `extended_entities.media` | array | Photo, video, and animated-GIF attachments with every size/bitrate variant. Present only when the tweet has media. |
| `author` | object | Snapshot of the tweet's author (handle, display name, followers, profile image, verified status, etc.). |

#### Error envelope

Tweets that are deleted, protected, or otherwise unreachable return a structured error instead of crashing the run:

```json
{
  "_input": "https://twitter.com/jack/status/999999999999999999",
  "_error": "not_found",
  "_errorDetail": "S1: TweetUnavailable: NotFound; S2: 404",
  "_source": "S2-fallback",
  "_scrapedAt": "2026-05-18T11:05:14.012345+00:00"
}
```

`_error` values:

| Value | Meaning |
|---|---|
| `not_found` | Tweet was deleted, never existed, or the ID is invalid. |
| `private` | Author's account is protected — only their approved followers can see this tweet. |
| `blocked` | Tweet exists but X declined to serve it (age-restricted, region-blocked, or temporarily unavailable). |
| `invalid_request` | Input could not be parsed as a tweet URL or numeric ID. |

Filter on `_error` to triage failed rows.

### Pricing

This actor is billed per result: **$8.00 per 1,000 tweets** (Tier 6). Each successful tweet = 1 result. Errors (`not_found`, `private`, `blocked`, `invalid_request`) are not billed.

### Other Sosmed Actors

| Platform | Actor | Best for |
|---|---|---|
| Twitter / X | [X Account Scraper](https://apify.com/xtracto/x-account-scraper) | Profile + follower counts for any handle |
| Twitter / X | [X Account Tweets Scraper](https://apify.com/xtracto/x-account-tweets-scraper) | All tweets from a user's timeline |
| Twitter / X | [X Search Scraper](https://apify.com/xtracto/x-search-scraper) | Keyword and hashtag search across tweets |
| Bluesky | [Bluesky Post Detail Scraper](https://apify.com/xtracto/bluesky-post-detail-scraper) | Single post detail on Bluesky |
| Threads | [Threads Post Detail Scraper](https://apify.com/xtracto/threads-post-detail-scraper) | Single post detail on Threads |
| Instagram | [Instagram Post Detail Scraper](https://apify.com/xtracto/instagram-post-detail-scraper) | Single post detail on Instagram |
| Reddit | [Reddit Post Detail Scraper](https://apify.com/xtracto/reddit-post-detail-scraper) | Single post + comments thread on Reddit |

Browse the full catalog at [apify.com/xtracto](https://apify.com/xtracto).

### Notes

- **Deleted tweets** return `{"_error": "not_found", "_input": "..."}` — they cannot be recovered after the author or X removes them.
- **Protected accounts** cannot be fetched. If the author has set their tweets to "Protected" (followers-only), the tweet returns `{"_error": "private", ...}`.
- **View counts** may be missing (`views.count` absent) for very new tweets or accounts that opted out of public view-count display.
- **Long-form tweets** (premium tweets over 280 characters) return the full body in `full_text` — no truncation.
- **Media variants**: when present, `extended_entities.media` carries every photo size and the full mp4 bitrate ladder for videos, verbatim from X's response — ready for direct download.
- **Counters are eventually-consistent** and may lag the live network by a few minutes.
- **Fallback path**: some older tweets are only available via the secondary source (`_source: "S2-fallback"`), which returns a slightly simpler shape — `reply_count` and `quote_count` may be absent in that case.

# Actor input Schema

## `tweets` (type: `array`):

List of X (Twitter) tweets to fetch. Accepts full status URLs (twitter.com or x.com) and bare numeric status IDs. Mix both in the same run.

## `proxyConfiguration` (type: `object`):

Apify Proxy settings. Datacenter proxy works for most tweets; switch to residential if you hit rate limits on large jobs.

## Actor input object example

```json
{
  "tweets": [
    "1518623997054918657",
    "https://twitter.com/jack/status/20"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "tweets": [
        "1518623997054918657",
        "https://twitter.com/jack/status/20"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("xtracto/x-post-detail-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 = { "tweets": [
        "1518623997054918657",
        "https://twitter.com/jack/status/20",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("xtracto/x-post-detail-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 '{
  "tweets": [
    "1518623997054918657",
    "https://twitter.com/jack/status/20"
  ]
}' |
apify call xtracto/x-post-detail-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "X (Twitter) Post Detail Scraper",
        "description": "Get full detail for any public X (Twitter) tweet by ID or URL. Returns text, media (photos/videos), engagement counts (likes/retweets/replies/views), entities (hashtags/URLs/mentions), and author info. HTTP-only, no login.",
        "version": "1.0",
        "x-build-id": "0GArRhdbB6dfwFRkU"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/xtracto~x-post-detail-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-xtracto-x-post-detail-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/xtracto~x-post-detail-scraper/runs": {
            "post": {
                "operationId": "runs-sync-xtracto-x-post-detail-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/xtracto~x-post-detail-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-xtracto-x-post-detail-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": [
                    "tweets"
                ],
                "properties": {
                    "tweets": {
                        "title": "Tweet URLs or IDs",
                        "type": "array",
                        "description": "List of X (Twitter) tweets to fetch. Accepts full status URLs (twitter.com or x.com) and bare numeric status IDs. Mix both in the same run.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Apify Proxy settings. Datacenter proxy works for most tweets; switch to residential if you hit rate limits on large jobs.",
                        "default": {
                            "useApifyProxy": 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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
