# X (Twitter) Account Scraper (`xtracto/x-account-scraper`) Actor

Get profile data from any public X (Twitter) account by handle, @handle, or profile URL. Followers, following, posts count, bio, location, website, verification badge, profile image and banner. HTTP-only, no login required.

- **URL**: https://apify.com/xtracto/x-account-scraper.md
- **Developed by:** [Farhan Febrian Nauval](https://apify.com/xtracto) (community)
- **Categories:** Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.10 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 Scraper

Extract public profile data from any X (Twitter) account in bulk — handle, display name, bio, follower and following counts, tweet count, profile image, banner, verified status, and account creation date — in a clean structured JSON output.

### Why use this actor

- **No account / no login required** — just give it an X handle or profile URL.
- **Identity-flexible input** — bare handle (`jack`), at-prefixed (`@elonmusk`), or full profile URL (`https://twitter.com/nasa`, `https://x.com/nasa`) all work.
- **Exact follower & following counts** plus tweet count, listed count, and media count — the same numbers X's web app displays.
- **Verified status** — the `is_blue_verified` flag plus the structured `verification_info` block tells you whether the badge comes from a paid subscription or an identity check.
- **Account creation date** in the response so you can sort by account age, spot suspicious newly-created accounts, or audit brand handles.
- **Automatic retries** with exponential backoff; suspended, protected, or non-existent handles surface as `_error` rows instead of crashing the run.

### How it works

1. You provide a list of X handles or profile URLs.
2. The actor fetches each profile the same way X's web app does and assembles a flat JSON record per account.
3. Results stream into your dataset, ready to download as JSON, CSV, or Excel.

You do not need to manage scrapers, browsers, or rotating IPs — all handled internally.

### Input

```json
{
  "handles": ["jack", "nasa"],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["DATACENTER"]
  }
}
````

| Field | Type | Description |
|---|---|---|
| `handles` | array | List of X handles or profile URLs to scrape. Accepted forms: `jack`, `@elonmusk`, `https://twitter.com/nasa`, `https://x.com/nasa`. |
| `proxyConfiguration` | object | Apify Proxy settings. Datacenter proxies are sufficient for public profile lookups. |

### Output

Input: `jack`

```json
{
  "_input": "jack",
  "_source": "S1-primary",
  "_scrapedAt": "2026-05-18T11:03:56.348095+00:00",
  "rest_id": "12",
  "id": "VXNlcjoxMg==",
  "screen_name": "jack",
  "name": "jack",
  "created_at": "Tue Mar 21 20:50:14 +0000 2006",
  "description": "no state is the best state",
  "url": "https://t.co/ZEpOg6rn5L",
  "entities": {
    "description": {},
    "url": {
      "urls": [
        {
          "display_url": "primal.net/jack",
          "expanded_url": "http://primal.net/jack",
          "indices": [0, 23],
          "url": "https://t.co/ZEpOg6rn5L"
        }
      ]
    }
  },
  "location": "",
  "followers_count": 7537416,
  "friends_count": 3,
  "statuses_count": 30509,
  "favourites_count": 38827,
  "listed_count": 33146,
  "media_count": 2963,
  "normal_followers_count": 7537416,
  "fast_followers_count": 0,
  "profile_banner_url": "https://pbs.twimg.com/profile_banners/12/1742427520",
  "profile_image_shape": "Circle",
  "default_profile": false,
  "default_profile_image": false,
  "is_blue_verified": true,
  "has_graduated_access": true,
  "possibly_sensitive": false,
  "translator_type": "regular",
  "verification_info": {
    "is_identity_verified": false,
    "reason": {
      "description": {
        "text": "This account is verified because it's an affiliate of @Square on X. Learn more",
        "entities": [
          { "from_index": 54, "to_index": 61, "ref": { "url": "https://twitter.com/Square", "url_type": "ExternalUrl" } }
        ]
      },
      "verified_since_msec": "1324658988066"
    }
  },
  "pinned_tweet_ids_str": ["1833951636005552366"],
  "has_custom_timelines": true
}
```

| Field | Type | Description |
|---|---|---|
| `_input` | string | The handle or URL exactly as you supplied it. Use this to join results back to your input list. |
| `_source` | string | Internal tag for the path used to fetch the record. `S1-primary` is the standard fast path; values starting with `S2-` indicate a fallback was used. |
| `_scrapedAt` | string | ISO-8601 UTC timestamp when the record was scraped. |
| `rest_id` | string | X's internal numeric user ID. Stable across handle changes — the most reliable identifier for an account. |
| `id` | string | Base64-encoded form of the user ID. |
| `screen_name` | string | The current `@handle` (without the `@`). |
| `name` | string | Display name shown above the handle on the profile page. |
| `created_at` | string | Account creation timestamp (X's native format, e.g. `Tue Mar 21 20:50:14 +0000 2006`). |
| `description` | string | The user's bio / about text. Empty string if not set. |
| `url` | string | The shortened (`t.co`) URL the user pinned to their profile. Empty if none. |
| `entities` | object | Parsed entities inside `description` and `url` — mentions, hashtags, and the original `expanded_url` for any links. |
| `location` | string | Free-text location field from the profile. Empty string if not set. |
| `followers_count` | integer | Number of accounts following this profile. |
| `friends_count` | integer | Number of accounts this profile follows. |
| `statuses_count` | integer | Total tweets (including replies and retweets) the account has posted. |
| `favourites_count` | integer | Number of tweets the account has liked. |
| `listed_count` | integer | Number of public Lists this account appears on. |
| `media_count` | integer | Number of media items (images, videos) the account has posted. |
| `normal_followers_count` | integer | Followers excluding fast-followers; almost always equals `followers_count`. |
| `fast_followers_count` | integer | Internal X metric — typically `0`. |
| `profile_banner_url` | string | URL of the profile banner / header image. May be absent if the user has no banner. |
| `profile_image_shape` | string | Shape of the avatar — `Circle` for normal accounts, `Square` for business accounts, `Hexagon` for NFT avatars. |
| `default_profile` | boolean | `true` if the account still uses the default profile design. |
| `default_profile_image` | boolean | `true` if the avatar is still the default egg / silhouette. |
| `is_blue_verified` | boolean | `true` if the account has the blue checkmark (paid subscription or legacy verification migration). |
| `has_graduated_access` | boolean | Internal X flag indicating full access tier; usually `true` for established accounts. |
| `possibly_sensitive` | boolean | X's content-sensitivity flag for the profile. |
| `translator_type` | string | X translator tier — almost always `none` or `regular`. |
| `verification_info` | object | Structured detail for verified accounts: `is_identity_verified` (true = passed identity check), a human-readable `reason.description.text`, and `verified_since_msec` (millisecond timestamp). |
| `pinned_tweet_ids_str` | array | IDs of tweets the user has pinned to their profile (usually 0 or 1). |
| `has_custom_timelines` | boolean | `true` if the account has created custom timeline collections. |

#### Error envelope

Accounts that are suspended, deactivated, protected, or have never existed return a structured error instead of crashing the run:

```json
{
  "_input": "this-handle-does-not-exist-xyz",
  "_error": "not_found",
  "_errorDetail": "empty user result",
  "_source": "S1-primary",
  "_scrapedAt": "2026-05-18T11:03:56.348095+00:00"
}
```

`_error` values you may see:

| Value | Meaning |
|---|---|
| `not_found` | Handle has never existed or was permanently deleted. |
| `unavailable` | Account is suspended or deactivated. `_errorDetail` carries X's reason string (e.g. `Suspended`). |
| `blocked` | Profile lookup was rejected (HTTP 4xx) — usually rate-limited. The run continues with the next handle. |
| `exception` | Unexpected error; check `_errorDetail` for the message. |

Filter on `_error` to triage failed rows.

### Pricing

This actor is billed per result: **$8.00 per 1,000 profiles**. Each successful profile = 1 result. Errors (suspended, not-found, blocked) are not billed.

### Other Sosmed Actors

| Platform | Actor | Best for |
|---|---|---|
| Twitter / X | [X Account Tweets Scraper](https://apify.com/xtracto/x-account-tweets-scraper) | Profile + recent tweets timeline for any handle |
| Twitter / X | [X Post Detail Scraper](https://apify.com/xtracto/x-post-detail-scraper) | Full tweet detail, media variants, engagement counters |
| Twitter / X | [X Search Scraper](https://apify.com/xtracto/x-search-scraper) | Search tweets by keyword, hashtag, or `from:user` |
| Instagram | [Instagram Account Scraper](https://apify.com/xtracto/instagram-account-scraper) | Bio, followers, post count |
| Threads | [Threads Account Scraper](https://apify.com/xtracto/threads-account-scraper) | Profile data for a Threads handle |
| Bluesky | [Bluesky Account Scraper](https://apify.com/xtracto/bluesky-account-scraper) | atproto profile + counters |
| Reddit | [Reddit User Profile Scraper](https://apify.com/xtracto/reddit-user-profile-scraper) | Karma, posts, trophies |

Browse the full catalog at [apify.com/xtracto](https://apify.com/xtracto).

### Notes

- `followers_count`, `friends_count`, and `statuses_count` are the exact numbers X's web app displays — eventually-consistent and may lag the live network by a few minutes.
- **Protected accounts** return their public metadata only (display name, bio, follower/following counts, creation date) — tweets and media are not exposed.
- **Suspended accounts** return `{"_error": "unavailable", "_errorDetail": "Suspended", "_input": "..."}`. Use the error envelope to triage.
- `rest_id` is the most reliable identifier — handles can change but `rest_id` is permanent. Store it if you need long-term joins.
- For large jobs (>1,000 profiles), Apify Proxy rotation is recommended to avoid per-IP rate limits.

# Actor input Schema

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

List of X (Twitter) handles or profile URLs to scrape. Accepted formats: bare handle (`jack`), with the at sign (`@elonmusk`), or full profile URL (`https://twitter.com/nasa`, `https://x.com/nasa`).

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

Apify Proxy settings. Datacenter proxies are sufficient for public profile lookups.

## Actor input object example

```json
{
  "handles": [
    "jack",
    "nasa"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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": [
        "jack",
        "nasa"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("xtracto/x-account-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": [
        "jack",
        "nasa",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("xtracto/x-account-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": [
    "jack",
    "nasa"
  ]
}' |
apify call xtracto/x-account-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=xtracto/x-account-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "X (Twitter) Account Scraper",
        "description": "Get profile data from any public X (Twitter) account by handle, @handle, or profile URL. Followers, following, posts count, bio, location, website, verification badge, profile image and banner. HTTP-only, no login required.",
        "version": "1.0",
        "x-build-id": "JSqDanFdxH02F77aq"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/xtracto~x-account-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-xtracto-x-account-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/xtracto~x-account-scraper/runs": {
            "post": {
                "operationId": "runs-sync-xtracto-x-account-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/xtracto~x-account-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-xtracto-x-account-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "handles"
                ],
                "properties": {
                    "handles": {
                        "title": "X (Twitter) handles or profile URLs",
                        "type": "array",
                        "description": "List of X (Twitter) handles or profile URLs to scrape. Accepted formats: bare handle (`jack`), with the at sign (`@elonmusk`), or full profile URL (`https://twitter.com/nasa`, `https://x.com/nasa`).",
                        "items": {
                            "type": "string"
                        }
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Apify Proxy settings. Datacenter proxies are sufficient for public profile lookups.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
