# 🐦 Twitter / X Scraper — Tweets, No API Key · $50/1k (`themineworks/twitter-x-scraper`) Actor

Scrape public tweets from X (Twitter) by keyword, hashtag or username without a paid API key. Returns text, likes, retweets, views, date and media URLs. MCP-ready. Pay per tweet, first 25 free.

- **URL**: https://apify.com/themineworks/twitter-x-scraper.md
- **Developed by:** [The Mine Works](https://apify.com/themineworks) (community)
- **Categories:** MCP servers, Social media, Developer tools
- **Stats:** 1 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$50.00 / 1,000 tweets

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## Twitter / X Scraper — Tweets by Keyword or Handle (No API Key)

### What is Twitter / X Scraper?

Twitter / X Scraper pulls public tweets from X (formerly Twitter) by keyword, hashtag, or username — and returns them as clean, structured data, without paying for the official X API.

Give it a search term or a handle, and get back structured JSON/CSV: tweet text, author, engagement counts, view counts, and media URLs. No expensive API tier, no developer app approval.

- 🔎 **Search by keyword or hashtag** — capture every public tweet matching a term.
- 👤 **Scrape by handle** — pull a user's recent timeline tweets.
- 📊 **Measure engagement** — likes, retweets, replies, and views on each tweet.
- 🤖 **Feed AI agents** — pipe live tweet data into Claude, ChatGPT, or any MCP workflow.
- ⬇️ **Export anywhere** — JSON, CSV, Excel, or the Apify API and webhooks.

### Skip the paid X API

X's official API now starts at hundreds of dollars per month and rate-limits hard even on paid tiers. This scraper reads the same public tweets any logged-out visitor can see — no paid API key, no developer app, no per-request billing from X. It runs over residential proxies to stay under X's bot detection. Note: without login, X shows a limited number of tweets per source before its sign-in wall, so expect roughly 5–20 tweets per keyword or handle. You can optionally supply your own session cookies or `auth_token` to unlock more.

### What data can I extract from a tweet?

Every field below is produced by the actor's real output.

| Field | Field | Field |
|---|---|---|
| 🆔 `tweetId` | 🌐 `tweetUrl` | 📝 `text` |
| 🏷️ `authorName` | 👤 `authorHandle` | 🔗 `authorUrl` |
| ✅ `authorVerified` | 🕒 `date` | ❤️ `likes` |
| 🔁 `retweets` | 💬 `replies` | 👁️ `views` |
| 🔂 `isRetweet` | ↩️ `isReply` | 🖼️ `mediaUrls[]` |
| #️⃣ `hashtags[]` | @ `mentions[]` | 🎯 `source` (term/handle) |
| 💳 `charged` | 🕓 `scraped_at` | |

### How to scrape Twitter / X in 5 steps

1. Open **Twitter / X Scraper** on Apify and click **Try for free**.
2. Add **Search terms / keywords** (e.g. `#AI agents`) and/or **User handles** (without @).
3. Set **Max tweets per source** and choose **Top** or **Latest** tweets.
4. (Optional) Paste session cookies or an `auth_token` to unlock login-gated content.
5. Click **Save & Start**, then download your data as JSON, CSV, or Excel.

### Example input

```json
{
  "searchTerms": ["#AI agents"],
  "handles": ["AnthropicAI"],
  "maxTweets": 20,
  "searchFilter": "top",
  "proxyConfig": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
````

### Example output

```json
{
  "tweetId": "1808123456789012345",
  "tweetUrl": "https://x.com/AnthropicAI/status/1808123456789012345",
  "authorName": "Anthropic",
  "authorHandle": "AnthropicAI",
  "authorUrl": "https://x.com/AnthropicAI",
  "authorVerified": true,
  "text": "New research on building reliable AI agents.",
  "date": "2026-07-09T17:30:00.000Z",
  "likes": 5820,
  "retweets": 941,
  "replies": 203,
  "views": 412903,
  "isRetweet": false,
  "isReply": false,
  "mediaUrls": ["https://pbs.twimg.com/media/abc123.jpg"],
  "hashtags": ["AI"],
  "mentions": [],
  "source": "AnthropicAI",
  "charged": true,
  "scraped_at": "2026-07-10T12:00:00.000Z"
}
```

### Use cases

- **Brand and topic monitoring** — track a keyword or hashtag and capture every matching public tweet.
- **Competitor and creator watch** — pull a handle's recent tweets and engagement over time.
- **Trend and virality analysis** — rank tweets by likes, retweets, and views to spot what's spreading.
- **Sentiment analysis** — collect tweet text at scale to score tone around a topic.
- **Campaign tracking** — measure reach and reactions on a branded hashtag.
- **AI training data** — build structured tweet datasets for agents and analytics.

### FAQ

#### Do I need the paid X API?

No. This scraper reads public tweets without X's official API, so you avoid its monthly cost and per-request limits. No developer app is required.

#### How many tweets can I get per keyword or handle?

Logged-out access typically returns roughly 5–20 tweets per source before X shows its sign-in wall. To go further, supply your own session cookies or `auth_token` in the input.

#### How am I charged?

Pay-per-tweet: you're billed only for tweets actually delivered. The `charged` field on each record shows whether it counted, and the first 25 results are free (lifetime) on your account.

#### Can I scrape both keywords and handles in one run?

Yes. Fill **Search terms** and **User handles** together; the `source` field tells you which term or handle each tweet came from.

#### Is it legal to scrape X / Twitter?

The actor collects only publicly visible tweets and never accesses private or protected accounts. Public data can include personal data under laws like the GDPR, so scrape only what you have a legitimate reason to use.

### Use in Claude, ChatGPT & any MCP agent

This actor is available as a hosted MCP server, so AI agents can call it directly:

```
https://mcp.apify.com/?tools=themineworks/twitter-x-scraper
```

Or run it from Node.js with the Apify client:

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

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });

const run = await client.actor('themineworks/twitter-x-scraper').call({
  searchTerms: ['#AI agents'],
  handles: ['AnthropicAI'],
  maxTweets: 20,
  searchFilter: 'top',
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### More social scrapers from themineworks

- 👤 [Instagram Profile Scraper](https://apify.com/themineworks/instagram-profile-scraper) — followers, bio, and stats for any public account.
- 🧵 [Threads Scraper](https://apify.com/themineworks/threads-scraper) — posts, profiles, hashtags & search on Meta Threads.
- 👽 [Reddit Scraper](https://apify.com/themineworks/reddit-scraper) — posts, comments, and subreddit search with full comment trees.

# Actor input Schema

## `searchTerms` (type: `array`):

Keywords or hashtags to search for tweets. X requires a real login for keyword search — without sessionCookies/authToken this falls back to a slower browser path with a 5-20 tweet ceiling. Example: \["#AI", "Anthropic Claude"]

## `handles` (type: `array`):

X usernames to scrape timeline tweets from (without @). Fetched over plain HTTP, no login needed — the fast, reliable path. Example: \["OpenAI", "AnthropicAI"]

## `maxTweets` (type: `integer`):

Maximum tweets to return per search term or handle. Handles: up to 100. Search without login: typically 5-20 before the sign-in wall.

## `searchFilter` (type: `string`):

Filter search results to top tweets or latest

## `proxyConfig` (type: `object`):

Only used by the unauthenticated-search browser fallback. Handles and authenticated search go over plain HTTP with no proxy.

## `sessionCookies` (type: `array`):

Cookie objects from a logged-in X session. Export from browser DevTools → Application → Cookies → twitter.com. Paste as JSON array. If provided, unlocks login-gated content.

## `authToken` (type: `string`):

Value of the auth\_token cookie from a logged-in X session. Shorter alternative to pasting the full cookie array.

## Actor input object example

```json
{
  "searchTerms": [],
  "handles": [
    "AnthropicAI"
  ],
  "maxTweets": 5,
  "searchFilter": "top",
  "proxyConfig": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "sessionCookies": []
}
```

# Actor output Schema

## `results` (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 = {
    "searchTerms": [],
    "handles": [
        "AnthropicAI"
    ],
    "maxTweets": 5,
    "sessionCookies": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("themineworks/twitter-x-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 = {
    "searchTerms": [],
    "handles": ["AnthropicAI"],
    "maxTweets": 5,
    "sessionCookies": [],
}

# Run the Actor and wait for it to finish
run = client.actor("themineworks/twitter-x-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 '{
  "searchTerms": [],
  "handles": [
    "AnthropicAI"
  ],
  "maxTweets": 5,
  "sessionCookies": []
}' |
apify call themineworks/twitter-x-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "🐦 Twitter / X Scraper — Tweets, No API Key · $50/1k",
        "description": "Scrape public tweets from X (Twitter) by keyword, hashtag or username without a paid API key. Returns text, likes, retweets, views, date and media URLs. MCP-ready. Pay per tweet, first 25 free.",
        "version": "0.1",
        "x-build-id": "5ghMrthqsdB5RzojJ"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/themineworks~twitter-x-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-themineworks-twitter-x-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/themineworks~twitter-x-scraper/runs": {
            "post": {
                "operationId": "runs-sync-themineworks-twitter-x-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/themineworks~twitter-x-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-themineworks-twitter-x-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",
                "properties": {
                    "searchTerms": {
                        "title": "Search terms / keywords",
                        "type": "array",
                        "description": "Keywords or hashtags to search for tweets. X requires a real login for keyword search — without sessionCookies/authToken this falls back to a slower browser path with a 5-20 tweet ceiling. Example: [\"#AI\", \"Anthropic Claude\"]",
                        "items": {
                            "type": "string"
                        }
                    },
                    "handles": {
                        "title": "User handles",
                        "type": "array",
                        "description": "X usernames to scrape timeline tweets from (without @). Fetched over plain HTTP, no login needed — the fast, reliable path. Example: [\"OpenAI\", \"AnthropicAI\"]",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxTweets": {
                        "title": "Max tweets per source",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Maximum tweets to return per search term or handle. Handles: up to 100. Search without login: typically 5-20 before the sign-in wall.",
                        "default": 20
                    },
                    "searchFilter": {
                        "title": "Tweet type filter",
                        "enum": [
                            "top",
                            "latest"
                        ],
                        "type": "string",
                        "description": "Filter search results to top tweets or latest",
                        "default": "top"
                    },
                    "proxyConfig": {
                        "title": "Proxy configuration (search fallback only)",
                        "type": "object",
                        "description": "Only used by the unauthenticated-search browser fallback. Handles and authenticated search go over plain HTTP with no proxy.",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ]
                        }
                    },
                    "sessionCookies": {
                        "title": "Session cookies (optional)",
                        "type": "array",
                        "description": "Cookie objects from a logged-in X session. Export from browser DevTools → Application → Cookies → twitter.com. Paste as JSON array. If provided, unlocks login-gated content."
                    },
                    "authToken": {
                        "title": "Auth token (optional — alternative to sessionCookies)",
                        "type": "string",
                        "description": "Value of the auth_token cookie from a logged-in X session. Shorter alternative to pasting the full cookie array."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
