# Twitter / X Scraper — 19 Fields per Tweet, No API Key (`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 10 free.

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

## Pricing

from $1.80 / 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.
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 web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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, No Paid API Key

> **Part of the Social & Market Research MCP.** This actor's data is also available to AI agents through our [Social & Market Research MCP server](https://apify.com/themineworks/social-research-mcp) — eight social, news and search-interest tools behind one endpoint. No result, no charge.

> ⚡ 17/17 runs succeeded in the last 30 days · public tweets, no paid X API key.

> 💸 You're only charged for delivered results. Empty searches, failed pages and duplicate listings are never billed.

### Overview

Twitter / X Scraper pulls public tweets from X (formerly Twitter) by keyword, hashtag, or username, and returns them as clean, structured JSON without paying for the official X API. Give it a search term (`"AI agents"`) or a handle (`"@vercel"`), and get back tweet text, author, engagement counts, view counts, and media URLs. No expensive API tier, no developer-app approval, no seat license.

Built for brand and social monitoring, market intelligence, journalism, research, and AI agents that need live tweet data.

Reliability posture: a profile that can't be found, a timeline with zero tweets, or a fetch that fails is never charged. You only pay for a tweet that was actually delivered.

✅ No paid API key | ✅ Keyword, hashtag & handle | ✅ Views, likes, retweets | ✅ MCP-ready for AI agents

### Features

Keyword and hashtag search across public tweets with `maxTweets` cap.
Handle scraping to pull a user's recent timeline tweets.
Search filters for latest, top, media, or news slice.
Rich engagement fields: likes, retweets, replies, and views.
Same output whether you consume it via CSV, JSON, Excel, API, or MCP tool call.

### How it works

X (formerly Twitter) closed off its free API tier, and the paid tiers start at hundreds of dollars per month with strict caps. This actor reads the public web search and timeline endpoints that power the X site itself, normalises the JSON, and returns one flat record per tweet. Session cookies or auth tokens are optional and only needed for higher-volume, longer-tail scrapes; smaller runs work fully unauthenticated.

The output is analytics-ready. Every tweet carries author, engagement counts, views, media URLs, hashtags, and mentions at the top level. Pipe straight into a dashboard, a warehouse, or a RAG index for a social-listening agent.

### 🧾 Input configuration

```json
{
  "searchTerms": ["AI agents", "#claudecode"],
  "handles": ["@vercel"],
  "maxTweets": 500,
  "searchFilter": "latest",
  "proxyConfig": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] },
  "sessionCookies": null,
  "authToken": null
}
```

### 📤 Output format

```json
{
  "tweetId": "2077047278078931243",
  "authorVerified": true,
  "text": "We're introducing Claude for Teachers: free access to premium Claude capabilities for verified K-12 educators in the US, with a library of teaching skills and a direct connection to evidence-based curricula, mapped to academic standards in all 50 states.\n\nhttps://t.co/5hZZijVPCV https://t.co/5ofG8YLEON",
  "date": "2026-07-14T15:07:15.000Z",
  "likes": 18990,
  "retweets": 1465,
  "replies": 986,
  "views": 3900632,
  "isRetweet": false,
  "isReply": false,
  "mediaUrls": ["https://pbs.twimg.com/media/HNMmWvKW4AAju32.jpg"],
  "source": "@AnthropicAI",
  "scraped_at": "2026-07-15T04:15:31.538Z"
}
```

This record is from a live run against `@AnthropicAI`. Every tweet that reaches the dataset is billed once, and a tweet that fails to save is never billed.

