# Twitter / X Scraper - Tweets, Profiles, Search & Trends API (`selleraim.com/twitter-pro-scraper`) Actor

Four-mode Twitter / X scraper: keyword search, tweet detail by ID/URL, user profile + posts, trending topics. Returns text, author, likes, retweets, replies, views, media, language, publish time. No login. For sentiment, trends, KOL discovery, AI training data.

- **URL**: https://apify.com/selleraim.com/twitter-pro-scraper.md
- **Developed by:** [Seller Aim](https://apify.com/selleraim.com) (community)
- **Categories:** Social media, Developer tools, AI
- **Stats:** 27 total users, 2 monthly users, 96.2% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 search / list results

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/actors/running/actors-in-store.md#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 Pro Scraper

Full-featured **Twitter / X** scraper. Four modes, one Actor, clean structured JSON. No login, no cookies, no broken-token surprises.

Built for serious workloads — market sentiment research, KOL discovery, AI training pipelines harvesting English-language UGC, brand-watch dashboards, lead-generation lists, real-time event monitoring.

### What does this Actor do?

Pick a mode, give it inputs, get a dataset:

- **Keyword search** — search Twitter / X by keyword or full advanced query (`AI lang:en min_faves:100`). Five timeline types: Top, Latest, People, Media, Lists.
- **Tweet detail by ID / URL** — paste a tweet ID or `twitter.com/user/status/<id>` URL; get text, author, likes, retweets, replies, views, bookmarks, media URLs, language, publish time, and (optional) top replies.
- **User profile + recent posts** — fetch a handle's profile (followers, bio, verified status, account age, location) and their recent tweets with pagination.
- **Trending topics** — global trending list ordered by volume.

Each tweet returns a flat, schema-validated JSON row that's downloadable as JSON, CSV, Excel, HTML, or XML — and queryable via the Apify REST API for pipeline integration.

### Why use Twitter / X Pro Scraper?

- **No login, no breakage.** Other Twitter actors in the store rely on the user's logged-in cookie or `auth_token` that expires within days, or on credentials that get accounts banned. Customers end up with a stream of 401s and 1.5★ reviews. We use a maintained backend surface that stays stable.
- **Four modes in one Actor.** Search, tweet, user, trending — pick a mode per run; no juggling separate Actors.
- **Full-field output.** Text, author + screen name + uid, likes, retweets, replies, views, bookmarks, quotes, media URLs, language, publish time, conversation id, quoted tweet — all in one row.
- **AI training-ready.** English UGC, clean JSON, deduplicable by `tweetId`. Drop straight into a vector DB, an LLM fine-tune set, or a sentiment classifier.
- **Marketing dashboards.** Schedule keyword runs hourly and build a real-time pulse of any brand, product, ticker, or campaign on X.

### How to use

1. Open the Actor and click **Try for free**.
2. In the Input tab, pick a **Scrape mode** (search is the default).
3. Fill the inputs for your mode:
   - **search**: keywords + `searchType` (Top / Latest / People / Media / Lists)
   - **tweets**: tweet IDs or URLs in `tweetIds`
   - **user**: handles (without `@`) in `screenNames`
   - **trending**: nothing required
4. Set **Max items per input** (default 50).
5. Click **Save & Start**. Results stream into the dataset live.
6. Download or stream the dataset; schedule the run under the **Schedules** tab.

### Input

| Field | Type | Used in mode | Description |
|---|---|---|---|
| `mode` | string | all | One of `search`, `tweets`, `user`, `trending`. |
| `keywords` | array<string> | search | Keywords or full Twitter advanced-search queries. |
| `searchType` | enum | search | `Top` / `Latest` / `People` / `Media` / `Lists`. |
| `tweetIds` | array<string> | tweets | Numeric tweet IDs or full URLs. |
| `screenNames` | array<string> | user | Twitter / X handles (without `@`). |
| `maxItemsPerInput` | integer (1–1000) | all | Cap per keyword / tweet / user. Default 50. |
| `fetchComments` | boolean | tweets | Fetch up to 20 top replies per tweet. Extra cost. |

JSON example — keyword search:

```json
{
    "mode": "search",
    "keywords": ["claude code", "AI lang:en min_faves:100"],
    "searchType": "Latest",
    "maxItemsPerInput": 100
}
```

### Output

```json
{
    "tweetId": "2056362875195686927",
    "text": "the engineer who built Claude Code just dropped a 28-minute video on how to write prompts that actually work...",
    "author": "Anatoli Kopadze",
    "screenName": "AnatoliKopadze",
    "userId": "1234567890",
    "likes": 23714,
    "retweets": 4098,
    "replies": 189,
    "quotes": 56,
    "views": 6018031,
    "bookmarks": 59314,
    "isVideo": false,
    "media": ["https://pbs.twimg.com/.../photo.jpg"],
    "lang": "en",
    "publishedAt": "2026-05-18T13:14:49.000Z",
    "tweetUrl": "https://twitter.com/AnatoliKopadze/status/2056362875195686927",
    "conversationId": "2056362875195686927",
    "quotedTweetId": null,
    "keyword": "claude code",
    "searchType": "Latest",
    "scrapedAt": "2026-05-22T13:30:01.000Z"
}
```

#### Output fields

| Field | Description |
|---|---|
| `tweetId` | Numeric tweet ID (canonical). |
| `text` | Tweet body (full text, not truncated). |
| `author` | Display name of the author. |
| `screenName` | Author handle (no `@`). |
| `userId` | Numeric user ID — pair with `mode: "user"` to drill in. |
| `likes` | Favorite / like count. |
| `retweets` | Retweet count. |
| `replies` | Reply count. |
| `quotes` | Quote-tweet count. |
| `views` | View count. |
| `bookmarks` | Bookmark count. |
| `isVideo` | True if the tweet includes a video. |
| `media` | All media URLs (videos first, then photos). |
| `lang` | Twitter-detected language code. |
| `publishedAt` | ISO 8601 publish time. |
| `tweetUrl` | Public deep link. |
| `conversationId` | ID of the root tweet for the thread. |
| `quotedTweetId` | ID of the quoted tweet, if this is a quote-tweet. |
| `replies` (when `fetchComments`) | Top 20 reply tweets. |
| `userProfile` | Author profile object (user mode only). |
| `scrapedAt` | ISO 8601 timestamp of scrape. |

### Pricing

**$1.99 per 1,000 results.** Each tweet returned counts as one result. `tweets` mode with `fetchComments=true` returns richer rows but is billed at the same rate.

#### Free vs. paid Apify plans

Apify free-plan users get **2 sample runs capped at 10 results each** so you can verify the data shape and quality before committing. Further runs from free accounts are blocked with an upgrade prompt — this Actor relies on a paid backend, so we can't subsidise unlimited free use. Any Apify paid plan ($49/month and up — see [Apify pricing](https://apify.com/pricing)) unlocks unlimited runs at the rate above.

#### Cost estimates

| Goal | Items / run | Mode | Est. cost / run |
|---|---|---|---|
| Quick scan of one keyword | 50 | search | ~$0.20 |
| Brand round-up | 500 | search | ~$2.00 |
| KOL deep dive | 200 tweets | user | ~$0.80 |
| Daily ticker monitoring | 1,000 | search | ~$4.00 / day |

Apify also charges a small compute fee (typically $0.01-0.05 per minute of run time).

### Tips

- **Use Twitter advanced search syntax.** `AI lang:en min_faves:100 since:2026-01-01` filters at the source — fewer wasted billed rows.
- **Schedule, don't poll.** For breaking news / event monitoring, schedule every 5-15 minutes during peak hours.
- **Deduplicate by `tweetId`.** Sequential runs overlap; merge and dedupe on `tweetId`.
- **Pair user + tweets modes.** Use `mode: "user"` to find KOLs, then drill into top tweets with `mode: "tweets"` + `fetchComments`.
- **`searchType: "Top"` vs `Latest`.** Top surfaces high-engagement tweets; Latest is firehose. Pick based on whether you want signal or recency.

### FAQ

**Q: Why is this Actor different from the other Twitter scrapers on the Store?**
A: Most existing actors depend on customer-provided `auth_token` / cookies that expire fast or get accounts banned. We don't ask for credentials. We've engineered around stable backend surfaces so the Actor stays usable across token rotations.

**Q: Will this break when Twitter / X changes their API?**
A: Possibly. Our team maintains the backend; we patch usually within 24-72 hours of a backend change. Bug reports via the Issues tab.

**Q: Is scraping Twitter / X legal?**
A: We pull only publicly-accessible content — what any visitor can see without logging in. Your usage is your responsibility; comply with your jurisdiction's law and X's Terms of Service. Do not use the data to identify or target individuals.

**Q: Can I get my data via API?**
A: Yes. Every Apify run exposes a stable [REST API](https://docs.apify.com/api/v2) for inputs, datasets, and run status. Plug into n8n, Make, Zapier, or your own pipeline.

**Q: Is there a free tier?**
A: The Apify platform gives every new account $5 in free credit — enough for ~1,000 results to evaluate the Actor before committing.

**Q: How fast are runs?**
A: Search: ~3 seconds per page (~20 tweets). User: ~2 seconds per page. Tweet detail: ~1 second per tweet. Trending: ~1 second total.

**Q: I need a richer integration or higher-volume contract.**
A: Reach out via Apify chat. Custom endpoints and SLAs available on request.

# Actor input Schema

## `mode` (type: `string`):

What to pull from Twitter / X.

## `keywords` (type: `array`):

Keywords or queries. Supports Twitter advanced search syntax (e.g. 'AI lang:en min\_faves:100').

## `searchType` (type: `string`):

Which timeline tab to scrape from.

## `tweetIds` (type: `array`):

Tweet IDs or full URLs (twitter.com/user/status/<id>).

## `screenNames` (type: `array`):

Twitter / X handles without '@'.

## `maxItemsPerInput` (type: `integer`):

Cap per keyword / tweet / user. Each item returned is one billed result.

## `fetchComments` (type: `boolean`):

When on, fetches up to 20 top replies per tweet (tweets mode only). Extra cost per tweet.

## Actor input object example

```json
{
  "mode": "search",
  "keywords": [
    "AI"
  ],
  "searchType": "Latest",
  "tweetIds": [],
  "screenNames": [],
  "maxItemsPerInput": 50,
  "fetchComments": false
}
```

# 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 = {
    "keywords": [
        "AI"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("selleraim.com/twitter-pro-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 = { "keywords": ["AI"] }

# Run the Actor and wait for it to finish
run = client.actor("selleraim.com/twitter-pro-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 '{
  "keywords": [
    "AI"
  ]
}' |
apify call selleraim.com/twitter-pro-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,selleraim.com/twitter-pro-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/Zz8bLrXsyJyesvhKW/builds/Nch7a6MMtWQ2tBf2p/openapi.json
