# X (Twitter) Tweet Scraper 🐦 (by URL or ID, no login) (`tagadanar/x-tweet-scraper`) Actor

Scrape X (Twitter) posts by URL or ID in bulk: text, author, posted date, likes, replies, photos and videos with every variant, links, hashtags, mentions, quoted post and reply-to. No login, no API key. $0.20 per 1,000 posts, all-in.

- **URL**: https://apify.com/tagadanar/x-tweet-scraper.md
- **Developed by:** [Tagada Data](https://apify.com/tagadanar) (community)
- **Categories:** Social media, News, AI
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.14 / 1,000 posts

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

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## X (Twitter) Tweet Scraper 🐦 (by URL or ID, no login)

Paste X (Twitter) post URLs or post IDs, get one clean row per post: the full text with links expanded, the author (handle, name, ID, verified type, avatar), the posted date, like and reply counts, every photo and video (with all MP4 resolutions and the HLS stream), links, hashtags, cashtags, mentions, the quoted post and the post it replies to, the language and the link card. Bulk: up to 10,000 posts per run, in the order you gave them.

**$0.20 per 1,000 posts on Free ($0.14 on Gold), plus $0.001 per run. Platform usage is included.** No X account, no login, no cookies, no API key, no proxy to configure.

### What you get

One flat row per input, in input order. Fields X does not publish for a post are null.

| Field | What it is |
| --- | --- |
| `input` | The post ID this row answers |
| `tweetId`, `url` | Post ID and its x.com link |
| `text` | Post text, t.co links replaced by where they point |
| `isLongPost` | `true` for a long post: `text` then holds X's first part only (about 280 characters) |
| `lang`, `createdAt` | Language code and posted time (ISO 8601) |
| `authorHandle`, `authorName`, `authorId`, `authorUrl` | Who posted it |
| `authorIsVerified`, `authorIsBlueVerified`, `authorVerifiedType`, `authorAffiliation` | Checkmark data (`Government`, `Business`, ...) and the affiliate label |
| `authorAvatarUrl` | Author avatar, 400 x 400 |
| `likeCount`, `replyCount` | Likes and replies |
| `media` | Each photo / video / GIF: type, full-size URL, preview, alt text, width, height, duration, and every video variant (URL, content type, bitrate) |
| `mediaTypes`, `mediaUrls`, `videoUrl` | Flat media summary; `videoUrl` is the highest-bitrate MP4 |
| `links`, `hashtags`, `cashtags`, `mentions` | Entities in the text |
| `isReply`, `inReplyToTweetId`, `inReplyToHandle`, `inReplyToUserId` | Reply data |
| `replyTo` | The post it replies to: ID, URL, text, author, date, likes, replies, reposts, media |
| `conversationId` | The thread's first post, where it can be determined (the post itself, or the post it replies to when that one starts the thread); null deeper in a thread |
| `isQuote`, `quotedTweetId`, `quotedTweet` | The quoted post, same fields as `replyTo` |
| `card` | Link card / broadcast / poll: type, URL, title, description, domain, image, poll choices |
| `possiblySensitive`, `isEdited`, `editHistoryIds` | Flags and the IDs of earlier versions of an edited post |
| `status`, `statusDetail` | `ok`, or why this input has no post (see below) |
| `scrapedAt` | When the row was fetched |

What this actor does not return: the repost, quote, bookmark and view counts of the post itself, and the author's follower count. X does not publish those to logged-out readers on this route. The quoted post and the post replied to do carry their repost count. For an account's follower count, bio and latest posts, use our **X Profile Scraper** with the handle.

Sample row (shortened):

```json
[{
  "tweetId": "2118449337814352016",
  "url": "https://x.com/NASA/status/2118449337814352016",
  "text": "Flying high!\n\nToday, our X-59 quiet supersonic X-59 aircraft traveled from Birmingham, Alabama, to Daytona Beach, Florida. ...",
  "isLongPost": true,
  "lang": "en",
  "createdAt": "2026-11-05T21:04:15.000Z",
  "authorHandle": "NASA",
  "authorVerifiedType": "Government",
  "likeCount": 16272,
  "replyCount": 470,
  "mediaTypes": ["photo"],
  "mediaUrls": ["https://pbs.twimg.com/media/HWY9OvvWoAA7DBr.jpg?name=orig"],
  "status": "ok"
}]
```

### Who uses it

- **Social listening and PR teams** who already have post links (from alerts, spreadsheets, mentions) and need the text, author and engagement in a table.
- **Researchers and journalists** archiving a list of posts with their media files, quoted posts and reply context before they are edited or deleted.
- **Data and AI teams** enriching a dataset of post IDs with text, language, media URLs and entities.
- **Creators and marketers** pulling the MP4 files and photos behind a set of posts.

### Examples

Prefill (three posts; URL shapes and a bare ID mixed):

```json
{"tweets":["https://x.com/NASA/status/2118449337814352016","https://twitter.com/NASA/status/2118443154269503596","20"]}
```

A list of bare post IDs:

```json
{"tweets":["2118443154269503596","2093063226351136958","2118312556548784475"]}
```

Accepted shapes: `x.com/<user>/status/<id>`, `twitter.com/...`, `mobile.twitter.com/...`, `x.com/i/web/status/<id>`, links with `?s=20` or `/photo/1` tails, fxtwitter / vxtwitter links, and bare IDs. Duplicates are fetched once. A profile URL without `/status/` is skipped with a warning.

### Results, zeros and errors

Every input gets a row, so you can join the output back to your list:

- `ok`: the post (charged).
- `not_found`: X has no public post with this ID: deleted, never existed, or from a protected or suspended account. Not charged.
- `unavailable`: X withholds the post and gives its reason in `statusDetail`. Not charged.
- `error`: X did not answer for this post after retries. Not charged; re-run those IDs.
- `not_reached`: the run hit its timeout or your maximum charge first. Not charged.

The run status says how many of each. A run where every post is `not_found` ends SUCCEEDED only after X answered a known public post in the same run, so a temporary block is never reported as "deleted": if that known post fails too, the run fails and those rows say `error`, not `not_found`. Invalid input ends the run right away with an "Input error: ..." message and only the $0.001 start charge.

### Pricing

- $0.001 per run (start).
- $0.20 per 1,000 posts on Free, $0.18 on Bronze, $0.16 on Silver, $0.14 on Gold. Platform usage is included.
- Only `ok` rows are charged.

Set a maximum charge per run in Apify if you want a hard ceiling; the actor stops at it and says so in the status.

### FAQ

**Do I need an X account, cookies or an API key?** No. The actor reads the public embed data X serves for every embedded post.

**Can it search X or list an account's posts?** Not this actor: it fetches posts you already have links or IDs for. For an account's latest posts and profile, use our X Profile Scraper.

**Why is the text cut for some posts?** Long posts (over 280 characters) are flagged `isLongPost: true`; X shows logged-out readers their first part only.

**Can I download the videos?** Yes: `media[].variants` lists every MP4 resolution with its bitrate, and `videoUrl` is the best one.

**How fast is it?** Several posts per second; 1,000 posts take a few minutes.

### Data use

Data comes from X's public embed endpoint, the same data shown when a post is embedded on a website. Only public posts are returned. Rows include public account names and handles; if you process data about people in the EU or UK, you are responsible for having a lawful basis under GDPR. Respect X's terms and the rights of the people who posted.

# Changelog

This Actor's version history is a separate document: https://apify.com/tagadanar/x-tweet-scraper/changelog.md

# Actor input Schema

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

X (Twitter) posts to fetch, one per line: a post URL (x.com/<user>/status/<id>, twitter.com, mobile.twitter.com, fxtwitter, vxtwitter links all work) or the bare numeric post ID. Duplicates are fetched once. Up to 10,000 per run. For an account's profile and latest posts by handle, use our X Profile Scraper instead.

## Actor input object example

```json
{
  "tweets": [
    "https://x.com/NASA/status/2118449337814352016",
    "https://twitter.com/NASA/status/2118443154269503596",
    "20"
  ]
}
```

# Actor output Schema

## `dataset` (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 = {
    "tweets": [
        "https://x.com/NASA/status/2118449337814352016",
        "https://twitter.com/NASA/status/2118443154269503596",
        "20"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("tagadanar/x-tweet-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": [
        "https://x.com/NASA/status/2118449337814352016",
        "https://twitter.com/NASA/status/2118443154269503596",
        "20",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("tagadanar/x-tweet-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).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": [
    "https://x.com/NASA/status/2118449337814352016",
    "https://twitter.com/NASA/status/2118443154269503596",
    "20"
  ]
}' |
apify call tagadanar/x-tweet-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,tagadanar/x-tweet-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/FGL4jPr2Hq36ezpzF/builds/14hQGR3IhRaoBjtQ3/openapi.json