Every tweet record can contain these fields. Fields X's API doesn't attach to a given tweet (for example `authorName`, `authorHandle`, `authorUrl`, `tweetUrl`, `hashtags`, or `mentions` when that data isn't present on a particular timeline entry) are simply left out of the record rather than sent as `null`, so not every tweet has every field below.

| Field | Description |
| --- | --- |
| 🆔 `tweetId` | X internal tweet ID |
| 🔗 `tweetUrl` | Canonical tweet URL, when available |
| 👤 `authorName` | Author display name, when available |
| 🆔 `authorHandle` | Author handle including `@`, when available |
| 🔗 `authorUrl` | Author profile URL, when available |
| ✅ `authorVerified` | True if the author is verified |
| 📝 `text` | Full tweet body text |
| 📅 `date` | Post datetime in ISO |
| ❤️ `likes` | Like count |
| 🔁 `retweets` | Retweet count |
| 💬 `replies` | Reply count |
| 👀 `views` | View count |
| 🔄 `isRetweet` | True if this is a retweet |
| ↩️ `isReply` | True if this is a reply |
| 🖼️ `mediaUrls` | Array of media URLs, when the tweet has media |
| 🏷️ `hashtags` | Array of hashtags in the tweet, when present |
| 👥 `mentions` | Array of mentioned handles, when present |
| 🧭 `source` | The search term or `@handle` that returned this tweet |
| 🕒 `scraped_at` | ISO timestamp of capture |

### 💼 Common use cases

**Brand and social monitoring**
Track every mention of your brand, product, or a competitor in near-real time.
Route new tweets to Slack, a CRM, or a support inbox for triage.

**Market and campaign intelligence**
Measure the volume, sentiment, and reach of a hashtag or launch campaign.
Benchmark share of voice across a competitive set on X.

**Journalism and research**
Assemble a dataset of tweets around a news event, election, or crisis.
Preserve public tweets for academic or newsroom analysis.

**AI social copilots**
Give an agent live X data so it can answer "what are people saying about X?"
Feed structured tweet data into a live RAG index for a social listening bot.

### 🚀 Getting started

1. Open the actor and set `searchTerms` for keyword or hashtag search, or `handles` for user timelines.
2. Pick a `searchFilter` (`latest`, `top`, `media`, or `news`).
3. Set `maxTweets` to cap volume, and keep residential proxy on.
4. Optionally supply `sessionCookies` or `authToken` for higher-volume runs.
5. Click Start, then download the dataset as JSON, CSV, or Excel, or pull it via API or MCP.

### 💵 Pricing

One event, `tweet-scraped`, charged per tweet delivered to your dataset. The rate depends on your Apify discount tier:

| Your Apify tier | Price per tweet | Per 1,000 tweets |
| --- | --- | --- |
| FREE | $0.003 | $3.00 |
| BRONZE | $0.00255 | $2.55 |
| SILVER | $0.00215 | $2.15 |
| GOLD / PLATINUM / DIAMOND | $0.0018 | $1.80 |

Pay as you go — no subscription and no developer-app approval. A profile that can't be found, a timeline with zero tweets, and a fetch that fails are never billed: the charge fires per tweet actually delivered, so an empty run costs nothing.

Prices vary by your Apify [discount tier](https://docs.apify.com/platform/actors/publishing/monetize/pricing-and-costs) (FREE, BRONZE, SILVER, GOLD; PLATINUM and DIAMOND are enterprise tiers). The actor's **Pricing** tab shows the exact rate applied to your account.

### ⏰ Run it on a schedule

Brand and hashtag monitoring is the natural recurring use — a standing keyword or handle query that keeps a rolling record of what's being said.

1. On this actor's page, click **⋯ → Schedule actor** (or Console → **Schedules → Create new**).
2. Pick a frequency — `@hourly` or `@daily` for live brand monitoring; `@weekly` for share-of-voice reporting.
3. Your saved input is reused on every run; each run appends to a named dataset.
4. Wire the dataset to Google Sheets, Slack, or a webhook via the actor's **Integrations** tab so new records reach you automatically.

### FAQ

**Do I need X API access?**
No. The actor reads public web endpoints, so you skip the paid X API tier entirely.

**How far back can it go?**
Keyword search covers roughly the same public window that x.com search itself exposes, ordered by `latest` or `top`. Handle scraping pulls the user's recent public timeline.

**Do I need cookies or a token?**
No for smaller runs. Larger, longer runs (thousands of tweets over hours) can benefit from an auth token or session cookie for steadier throughput.

**How much does it cost?**
From $3.00 per 1,000 tweets on the FREE tier, down to $1.80 per 1,000 on GOLD and above. You pay per tweet actually delivered, so empty runs cost nothing. Full table in [Pricing](#-pricing).

**Can I use it inside an AI agent?**
Yes. It is exposed as an MCP tool. See below.

**Can I scrape tweets from a specific date range?**
Not as an input filter — there is no `dateFrom`/`dateTo` field. Use `searchFilter: "latest"` with a `maxTweets` cap to walk back from the present, then filter on the `date` field in the output. Keyword search only reaches as far back as x.com's own public search exposes.

**How is this different from the official X API?**
No developer application to get approved, no monthly subscription, and you pay only for tweets delivered. The trade-off is scope: this reads the public search and timeline surfaces, so you get public tweets and their engagement counts — not streaming/firehose access, DMs, or account-level endpoints that require authenticated API scopes.

**Why should I leave the residential proxy on?**
X rate-limits and blocks data-centre IP ranges aggressively. The actor defaults to Apify's `RESIDENTIAL` proxy group so requests come from consumer ISPs and look like ordinary visitors, which is what keeps run success high. Turning it off will cost you far more in failed runs than it saves.

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

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

Or call it programmatically 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'],
  maxTweets: 500,
  searchFilter: 'latest',
});

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

### 🛠️ Complete your social listening pipeline

Pair this actor with the rest of the themineworks social and brand suite:

- **[TikTok Shop Products Scraper](https://apify.com/themineworks/tiktok-shop-products)**: cross-reference social buzz with what people are actually buying.
- **[YouTube Transcript Scraper](https://apify.com/themineworks/youtube-transcript-scraper)**: add long-form video sentiment to your listening.
- **[B2B Leads Finder](https://apify.com/themineworks/b2b-leads-finder)**: turn engaged companies into decision-maker contacts.

Typical flow: twitter-x-scraper surfaces the wave, tiktok-shop-products validates commercial pull, b2b-leads-finder helps you reach the buyer.

Questions or need a custom field set? Reach out through the Apify profile.

# 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

Download the OpenAPI definition: https://api.apify.com/v2/actors/iuQoQlecCqJfWXZeX/builds/fOfwl570q0oCCfT2k/openapi.json
