# X User Profile Scraper (`fetch_cat/x-user-profile-scraper`) Actor

Export public X profile metadata, counts, links, and enrichment-ready contact fields by handle, URL, or search query.

- **URL**: https://apify.com/fetch\_cat/x-user-profile-scraper.md
- **Developed by:** [Hanna Nosova](https://apify.com/fetch_cat) (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 $2.94 / 1,000 profile exporteds

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?

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

## Twitter User Scraper – Export public X profiles

This Twitter user scraper exports enrichment-ready public X user profile data by handle, profile URL, or search query. Use the Twitter profile scraper dataset for creator discovery, social listening, public-source research, lead enrichment, and recurring profile monitoring. Run it as an X profile data API without providing an X login.

### What you can export

- Canonical profile identity, URLs, name, biography, location, and public website
- Follower, following, and post counts when displayed publicly
- Avatar, banner, account creation date, verification, and protection status
- Request provenance, collection timestamp, and explicit warnings
- Conservatively extracted public email addresses and website domains

### Example input

```json
{
  "handles": ["NASA", "SpaceX"],
  "profileUrls": ["https://x.com/github"],
  "searchQueries": ["space agency"],
  "maxItems": 20,
  "includeRecentCounts": true,
  "failOnBlocked": false
}
```

### Example output

```json
{
  "id": "11348282",
  "handle": "NASA",
  "displayName": "NASA",
  "bio": "Making the seemingly impossible, possible. ✨",
  "location": "Pale Blue Dot",
  "websiteUrl": "http://www.nasa.gov/",
  "profileUrl": "https://x.com/NASA",
  "followersCount": 92338258,
  "postsCount": 74170,
  "isBlueVerified": true,
  "verifiedType": "Government",
  "sourceType": "handle",
  "scrapedAt": "2026-08-20T22:27:52.191Z",
  "websiteDomains": ["nasa.gov"],
  "status": "ok"
}
```

### Input settings

| Field | Type | Default | Description |
|---|---|---:|---|
| `handles` | string\[] | `[]` | Public handles, with or without `@` |
| `profileUrls` | string\[] | `[]` | Public `x.com` or `twitter.com` profile URLs |
| `searchQueries` | string\[] | `[]` | Find public profiles relevant to each query |
| `maxItems` | integer | `20` | Global profile limit, from 1 to 1,000 |
| `includeRecentCounts` | boolean | `true` | Include the visible `postsCount`; `false` emits `null` for that field |
| `failOnBlocked` | boolean | `false` | Fail rather than preserve partial results if a route is blocked |

At least one handle, URL, or query must resolve to a public profile. Duplicate handles and URL aliases are merged.

### Output fields

| Fields | Meaning |
|---|---|
| `id`, `handle`, `displayName` | Stable public profile identity |
| `bio`, `location`, `websiteUrl` | Profile-supplied public details |
| `profileUrl`, `legacyProfileUrl` | Canonical X and compatible Twitter URLs |
| `avatarUrl`, `bannerUrl` | Public profile images |
| `followersCount`, `followingCount`, `postsCount` | Visible profile counters |
| `likesCount`, `listedCount`, `mediaCount` | Additional public counters when the source exposes them |
| `createdAt` | Account creation timestamp |
| `isVerified`, `isBlueVerified`, `verifiedType` | Public verification state |
| `isProtected`, `canDm` | Public privacy and messaging flags when exposed |
| `professionalType`, `professionalCategories` | Public professional-profile metadata |
| `pinnedPostIds`, `withheldInCountries` | Public pin and restriction metadata when exposed |
| `sourceInput`, `sourceType`, `searchQuery` | Input provenance |
| `scrapedAt`, `status`, `warnings` | Collection and diagnostic information |
| `emails`, `websiteDomains` | Conservative enrichment derived from public bio/link text |

Optional source fields are `null` or empty when the profile does not publish them. The Actor never substitutes viewer locale or proxy geography for account data.

### Input recipes

**Monitor known accounts:** provide a scheduled list in `handles` and export the latest public counters. Set `includeRecentCounts: false` when a stable identity-only snapshot is preferred.

**Normalize profile URLs:** mix `x.com` and `twitter.com` URLs; output uses stable canonical URLs.

**Discover profiles:** add focused terms to `searchQueries`, then bound the dataset with `maxItems`.

### Who is it for?

This Actor is designed for social-listening teams monitoring public accounts, creator marketers building outreach lists, OSINT researchers comparing public profile changes, and sales intelligence teams enriching CRM records with public X identity and audience data.

### Pricing

The Actor uses pay per event: one small run-start charge and one `Profile exported` event for each successfully saved row. Failed or blocked profiles are not charged as results. See the live [Pricing tab](https://apify.com/fetch_cat/x-user-profile-scraper/pricing) for current tier rates.

### API usage

#### cURL

```bash
curl -X POST "https://api.apify.com/v2/acts/fetch_cat~x-user-profile-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"handles":["NASA"],"maxItems":1}'
```

#### JavaScript

```javascript
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('fetch_cat/x-user-profile-scraper').call({ handles: ['NASA'], maxItems: 1 });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

#### Python

```python
from apify_client import ApifyClient
import os
client = ApifyClient(os.environ['APIFY_TOKEN'])
run = client.actor('fetch_cat/x-user-profile-scraper').call(run_input={'handles': ['NASA'], 'maxItems': 1})
items = client.dataset(run['defaultDatasetId']).list_items().items
```

### MCP and AI agents

Connect through [Apify MCP](https://mcp.apify.com/?tools=fetch_cat/x-user-profile-scraper) to let an AI workflow run profile lookups and consume structured results.

```bash
claude mcp add apify --transport http https://mcp.apify.com/?tools=fetch_cat/x-user-profile-scraper
```

```json
{"mcpServers":{"apify":{"type":"http","url":"https://mcp.apify.com/?tools=fetch_cat/x-user-profile-scraper"}}}
```

Example prompts: “Export NASA and SpaceX public X profile counters” or “Find public X profiles for space agencies and return their websites.” Keep limits low while developing an automation.

### Tips and limits

- Prefer exact handles or profile URLs when identity accuracy matters.
- Search results depend on public indexing and may not include every X account.
- Counts change continuously and represent the value visible at collection time.
- Removed, suspended, age-gated, or unavailable profiles may produce no row.
- Public-source availability and X anti-automation responses can cause partial runs; inspect run logs and `warnings`.
- The Actor exports public profile metadata only. It does not access DMs, private content, authenticated timelines, tweets, or follower graphs.

### FAQ

#### What data can I export with twitter user scraper?

You can export public profile identity, bio, links, images, audience and post counts, verification state, timestamps, provenance, and conservative public contact enrichment.

#### Can I run X User Profile Scraper through an API, schedule, or MCP client?

Yes. Call it through the Apify API or SDK, connect it to an MCP client, or save the input as an Apify Task and schedule recurring exports.

#### Does this require my X password or API token?

No. The Actor works with publicly available profile information and never asks for X credentials.

#### Can I scrape private profiles or direct messages?

No. Those are outside this Actor's public-profile scope.

#### Why is an optional field null?

The profile or currently available public page did not expose it. Nulls are preferred over guessed values.

#### Can I schedule recurring exports?

Yes. Save the input as an Apify Task and schedule it from the Apify Console.

### Related Actors

- [X Profile Tweets Scraper](https://apify.com/fetch_cat/x-profile-tweets-scraper) for public posts by profile
- [X Followers Scraper](https://apify.com/fetch_cat/x-followers-scraper) for follower workflows
- [GitHub Profile Scraper](https://apify.com/fetch_cat/github-profile-scraper) for developer enrichment
- [LinkedIn Profile Details Scraper](https://apify.com/fetch_cat/linkedin-profile-details-scraper) for professional profiles
- [TikTok Profile Scraper](https://apify.com/fetch_cat/tiktok-profile-scraper) for creator profile data

### Support

For questions or reproducible problems, open an issue from the Actor's **Issues** tab. Include the public input, run ID, and expected behavior; never include passwords or private account data.

# Actor input Schema

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

Public handles with or without @.

## `profileUrls` (type: `array`):

Public x.com or twitter.com profile URLs.

## `searchQueries` (type: `array`):

Find public X profiles relevant to each query.

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

Maximum profile rows saved across all inputs.

## `includeRecentCounts` (type: `boolean`):

Include the public posts count when available; false emits null for postsCount.

## `failOnBlocked` (type: `boolean`):

Fail instead of preserving partial output when a profile route is blocked.

## Actor input object example

```json
{
  "handles": [
    "NASA",
    "SpaceX"
  ],
  "profileUrls": [],
  "searchQueries": [],
  "maxItems": 20,
  "includeRecentCounts": true,
  "failOnBlocked": false
}
```

# Actor output Schema

## `overview` (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 = {
    "handles": [
        "NASA",
        "SpaceX"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("fetch_cat/x-user-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 = { "handles": [
        "NASA",
        "SpaceX",
    ] }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,fetch_cat/x-user-profile-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/X2oOROlfthzt01k63/builds/RUyI2gdLKLoUNI9y5/openapi.json
