# X Posts Scraper & API: Twitter Profile Tweets & Post by Link (`s_actors/x-posts-scraper`) Actor

Scrape the tweets of any X (Twitter) profile, about the latest 800 per account, or any post by link, no login or cookies: full text, likes, reposts, replies, views, media with video files, links, hashtags, mentions. Date range, filters and new-post alerts. Search is not included.

- **URL**: https://apify.com/s_actors/x-posts-scraper.md
- **Developed by:** [Superior Actors](https://apify.com/s_actors) (community)
- **Categories:** Social media, Marketing, AI
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.09 / 1,000 posts

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 Posts Scraper & API: Twitter Profile Tweets & Post by Link

Scrape the **tweets of any public X (Twitter) profile**, newest first, about the latest 800 per account, and **any single post by its link**. Every post comes with its **full text** (long posts too), **likes, reposts, replies, quotes, bookmarks and views**, **photos and video files**, links, hashtags, mentions, language, the post a reply answers, and the original of a repost or quote.

```json
{ "profiles": ["nasa", "https://x.com/apify"], "maxPostsPerProfile": 200, "since": "7 days ago" }
```

No X account, no cookies, no browser, no API key. Schedule it every hour with **Only new posts** to get the new posts of the accounts you follow as alerts. Search by keyword and the replies tab are not part of this Actor.

#### What you get

Real example, 1 November 2026:

| account | date | post | likes | reposts | replies | views |
|---|---|---|---|---|---|---|
| @NASA | 2026-10-30 | MAX POWER, America's newest aerospace expo and air show, is just a week away! ... (photo) | 1,542 | 187 | 82 | 365,668 |
| @jack (by link) | 2006-03-21 | just setting up my twttr | 308,643 | 124,538 | 18,116 | not shown for old posts |

| Field | Description |
|---|---|
| `postId`, `url`, `text`, `createdAt`, `lang` | The post, its link, full text (links expanded), time (UTC), language |
| `author`, `authorName`, `authorId`, `authorFollowers`, `authorVerified` | Who wrote it |
| `likes`, `reposts`, `replies`, `quotes`, `bookmarks`, `views` | Counts at the time of the run |
| `media` | Photos, videos and GIFs: `[{type, url, videoUrl, durationMs, altText}]`, the best video quality |
| `links`, `hashtags`, `mentions` | Links, hashtags and @mentions of the post |
| `isReply`, `inReplyToPostId`, `inReplyToUser`, `conversationId` | Replies and threads |
| `isRepost`, `repostedPost`, `isQuote`, `quotedPost`, `quotedPostId` | Reposts and quotes with the original post in full |
| `isPinned`, `source`, `isSensitive`, `profile`, `scrapedAt` | Pinned post, the app it was sent from, sensitive flag, the account asked for, run time |

#### How it works

1. Add **X accounts**, one per line: a handle (`nasa`, `@nasa`) or a link (`https://x.com/nasa`). And/or add **posts by link** (`https://x.com/<name>/status/<number>`)
2. Set **Posts per account** (up to what X shows, about 800), and optionally **Posts since / until**, **Only posts with photos or videos**, **Minimum likes**, **Skip replies**, **Include reposts**
3. Run, then download the dataset as CSV, Excel, JSON or HTML. Tabs: **Posts**, **Posts with media and links**, **Not found**

#### Why this Actor

| | |
|---|---|
| 📜 **Full text** | Long posts in full, links expanded instead of `t.co` |
| 🎬 **Media files** | Photo links and the best-quality video file of every post |
| 📊 **Views and bookmarks** | Not only likes and reposts |
| 🔔 **New-post alerts** | **Only new posts** returns just what an account posted since the previous run |
| 🗓️ **Date range** | Stops reading as soon as it reaches your start date: you pay only for posts you asked for |
| 🔁 **Reposts and quotes with originals** | The reposted or quoted post comes in full inside the row |
| 💰 **$0.11 per 1,000 posts** | No subscription, no X API plan |

#### Get new posts every hour

1. Add the accounts, turn on **Only new posts**, give the task a **Monitor name**
2. Save it as a task and add a schedule, e.g. every hour
3. The **first run** returns the latest posts as a baseline. **Every later run** returns only newer posts: send them to [Google Sheets](https://apify.com/s_actors/google-sheets-import-export), Slack or email with an integration

The memory is kept in your account (key-value store `x-posts-state`). Use a different **Monitor name** for each task.

#### Pricing

Pay per post in the results, no subscription needed. Apify Scale and Business plans pay less:

| Event | Free and Starter plans | Scale plan | Business plan |
|---|---|---|---|
| Run start | $0.001 | $0.001 | $0.001 |
| Post (one row) | $0.00011 | $0.000099 | $0.000088 |

| Task | Cost |
|---|---|
| Last 100 posts of one account | ~$0.012 |
| About 780 posts of one account (the most X shows) | ~$0.09 |
| Hourly alerts for 20 accounts (about 5 new posts an hour) | ~$8.5 per month |

Posts left out by your filters, posts already seen with **Only new posts** and accounts that do not exist are not charged.

#### FAQ

**Can it search tweets by keyword or hashtag?** No. X shows search results to logged-in users only, and this Actor does not log in. It reads the posts of the accounts you give it and posts by link.

**How far back can it go?** X shows about the latest 800 posts of an account (for @nasa that is five months). The Actor reads until your limit, your start date or the end of what X shows. For a longer history, run it every day or hour with **Only new posts** and keep the results.

**Are replies included?** The profile timeline contains the account's own posts, reposts and its own threads. Replies to other people's posts are on the replies tab, which X shows to logged-in users only.

**Do I need an X (Twitter) account?** No.

**Private accounts?** Their posts are not public: you get an error row, free of charge.

#### Use with the API and AI agents

Run it via the [Apify API](https://docs.apify.com/api/v2) from Python, Node.js or any HTTP client as a tweet scraper API, or connect it to Claude, ChatGPT and other AI agents through the [Apify MCP server](https://mcp.apify.com): "Summarise what @nasa posted this week and which posts got the most views."

#### Other X (Twitter) tools

| Tool | What it does |
|---|---|
| [Twitter (X) Trends Scraper](https://apify.com/s_actors/x-trends-scraper) | Trending topics and hashtags in 467 locations |
| [Google Sheets Import & Export](https://apify.com/s_actors/google-sheets-import-export) | Send the posts to a Google Sheet |

#### Is it legal?

The Actor collects public posts that X shows to any visitor without logging in. Respect the privacy laws that apply to you (GDPR and similar) when you store and use personal data, and the terms of the platform. Do not use the results for spam or harassment.

# Actor input Schema

## `profiles` (type: `array`):

Accounts whose posts to scrape, newest first, one per line: a handle (nasa, @nasa) or a profile link (https://x.com/nasa).

## `maxPostsPerProfile` (type: `integer`):

Stop after this many posts of each account (reposts and the pinned post count). X shows about the latest 800 posts of an account.

## `postUrls` (type: `array`):

Single posts, one per line: https://x.com/<name>/status/<number> or the post number.

## `since` (type: `string`):

Only posts from this date on (UTC): YYYY-MM-DD, "yesterday" or "7 days ago". The pinned post is returned whatever its date.

## `until` (type: `string`):

Only posts up to and including this date (UTC): YYYY-MM-DD or "yesterday".

## `includeReposts` (type: `boolean`):

Reposts of other accounts appear in the profile. Turn off to get the account's own posts only.

## `skipReplies` (type: `boolean`):

Leave out posts that reply to another post.

## `onlyWithMedia` (type: `boolean`):

Keep only posts that have a photo, video or GIF.

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

Keep only posts with at least this many likes.

## `onlyNew` (type: `boolean`):

Return only the posts published since the previous run with the same monitor name (the first run returns the latest posts as a baseline). Schedule the Actor every hour to get new posts of the accounts as alerts. Already seen posts are free.

## `monitorName` (type: `string`):

Keeps the memory of new posts apart for different schedules. It lives in the store x-posts-state of your account.

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

Accounts read at the same time.

## `debugLog` (type: `boolean`):

Log every request retry.

## Actor input object example

```json
{
  "profiles": [
    "nasa"
  ],
  "maxPostsPerProfile": 100,
  "includeReposts": true,
  "skipReplies": false,
  "onlyWithMedia": false,
  "minLikes": 0,
  "onlyNew": false,
  "maxConcurrency": 4,
  "debugLog": false
}
```

# Actor output Schema

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

Date, text, likes, reposts, replies and views of every post.

## `details` (type: `string`):

Media files, links, hashtags and mentions.

## `all` (type: `string`):

Every field, with reposted and quoted posts.

# 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 = {
    "profiles": [
        "nasa"
    ],
    "maxPostsPerProfile": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("s_actors/x-posts-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 = {
    "profiles": ["nasa"],
    "maxPostsPerProfile": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("s_actors/x-posts-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 '{
  "profiles": [
    "nasa"
  ],
  "maxPostsPerProfile": 100
}' |
apify call s_actors/x-posts-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,s_actors/x-posts-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/rDWBoljJqXd9vF4Mr/builds/O6APDQvnHGvezfxXj/openapi.json
