# X (Twitter) User Tweets Scraper (`khadinakbar/x-user-tweets-scraper`) Actor

Scrape public tweets from X/Twitter user profiles by handle or URL — cookieless, no login required. Provider-backed (ScrapeCreators + SociaVault). MCP-ready.

- **URL**: https://apify.com/khadinakbar/x-user-tweets-scraper.md
- **Developed by:** [Khadin Akbar](https://apify.com/khadinakbar) (community)
- **Categories:** Social media, Lead generation, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 tweet scrapeds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## X (Twitter) User Tweets Scraper

Scrape public tweets from X (Twitter) user profiles by handle or profile URL — **no login, no cookies, no browser required**. Provider-backed (ScrapeCreators primary, SociaVault fallback) for high reliability. MCP-ready.

### What you get

| Field | Description |
|---|---|
| `tweet_id` | Unique tweet ID |
| `text` | Tweet text (first 280 chars) |
| `full_text` | Full tweet text |
| `author_handle` | X handle (e.g. `apify`) |
| `author_name` | Display name |
| `author_followers` | Follower count |
| `author_verified` | Blue-check status |
| `created_at` | Tweet date/time |
| `like_count` | Like count |
| `retweet_count` | Retweet count |
| `reply_count` | Reply count |
| `view_count` | View count (when available) |
| `is_retweet` | `true` if RT |
| `is_reply` | `true` if reply |
| `has_media` | `true` if image/video |
| `media_urls` | Direct media URLs |
| `hashtags` | Extracted hashtags |
| `urls` | Expanded URLs |
| `url` | Canonical tweet URL |

### Use cases

- **Competitor monitoring** — track what competitors post and which posts go viral
- **Lead intelligence** — understand prospects' interests before outreach
- **Content research** — find top-performing tweet formats for a niche
- **Brand monitoring** — watch key accounts for product/company mentions
- **AI agent tool** — LLM-friendly JSON output for automated workflows

### Quick start

**Input:**

```json
{
  "usernames": ["apify", "openai"],
  "maxTweetsPerUser": 20,
  "includeRetweets": false
}
```

**Output (one row per tweet):**

```json
{
  "tweet_id": "1825000000000000000",
  "text": "Announcing our new MCP-ready Actor suite...",
  "author_handle": "apify",
  "author_name": "Apify",
  "author_followers": 45000,
  "created_at": "Tue Aug 19 12:00:00 +0000 2026",
  "like_count": 312,
  "retweet_count": 48,
  "reply_count": 21,
  "is_retweet": false,
  "has_media": true,
  "url": "https://x.com/apify/status/1825000000000000000"
}
```

### Pricing

**Pay per event:** $0.003 per tweet scraped. Platform compute costs passed through.

- 100 tweets ≈ $0.30
- 1,000 tweets ≈ $3.00
- Handles that return no data are **not billed**

See the [Pricing tab](https://apify.com/khadinakbar/x-user-tweets-scraper#pricing) for details.

### Inputs

| Field | Type | Default | Description |
|---|---|---|---|
| `usernames` | string\[] | — | Handles or profile URLs (required) |
| `maxTweetsPerUser` | integer | 50 | Max tweets per handle (max 500) |
| `includeRetweets` | boolean | true | Include RT tweets |
| `includeReplies` | boolean | true | Include reply tweets |
| `startDate` | string | — | Filter tweets on/after YYYY-MM-DD |
| `endDate` | string | — | Filter tweets on/before YYYY-MM-DD |
| `minimumLikes` | integer | 0 | Min like count filter |
| `minimumRetweets` | integer | 0 | Min retweet count filter |
| `providerOrder` | select | scrapecreators-first | Provider routing |

### Limitations

- Returns **recent tweets** (provider typically delivers the most recent ~100). Historical archive requires cookie-based authentication — use [X Tweet Scraper](https://apify.com/khadinakbar/x-tweet-scraper) for keyword/advanced search with your own cookies.
- **Liker and reactor identities** are not available in public cookieless data.
- Private/protected accounts return `UPSTREAM_FAILED` (not billed for tweet rows).

### vs. X Tweet Scraper

| Feature | This actor | X Tweet Scraper |
|---|---|---|
| Input | Profile handles/URLs | Keywords, hashtags, mentions, URLs |
| Cookies required | No | Yes (for keyword search) |
| Use case | Monitor specific accounts | Search for topics/brands |
| MCP-ready | Yes | Yes |

### MCP / Agent usage

Tool name: `apify--x-user-tweets-scraper`

```
Get the last 20 tweets from @openai and @anthropic, excluding retweets.
```

### Legal notice

This actor scrapes publicly available X/Twitter data via third-party provider APIs. Use in accordance with X's Terms of Service and applicable law. Do not use for mass surveillance, harassment, or building shadow profiles. The actor author is not responsible for how extracted data is used.

# Actor input Schema

## `usernames` (type: `array`):

List of X/Twitter handles (e.g. 'elonmusk', '@apify') or full profile URLs (e.g. 'https://x.com/openai'). One handle per item.

## `maxTweetsPerUser` (type: `integer`):

Maximum number of tweets to scrape per handle. Provider typically returns up to 100 recent tweets. Default: 50. Max: 500.

## `includeRetweets` (type: `boolean`):

Set to false to skip retweets (RT @...) and only return original tweets.

## `includeReplies` (type: `boolean`):

Set to false to skip reply tweets and only return top-level tweets.

## `startDate` (type: `string`):

Only include tweets on or after this date. Leave blank for no date filter. Example: 2026-01-01

## `endDate` (type: `string`):

Only include tweets on or before this date. Leave blank for no date filter. Example: 2026-08-19

## `minimumLikes` (type: `integer`):

Filter out tweets with fewer than this many likes. Set to 0 (default) to include all tweets regardless of likes.

## `minimumRetweets` (type: `integer`):

Filter out tweets with fewer than this many retweets. Set to 0 (default) to include all tweets.

## `providerOrder` (type: `string`):

Which data provider to try first. 'scrapecreators-first' (default) tries ScrapeCreators then SociaVault. 'sociavault-first' reverses the order.

## Actor input object example

```json
{
  "usernames": [
    "elonmusk",
    "apify",
    "https://x.com/openai"
  ],
  "maxTweetsPerUser": 50,
  "includeRetweets": true,
  "includeReplies": true,
  "startDate": "2026-01-01",
  "endDate": "2026-08-19",
  "minimumLikes": 0,
  "minimumRetweets": 0,
  "providerOrder": "scrapecreators-first"
}
```

# Actor output Schema

## `datasetItems` (type: `string`):

No description

## `outputSummary` (type: `string`):

No description

## `runSummary` (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 = {
    "usernames": [
        "apify",
        "openai"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("khadinakbar/x-user-tweets-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 = { "usernames": [
        "apify",
        "openai",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("khadinakbar/x-user-tweets-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 '{
  "usernames": [
    "apify",
    "openai"
  ]
}' |
apify call khadinakbar/x-user-tweets-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,khadinakbar/x-user-tweets-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/MEdYc0SYjvrxtFFKa/builds/ZRtmBpusIJka7zqRs/openapi.json
