# X Twitter Profile Scraper - Public Profile Details (`khadinakbar/x-twitter-profile-scraper`) Actor

Scrape public X/Twitter profiles with bio, follower counts, verification, websites, images, and optional top tweets. MCP-ready. $0.007/profile.

- **URL**: https://apify.com/khadinakbar/x-twitter-profile-scraper.md
- **Developed by:** [Khadin Akbar](https://apify.com/khadinakbar) (community)
- **Categories:** Social media, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $7.00 / 1,000 x/twitter profile 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/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 Profile Scraper

Scrape public X/Twitter profile details for influencer discovery, competitor research, social listening, lead enrichment, and AI-agent workflows.

### What It Extracts

This actor accepts X/Twitter handles or profile URLs and returns one normalized profile row per public account. It uses provider-backed public data, so it does not require user cookies, browser sessions, login credentials, or an X developer account.

| Field group | Included fields |
| --- | --- |
| Identity | `username`, `name`, `userId`, `profileUrl` |
| Profile copy | `bio`, `location`, `websiteUrl`, `businessLabel` |
| Media | `avatarUrl`, `bannerUrl` |
| Verification | `isVerified`, `isBlueVerified`, `isProtected` |
| Audience metrics | `followersCount`, `followingCount`, `tweetCount`, `mediaCount`, `listedCount`, `likesCount` |
| Account context | `accountCreatedAt`, `pinnedTweetIds` |
| Optional tweets | `tweetId`, `tweetUrl`, `text`, `createdAt`, engagement counts, `hashtags`, `mentions`, `urls`, `mediaUrls` |
| Run telemetry | `provider`, `scrapedAt`, `OUTPUT`, `RUN_SUMMARY` |

### When To Use It

Use this actor when you need clean public X/Twitter profile data for:

- Influencer and creator vetting
- Competitor account monitoring
- Brand and executive social profile enrichment
- Lead research for sales, recruiting, and partnerships
- Social media benchmarking
- AI-agent research tools that need predictable profile JSON
- CRM enrichment from a list of X/Twitter handles

Use the optional `includeTweets` setting when you want public tweet examples for context. The upstream public endpoint returns roughly the top public tweets surfaced for a profile, not a complete chronological archive.

### When Not To Use It

This actor does not unlock private accounts, deleted posts, DMs, private follower graphs, hidden email addresses, or login-only data. It does not scrape complete follower lists. For follower or following graph data, use a dedicated X/Twitter followers actor. For keyword search across X, use an X/Twitter search scraper.

### Input

The main input is `profiles`, a line-separated list of handles or URLs.

```json
{
  "profiles": ["openai", "@apify", "https://x.com/levelsio"],
  "includeTweets": false,
  "maxTweetsPerProfile": 10,
  "dedupeProfiles": true,
  "providerOrder": "auto"
}
````

For a richer profile plus tweet context run:

```json
{
  "profiles": ["openai", "apify"],
  "includeTweets": true,
  "maxTweetsPerProfile": 5
}
```

### Output

Profile rows are intentionally flat and MCP-friendly:

```json
{
  "recordType": "profile",
  "inputProfile": "openai",
  "userId": "4398626122",
  "username": "OpenAI",
  "name": "OpenAI",
  "bio": "Creating safe AGI that benefits all of humanity.",
  "profileUrl": "https://x.com/OpenAI",
  "location": "San Francisco, CA",
  "websiteUrl": "https://openai.com",
  "isBlueVerified": true,
  "followersCount": 10000000,
  "followingCount": 3,
  "tweetCount": 9000,
  "accountCreatedAt": "2015-12-11T20:29:15.000Z",
  "provider": "scrapecreators",
  "scrapedAt": "2026-06-12T12:00:00.000Z"
}
```

Optional tweet rows use the same dataset so agents can page one output stream:

```json
{
  "recordType": "tweet",
  "inputProfile": "openai",
  "username": "OpenAI",
  "profileUrl": "https://x.com/OpenAI",
  "tweetId": "1234567890123456789",
  "tweetUrl": "https://x.com/OpenAI/status/1234567890123456789",
  "text": "Announcing a new research update.",
  "createdAt": "2026-06-12T12:00:00.000Z",
  "likeCount": 1000,
  "viewCount": 50000,
  "provider": "scrapecreators",
  "scrapedAt": "2026-06-12T12:00:01.000Z"
}
```

The actor also writes `OUTPUT` and `RUN_SUMMARY` to the key-value store with saved counts, charged counts, provider status codes, provider fallback usage, warnings, and stop reason.

### Pricing

This actor uses pay-per-event pricing:

| Event | Price |
| --- | ---: |
| Actor start | `$0.00005` |
| Public X/Twitter profile saved | `$0.007` |
| Optional public profile tweet saved | `$0.0005` |

Example: 100 profile-only rows cost about `$0.70` plus the tiny actor start event. Ten profiles with five optional tweets each cost about `$0.095`.

The run status message prints the maximum possible charge before data collection starts, and the final summary prints the actual charged profile and tweet events.

### Reliability

The actor tries ScrapeCreators first by default because its X profile endpoint is rich and cost efficient. If SociaVault credentials are configured, the actor can fall back to SociaVault for profile and tweet endpoints. You can force the provider order with `providerOrder` during validation.

Provider errors, missing profiles, empty responses, and invalid input are written to `OUTPUT` and `RUN_SUMMARY` with warnings instead of crashing silently. Dataset writes use a defensive fallback so one malformed optional field does not destroy the whole run.

### API And MCP Use

This actor is designed for Apify API calls, scheduled tasks, and hosted Apify MCP usage. The input schema uses clear field names and defaults, and the dataset schema keeps profile rows flat so AI agents can inspect, filter, and chain the records into other workflows.

Use via API:

```bash
apify call khadinakbar/x-twitter-profile-scraper \
  --input='{"profiles":["openai","apify"],"includeTweets":false}'
```

Use from an agent when the user asks for public X/Twitter account metadata, influencer vetting, profile enrichment, or social account benchmarking. Do not use it for keyword tweet search, follower graph scraping, private account data, or hidden contact discovery.

### Limits

- Public profile data only
- No user cookies required or accepted
- Optional tweet rows are public top tweets surfaced by the provider, not a complete archive
- Maximum 100 input profiles per run
- Maximum 100 optional tweets per profile
- Field availability depends on what public X/Twitter data and the upstream provider expose at run time

### Legal

This actor is intended for lawful collection and analysis of public web data. You are responsible for using the exported data in compliance with applicable laws, platform terms, privacy obligations, and your own internal policies.

# Actor input Schema

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

Use this when you need public X/Twitter profile details for one or more accounts. Accepts handles or URLs, for example openai, @levelsio, or https://x.com/apify. Provide 1 to 100 profiles. This is not a tweet search field.

## `includeTweets` (type: `boolean`):

Use this when profile context also needs public tweet examples. The provider returns roughly the public top tweets surfaced for a profile, not a complete chronological archive. Defaults to false for low-cost profile enrichment. This does not scrape replies or private tweets.

## `maxTweetsPerProfile` (type: `integer`):

Use this to cap optional tweet rows per profile when includeTweets is enabled. Accepted range is 0 to 100, for example 10. Defaults to 10 with tweets enabled and 0 otherwise. This is not a profile count limit.

## `providerOrder` (type: `string`):

Use this to force provider order during testing or fallback checks. Values are auto, scrapecreators-first, or sociavault-first. Defaults to auto, which tries ScrapeCreators before SociaVault when both secrets exist. This is not exposed to X users.

## `dedupeProfiles` (type: `boolean`):

Use this to avoid duplicate profile rows when the same account appears more than once. Matching is by X user ID first, then normalized username. Defaults to true. This does not dedupe optional tweet rows across different profiles.

## `includeRaw` (type: `boolean`):

Use this only when debugging field drift or validating provider parity. It attaches the raw provider object to each dataset item. Defaults to false for small MCP-friendly output. This is not needed for normal profile exports.

## Actor input object example

```json
{
  "profiles": [
    "openai",
    "apify"
  ],
  "includeTweets": false,
  "maxTweetsPerProfile": 10,
  "providerOrder": "auto",
  "dedupeProfiles": true,
  "includeRaw": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

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

No description

## `runSummary` (type: `string`):

No description

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

// Run the Actor and wait for it to finish
const run = await client.actor("khadinakbar/x-twitter-profile-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": [
        "openai",
        "apify",
    ] }

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

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "X Twitter Profile Scraper - Public Profile Details",
        "description": "Scrape public X/Twitter profiles with bio, follower counts, verification, websites, images, and optional top tweets. MCP-ready. $0.007/profile.",
        "version": "1.0",
        "x-build-id": "gRHYAiWCgYzbeOnKk"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/khadinakbar~x-twitter-profile-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-khadinakbar-x-twitter-profile-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/khadinakbar~x-twitter-profile-scraper/runs": {
            "post": {
                "operationId": "runs-sync-khadinakbar-x-twitter-profile-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/khadinakbar~x-twitter-profile-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-khadinakbar-x-twitter-profile-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": [
                    "profiles"
                ],
                "properties": {
                    "profiles": {
                        "title": "Profiles",
                        "minItems": 1,
                        "maxItems": 100,
                        "type": "array",
                        "description": "Use this when you need public X/Twitter profile details for one or more accounts. Accepts handles or URLs, for example openai, @levelsio, or https://x.com/apify. Provide 1 to 100 profiles. This is not a tweet search field.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "includeTweets": {
                        "title": "Include public top tweets",
                        "type": "boolean",
                        "description": "Use this when profile context also needs public tweet examples. The provider returns roughly the public top tweets surfaced for a profile, not a complete chronological archive. Defaults to false for low-cost profile enrichment. This does not scrape replies or private tweets.",
                        "default": false
                    },
                    "maxTweetsPerProfile": {
                        "title": "Max tweets per profile",
                        "minimum": 0,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Use this to cap optional tweet rows per profile when includeTweets is enabled. Accepted range is 0 to 100, for example 10. Defaults to 10 with tweets enabled and 0 otherwise. This is not a profile count limit.",
                        "default": 10
                    },
                    "providerOrder": {
                        "title": "Provider order",
                        "enum": [
                            "auto",
                            "scrapecreators-first",
                            "sociavault-first"
                        ],
                        "type": "string",
                        "description": "Use this to force provider order during testing or fallback checks. Values are auto, scrapecreators-first, or sociavault-first. Defaults to auto, which tries ScrapeCreators before SociaVault when both secrets exist. This is not exposed to X users.",
                        "default": "auto"
                    },
                    "dedupeProfiles": {
                        "title": "Dedupe profiles",
                        "type": "boolean",
                        "description": "Use this to avoid duplicate profile rows when the same account appears more than once. Matching is by X user ID first, then normalized username. Defaults to true. This does not dedupe optional tweet rows across different profiles.",
                        "default": true
                    },
                    "includeRaw": {
                        "title": "Include raw provider payload",
                        "type": "boolean",
                        "description": "Use this only when debugging field drift or validating provider parity. It attaches the raw provider object to each dataset item. Defaults to false for small MCP-friendly output. This is not needed for normal profile exports.",
                        "default": false
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
