# X Twitter Public Posts Scraper (`zinin/x-public-posts-scraper`) Actor

Scrape public X Twitter posts by URL: text, author, date, likes, conversation counts, and media links without login.

- **URL**: https://apify.com/zinin/x-public-posts-scraper.md
- **Developed by:** [Tim Zinin](https://apify.com/zinin) (community)
- **Categories:** Social media, Marketing
- **Features:** Limited permissions
- **Stats:** 4 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $0.35 / 1,000 public x post delivereds

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 Public Posts Scraper

Collect current public details for an exact list of X post URLs. Give the actor 1–50 `https://x.com/{username}/status/{numeric-id}` URLs and receive verified post text, author identity, creation time, favorite count, conversation count, and optional source-visible media. It is intended for researchers, editorial teams, and brand analysts who already know the posts they need and want a repeatable snapshot without an X login.

```json
{"postUrls":["https://x.com/NASA/status/2041915225776009742"],"maxItems":1}
```

The result-only price is **$0.0005 per useful post**, with 10/20/30% tier prices of $0.00045, $0.0004, and $0.00035. There is no start or diagnostic fee. Set a positive Apify Max total charge to bound result fees; a positive cap below one result price stops before any source request. API value `0` can mean an account default rather than zero spend.

```json
{"postId":"2041915225776009742","postURL":"https://x.com/NASA/status/2041915225776009742","authorUsername":"NASA","text":"Experience the magic of our Moon mission wherever you go! ✨…","createdAt":"2026-04-08T16:25:01.000Z","favoriteCount":102329,"conversationCount":1781,"media":[{"type":"photo","url":"https://pbs.twimg.com/media/HFZXEzyXMAQgYFy.jpg"}],"sourceURL":"https://cdn.syndication.twimg.com/tweet-result?id=2041915225776009742&lang=en&token=0"}
```

Each input URL is tied to the returned numeric ID and author. Tombstones, private posts, mismatched authors or IDs, malformed responses, and rows without useful text are not delivered. The actor does not search X, discover posts, traverse feeds, paginate profiles, or provide a historical archive. It does not invent repost or view counts.

![Exact X post URLs become verified public rows](https://api.apify.com/v2/key-value-stores/IwI7VoxszQjT6v69X/records/x-public-posts-scraper-0e8551a92708308a-readme-hero.webp?signature=B7BM65B8QfQe1DJpcD8K)

### Coverage and repeat runs

Each run fetches the first-party public syndication response again. Compare `favoriteCount` and `conversationCount` with a previous export when you need a later snapshot. `source_failed` means every attempted URL failed; `empty` means valid source responses contained no deliverable public post. Partial coverage and budget stops are explicit in the free OUTPUT record.

![Input to source verification to Dataset](https://api.apify.com/v2/key-value-stores/IwI7VoxszQjT6v69X/records/x-public-posts-scraper-97f54b275b0f98e4-readme-workflow.webp?signature=19ICR399CjTUZqcx2jeYF)

Download Dataset rows as JSON or CSV. The source body is capped at 2 MiB per post, redirects are rejected, and one 110-second deadline covers startup, source work, delivery, OUTPUT, and exit.

# Actor input Schema

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

Exact HTTPS x.com/{username}/status/{numeric-id} URLs without query strings or fragments.

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

Maximum useful post rows across the supplied URLs.

## Actor input object example

```json
{
  "postUrls": [
    "https://x.com/NASA/status/2041915225776009742"
  ],
  "maxItems": 50
}
```

# Actor output Schema

## `results` (type: `string`):

One verified public X post per useful row.

## `summary` (type: `string`):

Bounded source coverage, outcome, and confirmed delivery snapshot.

# 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 = {
    "postUrls": [
        "https://x.com/NASA/status/2041915225776009742"
    ],
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("zinin/x-public-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 = {
    "postUrls": ["https://x.com/NASA/status/2041915225776009742"],
    "maxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("zinin/x-public-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 '{
  "postUrls": [
    "https://x.com/NASA/status/2041915225776009742"
  ],
  "maxItems": 50
}' |
apify call zinin/x-public-posts-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,zinin/x-public-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/5lOLCvAJ29dCameUZ/builds/g4Xy58CouYYgeBhTY/openapi.json
