# X (Twitter) Account Tweets Scraper (`axery/x-account-tweets-scraper`) Actor

Fast, reliable, HTTP-only scraper for public X (Twitter) accounts. Extract recent tweets, metrics (likes, reposts, replies, views), text, media, verification status, and timestamps without login or browser overhead.

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

## Pricing

from $1.00 / 1,000 tweet scrapeds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## 🐦 X (Twitter) Account Tweets Scraper

Extract recent tweets, engagement metrics, media, and author details from any public X (Twitter) account — **without login credentials, API keys, or browser overhead**.

***

### ⚡ Key Features

- **🚀 Ultra-Fast & Lightweight:** Built using high-performance HTTP-only requests (impersonating modern browsers). Consumes minimal memory (runs smoothly on 256 MB).
- **🔒 No Login / No Cookies Needed:** Zero risk of account suspension. Extract public data safely.
- **📊 Comprehensive Metrics:** Full engagement analytics including Likes, Reposts (Retweets), Replies, and Views (both exact counts and human-formatted strings like `4.5K`, `1.2M`).
- **🖼️ Rich Media Extraction:** Extracts attached images and thumbnail URLs.
- **🛡️ Built for Automation:** Integrates seamlessly into your marketing pipelines, sentiment analysis models, competitor tracking, and social monitoring workflows.

***

### 📥 Input Options

| Parameter | Type | Default | Description |
|---|---|---|---|
| `handles` | Array of Strings | `["elonmusk"]` | Target handles or profile URLs (e.g. `elonmusk`, `https://x.com/OpenAI`). |
| `maxItems` | Integer | `50` | Maximum number of total tweets to collect across the specified accounts. |
| `proxyConfiguration` | Object | `{ "useApifyProxy": false }` | Optional proxy settings. Recommended for high-frequency runs. |

#### Sample Input

```json
{
  "handles": [
    "elonmusk",
    "https://x.com/OpenAI"
  ],
  "maxItems": 20
}
```

***

### 📤 Output Dataset Format

Every scraped tweet is formatted as a clean, standardized JSON record:

```json
{
  "id": "2098628727164846490",
  "url": "https://x.com/elonmusk/status/2098628727164846490",
  "authorHandle": "elonmusk",
  "authorName": "Elon Musk",
  "authorAvatar": "https://pbs.twimg.com/profile_images/2053244804520427520/m8mdWZCG_normal.jpg",
  "isVerified": true,
  "isRetweet": false,
  "text": "Starlink NEWS: 254 Starlink kits were handed over to bring internet to villages, schools & hospitals across Vietnam.",
  "createdAtFormatted": "1h",
  "media": [
    "https://pbs.twimg.com/amplify_video_thumb/2098417601160622080/img/c1xGP6CV0EUAP_UP?format=webp&name=medium"
  ],
  "replyCount": 692,
  "retweetCount": 528,
  "likeCount": 4500,
  "viewCount": 930000,
  "replyCountFormatted": "692",
  "retweetCountFormatted": "528",
  "likeCountFormatted": "4.5K",
  "viewCountFormatted": "930K",
  "scrapedAt": "2026-09-12T06:03:38.123456Z"
}
```

***

### 💡 Practical Use Cases

1. **Competitor & Brand Monitoring:** Track tweets and announcements from leading brands, executives, and influencers in real-time.
2. **Sentiment & Social NLP Analysis:** Feed recent posts into LLMs or NLP pipelines for trend detection, PR tracking, and market research.
3. **Automated Content Aggregation:** Populate social media dashboards, newsletters, or internal Slack channels with fresh tweets.
4. **Influencer Discovery & Engagement Audits:** Compare engagement ratios (Likes / Views / Reposts) across target accounts.

***

### ⚖️ Pricing & Monetization

Pay-per-event pricing guarantees you only pay for actual scraped data without paying for expensive idle browser compute.

# Actor input Schema

## `handles` (type: `array`):

List of X/Twitter handles or profile URLs to scrape (e.g. \['elonmusk', 'https://x.com/OpenAI']).

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

Maximum number of total tweets to collect across the specified accounts.

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

Optional proxy settings. Recommended for high-volume or repeated scraping.

## Actor input object example

```json
{
  "handles": [
    "elonmusk"
  ],
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Dataset containing scraped X tweets.

# 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 = {
    "handles": [
        "elonmusk"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("axery/x-account-tweets-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 = { "handles": ["elonmusk"] }

# Run the Actor and wait for it to finish
run = client.actor("axery/x-account-tweets-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 '{
  "handles": [
    "elonmusk"
  ]
}' |
apify call axery/x-account-tweets-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,axery/x-account-tweets-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/7n5swdi0U7GNRhTLG/builds/AdLH76aGC4WFy7zAB/openapi.json
