# Twitter Scraper - Cheapest X Tweets & Profiles API (`busayoroyalty08/x-twitter-scraper-api`) Actor

Cheapest Twitter (X) scraper at $0.14 per 1,000 tweets. Scrape tweets, replies, likes, retweets, views and profile data by username or tweet URL. X data API with no Twitter API key needed. Export tweets to JSON, CSV or Excel.

- **URL**: https://apify.com/busayoroyalty08/x-twitter-scraper-api.md
- **Developed by:** [DataLeadsPRO](https://apify.com/busayoroyalty08) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.14 / 1,000 tweets

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Scraper API – Tweets, Search & Profiles

Scrape X/Twitter tweets, search results, profiles, threads, media and engagement data. Search by keyword, URL or username and export structured JSON/CSV through Apify API, Python, JavaScript, OpenAPI or MCP.

> **Pricing:** from **$0.0001/1,000 tweets** - and **no charge for empty results**.
> You only pay for successfully delivered results. Failed, empty, duplicate and filtered results are free.

### What data can it extract?

Depending on the selected input, results can include:

- `tweetId` - Unique tweet identifier.
- `text` - Tweet text content.
- `username` - Display name of the author.
- `handle` - Author handle without the @ symbol.
- `createdAt` - Publication date in ISO 8601 format.
- `likes` - Number of likes.
- `retweets` - Number of reposts.
- `replies` - Number of replies.
- `views` - Number of views or plays.
- `mediaUrls` - URLs of attached photos or videos.
- `url` - Source URL of the item.

Unavailable fields are returned as `null` instead of fabricated values.

### Example output

```json
{
  "tweetId": "1894123456789012345",
  "text": "Example tweet text with a link https://example.com",
  "username": "Example User",
  "handle": "example_user",
  "createdAt": "2026-09-18T12:00:00.000Z",
  "likes": 1234,
  "retweets": 87,
  "replies": 15,
  "views": 45210,
  "mediaUrls": [
    "https://pbs.twimg.com/media/example.jpg"
  ],
  "url": "https://x.com/example_user/status/1894123456789012345"
}
```

### How to use X Tweet Scraper API

1. Click **Try for free** on the Apify Store page.
2. Add URLs, usernames or search terms.
3. Set **Maximum results** to control spending, then run.
4. Export as JSON, CSV, Excel, or consume via API.

### Usage

#### Python (Apify Client)

```python
from apify_client import ApifyClient

client = ApifyClient('YOUR_API_TOKEN')
run = client.actor('DataLeadsPRO/x-twitter-scraper-api').call(run_input={
    'searchTerms': ['openai']
})
for item in client.dataset(run['defaultDatasetId']).iterate_items():
    print(item)
```

#### JavaScript

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const run = await client.actor('DataLeadsPRO/x-twitter-scraper-api').call({
    'searchTerms': ['openai']
});
const { items } = await client.dataset(run.defaultDatasetId).list();
console.log(items);
```

#### REST / OpenAPI

```bash
curl -X POST 'https://api.apify.com/v2/acts/DataLeadsPRO~x-twitter-scraper-api/runs?token=YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{ "searchTerms": ["openai"] }'
```

This Actor ships an OpenAPI 3.1 specification (`openapi.yaml`) and can be exposed through MCP for AI agent integrations.

### X API alternative

This X scraper API works without developer account approval, API keys from X, or official API subscriptions. Teams use it as a practical X data API for dashboards, alerts and AI agents that need live public tweet data on demand.

### Why DataLeadsPRO?

- Transparent per-result pricing with **no charge for empty results**
- Structured, documented output fields - no fabricated data
- Python, JavaScript, REST, CLI, OpenAPI and MCP integration examples
- Fast, maintained and monitored infrastructure

### Common use cases

- **Market research** - track public content, creators and engagement.
- **Competitor monitoring** - monitor public accounts, posts, videos or search results.
- **AI and LLM datasets** - feed structured public data into RAG systems, agents and analytics pipelines.
- **Lead and creator discovery** - build structured public datasets for research and outreach qualification.
- **Social listening** - monitor public conversations around brands, products or topics.

### Frequently asked questions

**How much does tweets scraping cost?**

From $0.0001 per 1,000 successfully delivered results on the FREE tier, with Bronze, Silver and Gold volume tiers below that.

**Do empty searches cost money?**

No result event is charged when no successful result is delivered.

**Can I use this through an API?**

Yes - REST, Python, JavaScript, CLI, OpenAPI or MCP.

**Can I export the results?**

Yes. Apify datasets support JSON, CSV, Excel, XML and other formats.

**Can I schedule this scraper?**

Yes. Use Apify schedules to rerun saved inputs automatically.

### Related actors

- [DataLeadsPRO/x-profile-scraper](https://github.com/DataLeadsPRO/x-profile-scraper)
- [DataLeadsPRO/x-scraper-unlimited](https://github.com/DataLeadsPRO/x-scraper-unlimited)
- [DataLeadsPRO/x-replies-scraper-api](https://github.com/DataLeadsPRO/x-replies-scraper-api)
- [DataLeadsPRO/x-list-scraper-api](https://github.com/DataLeadsPRO/x-list-scraper-api)
- [DataLeadsPRO/instagram-scraper-api](https://github.com/DataLeadsPRO/instagram-scraper-api)
- [DataLeadsPRO/instagram-data-api](https://github.com/DataLeadsPRO/instagram-data-api)

### Responsible use

This Actor is intended for extracting publicly available information. Users are responsible for complying with applicable laws, platform terms and data-protection requirements. This Actor is an independent tool and is not affiliated with or endorsed by the platform owner.

### License

MIT - see [LICENSE](LICENSE).

# Actor input Schema

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

Add public X (Twitter) URLs to scrape.

## `searchTerms` (type: `array`):

Keywords, hashtags or search queries.

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

Enter usernames without the @ symbol.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://x.com/NASA/status/1771935722398331073"
    }
  ],
  "searchTerms": [
    "openai"
  ]
}
```

# Actor output Schema

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

Successfully extracted and billable results.

## `diagnostics` (type: `string`):

Failed, unavailable, duplicate or rejected inputs. These records are not billed as results.

# 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 = {
    "startUrls": [
        {
            "url": "https://x.com/NASA/status/1771935722398331073"
        }
    ],
    "searchTerms": [
        "openai"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("busayoroyalty08/x-twitter-scraper-api").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 = {
    "startUrls": [{ "url": "https://x.com/NASA/status/1771935722398331073" }],
    "searchTerms": ["openai"],
}

# Run the Actor and wait for it to finish
run = client.actor("busayoroyalty08/x-twitter-scraper-api").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 '{
  "startUrls": [
    {
      "url": "https://x.com/NASA/status/1771935722398331073"
    }
  ],
  "searchTerms": [
    "openai"
  ]
}' |
apify call busayoroyalty08/x-twitter-scraper-api --silent --output-dataset

```

## MCP server setup

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

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/xaZ7TNfUMXbZpZznz/builds/hkXmzeUXNsFoN5Xy6/openapi.json
