# X (Twitter) Tweet Scraper | No Login | Pay-Per-Tweet (`gopalakrishnan/twitter-tweets`) Actor

Scrape tweets from X/Twitter handle timelines and single tweet URLs or IDs. No login, no cookies, no API key. Fair billing: you only pay for unique tweets delivered.

- **URL**: https://apify.com/gopalakrishnan/twitter-tweets.md
- **Developed by:** [Gopalakrishnan](https://apify.com/gopalakrishnan) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.13 / 1,000 tweets scrapeds

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 | No Login | Pay-Per-Tweet

Scrape tweets from **X/Twitter profile timelines** and **single tweets by URL or ID**. No X login, no cookies, no API key, no third-party API. You pay per unique tweet delivered.

### What it does

- **Handle timelines**: the newest tweets of any public account, with engagement counts, media, quotes and retweets.
- **Single tweets**: paste tweet URLs or IDs and get the full tweet record.
- Plain HTTP, small footprint: it runs at 256 MB and finishes about 1,000 tweets per minute per handle.

### Limits (stated honestly)

- **Depth: about 750 tweets per handle.** Without a login, X returns roughly the newest 750–800 tweets of a timeline and then stops. The run report marks such handles `depth_cap_reached`. Older tweets need a logged-in account, which this Actor does not use.
- **Not supported** (X requires a login): keyword search, hashtag pages, lists, communities, followers/following, reply threads. If you pass such input you get a free `unsupported_input` row, not a silent empty run.
- Protected accounts, suspended accounts and deleted tweets return no data (and no charge).
- `includeReplies: false` and `includeRetweets: false` filter after fetching, so the result can be smaller than the depth limit.

### Use cases

Brand and competitor monitoring · research datasets · engagement tracking · AI/RAG corpora · archiving an account's recent posts · enriching a list of tweet URLs with live counts.

### Input

```json
{
    "twitterHandles": ["NASA", "https://x.com/apify"],
    "maxItems": 500,
    "maxItemsPerTarget": 250,
    "start": "2026-10-01",
    "includeReplies": false
}
```

Single tweets:

```json
{ "startUrls": [{ "url": "https://x.com/NASA/status/1519781379172495360" }], "tweetIds": ["1519781379172495360"] }
```

| Field                               | Meaning                                                                   |
| ----------------------------------- | ------------------------------------------------------------------------- |
| `twitterHandles`                    | Handles or profile URLs                                                   |
| `startUrls`                         | Profile and/or tweet URLs (auto-detected)                                 |
| `tweetIds`                          | Tweet IDs or URLs                                                         |
| `maxItems`                          | Total tweet limit across all targets                                      |
| `maxItemsPerTarget`                 | Limit per handle                                                          |
| `start` / `end`                     | Date range (UTC). Scrolling stops once the timeline is older than `start` |
| `includeRetweets`, `includeReplies` | Filters                                                                   |

#### Migrating from another X scraper

Paste your old input unchanged. These names are accepted: `twitterHandles`, `startUrls`, `tweetIds`, `maxItems` (apidojo); `from`, `since`, `until`, `max_posts` (kaito, danek); `profileUrls`, `usernames`, `maxItemsPerTarget` (xquik). Output field names follow apidojo's (`id, url, twitterUrl, text, createdAt, retweetCount, replyCount, likeCount, quoteCount, viewCount, bookmarkCount, isRetweet, isQuote, isReply, lang, author, media, entities, quotedTweet, retweetedTweet, conversationId, inReplyToId`), so downstream code keeps working. Search inputs (`searchTerms`, `twitterContent`) are not supported; see Limits.

### Output

```json
{
    "type": "tweet",
    "id": "2109661698982305935",
    "url": "https://x.com/apify/status/2109661698982305935",
    "text": "Training makes a great AI agent. ...",
    "createdAt": "Mon Oct 12 15:05:19 +0000 2026",
    "likeCount": 42,
    "retweetCount": 6,
    "replyCount": 2,
    "quoteCount": 2,
    "viewCount": 166244,
    "bookmarkCount": 4,
    "totalEngagement": 56,
    "engagementRate": 0.000337,
    "isRetweet": false,
    "isQuote": false,
    "isReply": false,
    "isPinned": true,
    "author": { "userName": "apify", "name": "Apify", "id": "3510729917", "followers": 21775, "isBlueVerified": false },
    "mediaUrls": ["https://pbs.twimg.com/..."],
    "entities": { "hashtags": [], "urls": [], "userMentions": [] },
    "quotedTweet": null,
    "retweetedTweet": null
}
```

`viewCount` is `null` for tweets that X shows no view count for (mostly old tweets). `quotedTweet` and `retweetedTweet` hold the nested tweet, one level deep.

Export as JSON, CSV, Excel or HTML, or read it through the Apify API.

#### Run report

Every run saves `RUN_REPORT` in the key-value store: per target `status` (`ok`, `not_found`, `protected`, `depth_cap_reached`, `error`), `stopCause` (`end_of_timeline`, `max_items`, `max_items_per_target`, `start_date`, `depth_cap_reached`, `charge_limit`) and the number of tweets delivered. Use it to tell "account has no more tweets" from "hit the guest depth limit".

### Pricing

Pay per event: a small start fee plus a price per **unique tweet delivered** (see the Pricing tab for current prices; they depend on your Apify plan).

#### Fair billing

You are **not** charged for: handles or tweets that don't exist, protected accounts, duplicate tweets, unsupported-input status rows, or tweets already delivered before a restart/migration. The run stops at your maximum-cost limit.

### Use from code, AI agents, n8n

**cURL**

```bash
curl -X POST "https://api.apify.com/v2/acts/YOUR_USERNAME~twitter-tweets/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"twitterHandles":["NASA"],"maxItems":50}'
```

**Python**

```python
from apify_client import ApifyClient

client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("YOUR_USERNAME/twitter-tweets").call(run_input={"twitterHandles": ["NASA"], "maxItems": 50})
for tweet in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(tweet["createdAt"], tweet["text"])
```

**AI agents / MCP**: add this Actor through the [Apify MCP server](https://mcp.apify.com) and call it with the same JSON input. **n8n / Make / Zapier**: use the Apify node/module, "Run Actor", then "Get dataset items".

### FAQ

**Do I need an X API key or login?** No.

**Why did I get fewer tweets than `maxItems`?** Either the account has fewer tweets, you hit the ~750-tweet guest depth limit, or your filters removed some. Check `RUN_REPORT`.

**Can I scrape search results or replies?** No. X requires a login for both.

**Why zero results?** Check the handle spelling, whether the account is protected or suspended, and `RUN_REPORT`.

**Related:** [twitter-user](https://apify.com/) scrapes X profile details (followers, bio, verification) for a list of handles.

# Actor input Schema

## `twitterHandles` (type: `array`):

Handles (`NASA`, `@NASA`) or profile URLs. Returns the newest tweets of each account, up to the guest-access depth limit (about 750 tweets per account).

## `startUrls` (type: `array`):

Profile URLs (`https://x.com/NASA`) and/or tweet URLs (`https://x.com/NASA/status/123...`). The type is detected automatically. Search, hashtag and list URLs are not supported (they need an X login).

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

Individual tweets to fetch, as numeric IDs or tweet URLs.

## `maxItems` (type: `integer`):

Stop after this many tweets in total across all targets. Leave empty for no limit.

## `maxItemsPerTarget` (type: `integer`):

Stop each handle after this many tweets. Leave empty for no per-handle limit.

## `start` (type: `string`):

Only tweets on or after this date (`2026-01-31` or ISO datetime, UTC). Scrolling stops once the timeline gets older than this.

## `end` (type: `string`):

Only tweets before the end of this date (`2026-02-28` or ISO datetime, UTC).

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

Keep retweets in the results. The original tweet is in `retweetedTweet`.

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

Keep the account's replies that appear on its timeline. Filtering happens after fetching, so fewer than the depth limit may remain.

## `maxConcurrency` (type: `integer`):

Handles processed in parallel. The default suits most runs.

## `proxyConfiguration` (type: `object`):

Apify Proxy is required for X. The default datacenter proxy works.

## Actor input object example

```json
{
  "twitterHandles": [
    "NASA"
  ],
  "maxItems": 100,
  "includeRetweets": true,
  "includeReplies": true,
  "maxConcurrency": 6,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `tweets` (type: `string`):

No description

## `runReport` (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 = {
    "twitterHandles": [
        "NASA"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("gopalakrishnan/twitter-tweets").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 = { "twitterHandles": ["NASA"] }

# Run the Actor and wait for it to finish
run = client.actor("gopalakrishnan/twitter-tweets").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 '{
  "twitterHandles": [
    "NASA"
  ]
}' |
apify call gopalakrishnan/twitter-tweets --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gopalakrishnan/twitter-tweets"
        }
    }
}
```

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/jg49vFx5a731lLR3D/builds/Ijgl2aOZAsiCeDRs3/openapi.json
