# Twitter Profile Scraper - All X Tweets by Date Range (`delicious_zebu/advanced-x-twitter-profile-scraper`) Actor

Scrape all tweets from any Twitter (X) profile, not just the recent ones. Date-range search captures the full history, with rich per-tweet data: text, media, engagement metrics and author details. Fast, stable and API-based.

- **URL**: https://apify.com/delicious_zebu/advanced-x-twitter-profile-scraper.md
- **Developed by:** [Zebu Data](https://apify.com/delicious_zebu) (community)
- **Categories:** Social media, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 6,053 total users, 55 monthly users, 99.4% runs succeeded, 37 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $0.40 / 1,000 results

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

### What does Advanced X (Twitter) Profile Scraper do?

**Advanced X (Twitter) Profile Scraper** extracts **all tweets from any [X (Twitter)](https://x.com) profile** — not just the most recent ones. It works as an unofficial X (Twitter) API alternative: give it one or more profile URLs and a date range, and it returns clean, structured tweet data with **39 fields per tweet**, including text, media URLs, engagement metrics, and full author details.

Unlike simple timeline scrapers that only see a profile's latest posts, this Actor uses X's **advanced search** with date-range splitting to reach deep into a profile's history. It's fast, stable, and API-based (no slow browser rendering).

### Why use Advanced X (Twitter) Profile Scraper?

- 🗓️ **Go beyond the timeline** — advanced search reaches older tweets that a plain profile scrape misses.
- 🎯 **Precise date control** — set an exact `startDate` and `endDate`; scrape a single day or years of history.
- 🔪 **Deep-scrape splitting** — split the range by day, week, or month to defeat X's search limits and capture the fullest history.
- 🖼️ **Rich data** — text (full length, even 280+ character long posts), image URLs, direct MP4 video URLs, hashtags, mentions, links, and complete engagement stats.
- 👤 **Full author profile** — name, handle, bio, followers, following, verification, profile image, and more on every row.
- 🌐 **Language filter** — target tweets in any of 40+ languages.
- ⚡ **Fast & stable** — direct API access, not browser automation.
- 📤 **Ready to use** — export to JSON, CSV, Excel, XML, or HTML.

#### How this Actor compares

| Feature | This Actor | Typical profile scrapers |
| --- | --- | --- |
| Reaches full history | ✅ Advanced search + date splitting | ❌ Recent timeline only |
| Long-post full text (280+) | ✅ Complete text | ❌ Often truncated |
| Media URLs (images + video MP4) | ✅ Both | ⚠️ Images only or none |
| Author profile fields | ✅ 11 fields | ⚠️ Handle only |
| Method | ✅ Direct API | ❌ Slow browser |

### What data can you extract?

Each tweet is one dataset item with the following fields:

| Field | Type | Description |
| --- | --- | --- |
| `tweetId` | string | Unique tweet ID |
| `authorHandle` | string | Author's @handle |
| `authorName` | string | Author's display name |
| `tweetUrl` | string | Direct link to the tweet |
| `fullText` | string | Complete tweet text (untruncated for long posts) |
| `createdAt` | string | Post time (UTC) |
| `lang` | string | Tweet language code |
| `source` | string | Posting client (e.g. Twitter for iPhone) |
| `replyCount` | number | Number of replies |
| `repostCount` | number | Reposts (retweets + quotes, as shown on X) |
| `retweetCount` | number | Retweets only |
| `quoteCount` | number | Quote tweets only |
| `likeCount` | number | Number of likes |
| `viewCount` | number | Number of views |
| `bookmarkCount` | number | Number of bookmarks |
| `isReply` | boolean | Whether the tweet is a reply |
| `replyToHandle` | string | Handle being replied to |
| `replyToUrl` | string | Profile URL being replied to |
| `isQuote` | boolean | Whether the tweet quotes another |
| `quotedTweetUrl` | string | Link to the quoted tweet |
| `isRetweet` | boolean | Whether the tweet is a retweet |
| `isAd` | boolean | Whether the tweet is promoted |
| `mediaType` | string | `photo`, `video`, `animated_gif`, `mixed`, or empty |
| `imageUrls` | array | Image URLs |
| `videoUrls` | array | Direct MP4 video URLs |
| `hashtags` | array | Hashtags in the tweet |
| `mentions` | array | Handles mentioned |
| `externalUrls` | array | External links in the tweet |
| `authorId` | string | Author's numeric ID |
| `authorUrl` | string | Author's profile URL |
| `authorLocation` | string | Author's location |
| `authorVerified` | boolean | Blue/verified status |
| `authorFollowers` | number | Author's follower count |
| `authorFollowing` | number | Accounts the author follows |
| `authorTweetsCount` | number | Author's total tweets |
| `authorProfileImage` | string | Author's profile image URL |
| `authorBannerImage` | string | Author's profile banner image URL |
| `authorBio` | string | Author's bio |
| `authorWebsite` | string | Website link on the author's profile |
| `authorCreatedAt` | string | When the author's account was created |

### How to scrape an X (Twitter) profile

1. **Open the Actor** and click **Try for free**.
2. **Add profile URLs** — paste one or more X/Twitter profile URLs (e.g. `https://x.com/NASA`) into the **Account URLs** field.
3. **Set the date range** — choose your `startDate` and `endDate` (format `YYYY-MM-DD`).
4. **Pick a split mode** — use **By day** for the most thorough scrape, or **By week / By month** for faster runs over long ranges. Optionally set a **Language** filter.
5. **Click Start**, then download your tweets as JSON, CSV, or Excel from the **Storage** tab.

Prefer to watch? This video (under 4 minutes) does a real run: every post with 10,000+ likes from one popular account in the first half of 2025, from filling in the input form to exporting the results to Excel.

https://www.youtube.com/watch?v=aa0eMyG-4hg

### How much does it cost?

This Actor uses **pay-per-result** pricing — you pay only for the tweets you actually collect, with no monthly platform rental. Because it's API-based rather than browser-based, it runs cheaply and quickly.

You can try it **for free** on the Apify free plan — full features, up to 50 results per run (see below). To collect at scale with no limits, [upgrade your Apify plan](https://console.apify.com/billing). See the **Pricing** section on this page for the current per-1,000-results rate.

#### 💎 Free plan vs paid plan

The free plan gives you the **full feature set** (all filters, date-splitting, and every data field) — it's only capped on volume per run:

| Limit | Free plan | Paid plan |
| --- | --- | --- |
| Runs per day | Unlimited | Unlimited |
| Results per run | **50** (shared across all account URLs) | Unlimited |
| Features (filters, date-split, all fields) | Full | Full |
| Multiple accounts per run | Capped by the 50-results total | Unlimited |
| Date range / split mode | Unlimited | Unlimited |

To scrape more than 50 results per run, multiple accounts at full volume, or deep historical archives, [upgrade your plan](https://console.apify.com/billing).

### Input

Provide one or more X (Twitter) profile URLs and a date range. Configure everything visually on the **Input** tab, or via JSON.

| Field | Type | Description | Default |
| --- | --- | --- | --- |
| `accountUrls` | Array | X/Twitter profile URLs, e.g. `https://x.com/NASA` (free plan: 50 results total per run across all URLs) | *Required* |
| `startDate` | String | Start date (inclusive), `YYYY-MM-DD` | *Required* |
| `endDate` | String | End date (inclusive), `YYYY-MM-DD` | *Required* |
| `splitMode` | String | `day`, `week`, or `month`. `day` is the most thorough | `day` |
| `language` | String | Language filter (e.g. `en`, `ja`, `es`); `any` to disable | `any` |
| `maxCollections` | Integer | Max tweets per profile; `0` = unlimited (paid plan) | `0` |
| `keyword` | String | Only return the profile's tweets containing this keyword/phrase | *(empty)* |
| `excludeReplies` | Boolean | Skip replies; return only original tweets | `false` |
| `mediaFilter` | String | `any`, `images` (only tweets with images), or `videos` | `any` |
| `minLikes` | Integer | Only tweets with at least this many likes | `0` |
| `minRetweets` | Integer | Only tweets with at least this many reposts | `0` |
| `sort` | String | `Top` (most relevant) or `Latest` (most recent) | `Top` |

#### Input example (JSON)

```json
{
  "accountUrls": ["https://x.com/NASA", "https://x.com/elonmusk"],
  "startDate": "2025-08-01",
  "endDate": "2025-09-02",
  "splitMode": "week",
  "language": "any",
  "maxCollections": 0,
  "keyword": "",
  "excludeReplies": false,
  "mediaFilter": "any",
  "minLikes": 0,
  "minRetweets": 0,
  "sort": "Top"
}
```

### Output

Results are stored in the dataset. Each item is one tweet with full author and engagement details.

#### Output example (JSON)

```json
{
  "tweetId": "2064422103416238295",
  "authorHandle": "NASA",
  "authorName": "NASA",
  "tweetUrl": "https://x.com/NASA/status/2064422103416238295",
  "fullText": "Introducing Artemis III.\n\nFour astronauts. Three launches. Two dockings. One splashdown...",
  "createdAt": "2026-06-09 18:59:19+00:00",
  "lang": "en",
  "source": "Twitter Media Studio",
  "replyCount": 1026,
  "repostCount": 6362,
  "retweetCount": 5919,
  "quoteCount": 443,
  "likeCount": 28601,
  "viewCount": 1975399,
  "bookmarkCount": 1474,
  "isReply": false,
  "replyToHandle": "",          // populated only when isReply is true
  "replyToUrl": "",             // populated only when isReply is true
  "isQuote": false,
  "quotedTweetUrl": "",         // populated only when isQuote is true
  "isRetweet": false,
  "isAd": false,
  "mediaType": "video",         // "photo" | "video" | "animated_gif" | "mixed" | ""
  "imageUrls": ["https://pbs.twimg.com/media/HKZL32MXcAAEvuz.jpg"],
  "videoUrls": ["https://video.twimg.com/amplify_video/2064419379664617472/vid/avc1/1920x1080/6jURoc2QL1nJj1tc.mp4"],
  "hashtags": [],               // e.g. ["Artemis"]
  "mentions": [],               // e.g. ["Astro_Luca"]
  "externalUrls": [],           // links included in the tweet
  "authorId": "11348282",
  "authorUrl": "https://x.com/NASA",
  "authorLocation": "Pale Blue Dot",
  "authorVerified": true,
  "authorFollowers": 92154022,
  "authorFollowing": 119,
  "authorTweetsCount": 74184,
  "authorProfileImage": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_normal.jpg",
  "authorBannerImage": "https://pbs.twimg.com/profile_banners/11348282/1775567134",
  "authorBio": "Making the seemingly impossible, possible. ✨",
  "authorWebsite": "http://www.nasa.gov/",
  "authorCreatedAt": "Wed Dec 19 20:20:32 +0000 2007"
}
```

### Tips

- **Get the most complete history** — for prolific accounts, X's search won't return everything in a wide date range. Use `splitMode: "day"` (or `week`) to break the job into smaller queries and maximize coverage.
- **Control your result count** — set `maxCollections` to cap tweets per profile and keep costs predictable.
- **Scrape multiple profiles** — on a paid plan, add many URLs to `accountUrls` in a single run.
- **Automate it** — [schedule](https://docs.apify.com/platform/schedules) runs or connect the dataset to your app via the [Apify API](https://docs.apify.com/api/v2) and [integrations](https://docs.apify.com/platform/integrations) (Make, Zapier, Google Sheets, and more).

### Related Actors

Looking for a different way to scrape X (Twitter)? 😊

- [Ultimate X (Twitter) Advanced Search Scraper](https://apify.com/delicious_zebu/ultimate-x-twitter-advanced-search-scraper) — Harness the full power of X advanced search. Instead of one profile, find tweets from **all** users by keyword, date, engagement, language, and more.

### FAQ and support

#### Is it legal to scrape X (Twitter)?

Scraping publicly available data is generally legal. This Actor only collects data that any logged-out user can see. However, you are responsible for how you use the data.

Our Actors are ethical and do not extract any private user data, such as email addresses, gender, or location. They only extract what the user has chosen to share publicly. We therefore believe that our Actors, when used for ethical purposes by Apify users, are safe. However, you should be aware that your results could contain personal data. Personal data is protected by the GDPR in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers.

#### Why don't I get every single tweet in a large date range?

X's search limits how many results it returns per query. Use `splitMode: "day"` or `"week"` to break the range into smaller segments and capture far more.

#### Can I scrape more than one profile at once?

Yes — add multiple URLs to `accountUrls`. On the free plan a run still returns up to 50 results total (shared across those URLs); upgrade to a paid plan for unlimited results per account.

#### Need a custom field or a different scraper?

Reach out via the Apify support channels or leave feedback on the Actor's page. We're happy to help.

# Actor input Schema

## `accountUrls` (type: `array`):

List of X (Twitter) profile URLs to scrape tweets from. Example: https://x.com/NASA. Free plan: results are capped at 50 per run shared across all URLs (add more accounts on a paid plan).

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

Start date, inclusive. Only tweets posted on or after this date are scraped. Format: YYYY-MM-DD.

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

End date, inclusive. Only tweets posted on or before this date are scraped. Format: YYYY-MM-DD.

## `splitMode` (type: `string`):

How to split the date range into search segments. X search hides older tweets in wide ranges, so smaller segments capture more. 'By day' is the most thorough (but uses more results); 'By week' or 'By month' are faster for long ranges.

## `language` (type: `string`):

Only return tweets in this language. Choose 'Any language' to disable filtering. Matches X's advanced-search language list.

## `maxCollections` (type: `integer`):

Maximum number of tweets to collect per profile. Set to 0 for unlimited (paid plan). Free plan runs are capped at 50 results total per run regardless of this value.

## `keyword` (type: `string`):

Only return the profile's tweets that contain this keyword or phrase. Leave empty to get all tweets.

## `excludeReplies` (type: `boolean`):

Turn on to skip replies and return only the profile's original tweets.

## `mediaFilter` (type: `string`):

Only return tweets that contain the selected media type.

## `minLikes` (type: `integer`):

Only return tweets with at least this many likes. 0 means no minimum.

## `minRetweets` (type: `integer`):

Only return tweets with at least this many retweets. 0 means no minimum.

## `sort` (type: `string`):

How X ranks the results: 'Top' (most relevant) or 'Latest' (most recent first).

## Actor input object example

```json
{
  "accountUrls": [
    "https://x.com/elonmusk",
    "https://x.com/NASA"
  ],
  "startDate": "2025-09-01",
  "endDate": "2025-09-05",
  "splitMode": "day",
  "language": "any",
  "maxCollections": 0,
  "keyword": "",
  "excludeReplies": false,
  "mediaFilter": "any",
  "minLikes": 0,
  "minRetweets": 0,
  "sort": "Top"
}
```

# Actor output Schema

## `overview` (type: `string`):

Table view of scraped tweets using the 'overview' view from dataset_schema.json.

## `rawResults` (type: `string`):

All tweet items from the default dataset without a specific view.

# 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 = {
    "accountUrls": [
        "https://x.com/elonmusk",
        "https://x.com/NASA"
    ],
    "startDate": "2025-09-01",
    "endDate": "2025-09-05",
    "splitMode": "day",
    "language": "any",
    "maxCollections": 0,
    "keyword": "",
    "minLikes": 0,
    "minRetweets": 0
};

// Run the Actor and wait for it to finish
const run = await client.actor("delicious_zebu/advanced-x-twitter-profile-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 = {
    "accountUrls": [
        "https://x.com/elonmusk",
        "https://x.com/NASA",
    ],
    "startDate": "2025-09-01",
    "endDate": "2025-09-05",
    "splitMode": "day",
    "language": "any",
    "maxCollections": 0,
    "keyword": "",
    "minLikes": 0,
    "minRetweets": 0,
}

# Run the Actor and wait for it to finish
run = client.actor("delicious_zebu/advanced-x-twitter-profile-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 '{
  "accountUrls": [
    "https://x.com/elonmusk",
    "https://x.com/NASA"
  ],
  "startDate": "2025-09-01",
  "endDate": "2025-09-05",
  "splitMode": "day",
  "language": "any",
  "maxCollections": 0,
  "keyword": "",
  "minLikes": 0,
  "minRetweets": 0
}' |
apify call delicious_zebu/advanced-x-twitter-profile-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,delicious_zebu/advanced-x-twitter-profile-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/fInL1MhC8Orp6sNJw/builds/jEWe7FpukRSO9Zxgf/openapi.json
