# X (Twitter) People Search Scraper (`arjun_code/x-twitter-people-search-scraper`) Actor

Search X (Twitter) users by keyword and export structured public profiles, audience metrics, verification, links, activity counts, and Grok bio translations.

- **URL**: https://apify.com/arjun\_code/x-twitter-people-search-scraper.md
- **Developed by:** [Arjun AI](https://apify.com/arjun_code) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 87.5% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 x user profiles

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?

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) People Search Scraper

Find public X (Twitter) accounts with X's native **People** search and export clean, structured profile data. Enter one or more keyword phrases, choose how many profiles you need, and receive an analysis-ready Dataset containing identity, biography, audience, activity, verification, professional, and profile-link fields.

This Actor searches for people and organizations—not posts. It is useful when you want to discover accounts around a profession, company, research area, community, location, name, or niche without manually paging through X search results.

### What you can do

- Search X users with phrases such as `AI researcher`, `climate journalist`, `fintech Singapore`, or a person's name.
- Run several queries in one Actor run.
- Export profile names, handles, bios, locations, websites, avatars, and banners.
- Compare followers, following, likes, posts, and media-post counts.
- Capture verified, blue-verified, protected, sensitive-content, and professional-profile signals.
- Receive Grok-translated bios when X supplies a translation.
- Download results as JSON, CSV, Excel, XML, RSS, or access them through the Apify API.

### Input

| Field | Type | Description | Default |
| --- | --- | --- | --- |
| `searchQueries` | string array | Enter one keyword or phrase per line. Every query runs independently and results follow X's People-search ranking. Post-search operators are not supported. | `AI researcher` |
| `maxUsersPerQuery` | integer | Maximum unique profiles saved for each individual query. `20` normally requests one result page; use a larger number for pagination or `0` for all pages made available by X. The limit applies separately to every query. | `20` |

Example input:

```json
{
  "searchQueries": [
    "AI researcher",
    "climate journalist London"
  ],
  "maxUsersPerQuery": 20
}
```

Results follow X's own People-search ranking. The query is passed to X as entered, but operators intended for post search—such as `since:`, `until:`, `min_faves:`, and `filter:media`—are not part of this Actor's supported behavior.

Duplicates are removed by user ID within each query. If the same account matches two different queries, it can appear once for each query so the `search_query` attribution remains intact.

### Output

Each Dataset item is one flattened public profile. There is no nested raw `user` object.

| Group | Fields |
| --- | --- |
| Result state | `status`, `message` |
| Search and identity | `search_query`, `user_id`, `screen_name`, `profile_url`, `name` |
| Biography | `description`, `description_entities`, `profile_description_language` |
| Grok bio translation | `grok_translation_available`, `grok_translated_bio`, `grok_source_language`, `grok_destination_language` |
| Profile details | `location`, `created_at`, `website_url`, `profile_image_url`, `profile_banner_url` |
| Audience and activity | `followers_count`, `friends_count`, `favourites_count`, `tweets_count`, `media_count` |
| Verification and privacy | `verified`, `verified_type`, `is_blue_verified`, `protected`, `possibly_sensitive`, `has_graduated_access` |
| Professional and pinned content | `professional_type`, `pinned_tweet_ids` |

Representative output:

```json
{
  "status": "success",
  "search_query": "AI researcher",
  "user_id": "891077171673931776",
  "screen_name": "berkeley_ai",
  "profile_url": "https://x.com/berkeley_ai",
  "name": "Berkeley AI Research",
  "description": "We're graduate students, postdocs, faculty and scientists at the cutting edge of artificial intelligence research.",
  "description_entities": {
    "description": {},
    "url": {
      "urls": [
        {
          "display_url": "bair.berkeley.edu",
          "expanded_url": "http://bair.berkeley.edu/",
          "indices": [0, 23],
          "url": "https://t.co/h9tAyYG2Q0"
        }
      ]
    }
  },
  "profile_description_language": "en",
  "grok_translation_available": false,
  "grok_translated_bio": "",
  "grok_source_language": "",
  "grok_destination_language": "",
  "location": "Berkeley, CA",
  "created_at": "Fri Jul 28 23:25:27 +0000 2017",
  "followers_count": 288339,
  "friends_count": 472,
  "favourites_count": 663,
  "tweets_count": 1588,
  "media_count": 42,
  "verified": false,
  "verified_type": "",
  "is_blue_verified": true,
  "protected": false,
  "possibly_sensitive": false,
  "has_graduated_access": true,
  "professional_type": "",
  "pinned_tweet_ids": [],
  "website_url": "http://bair.berkeley.edu/",
  "profile_image_url": "https://pbs.twimg.com/profile_images/891079469594587138/c_bnAh4o_normal.jpg",
  "profile_banner_url": "https://pbs.twimg.com/profile_banners/891077171673931776/1501285360"
}
```

Profile data and counts change over time. Empty strings or arrays mean X did not provide that field for the returned profile. A Grok translation is included only when it is available in X's response.

#### No results

When X returns no People matches for a valid query, the Actor completes successfully and writes one uncharged status record instead of leaving the Dataset empty:

```json
{
  "status": "no_results",
  "search_query": "example keyword",
  "message": "No X People results were found for this search query."
}
```

For runs with multiple queries, the Actor writes a separate `no_results` record for each query with no matches and continues processing the remaining queries. Successful profile records use `status: "success"`.

### Run from the Apify Console

1. Open the Actor and select **Try for free**.
2. Add one or more People search queries.
3. Set the maximum profiles per query.
4. Click **Start**.
5. Open the Dataset to preview, filter, download, or access the results through the API.

### Run with the Apify API

#### cURL

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/arjun_code~x-twitter-people-search-scraper/runs?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "searchQueries": ["AI researcher"],
    "maxUsersPerQuery": 20
  }'
```

The run response contains `defaultDatasetId`. Use it to retrieve the result items from the Dataset API.

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("arjun_code/x-twitter-people-search-scraper").call(
    run_input={
        "searchQueries": ["AI researcher"],
        "maxUsersPerQuery": 20,
    }
)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

#### JavaScript

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

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('arjun_code/x-twitter-people-search-scraper').call({
    searchQueries: ['AI researcher'],
    maxUsersPerQuery: 20,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### Common use cases

- Discover researchers, creators, journalists, founders, recruiters, or subject-matter experts.
- Build prospect and partnership lists from public profile data.
- Find organizations and communities in a specific market or location.
- Compare audience and activity signals before outreach or research.
- Create public-profile datasets for enrichment, monitoring, or analysis workflows.

Try the ready-made [Find AI Researchers on X (Twitter)](https://apify.com/arjun_code/x-twitter-people-search-scraper/examples/find-ai-researchers-on-x) example, or enter your own search phrases in the Actor input.

### Continue your X research workflow

| Goal | Actor |
| --- | --- |
| Discover public accounts by keyword, profession, niche, or location | [X (Twitter) People Search Scraper](https://apify.com/arjun_code/x-twitter-people-search-scraper) |
| Export followers or accounts followed by one or more profiles | [X Followers & Following Scraper — No Login](https://apify.com/arjun_code/x-twitter-followers-followings-scraper) |
| Inspect account origin, signup source, and username-change history | [X Twitter Account Origin Intelligence](https://apify.com/arjun_code/x-twitter-account-origin-scraper) |

A typical workflow is: discover relevant accounts, export their public audiences, then inspect origin signals for selected profiles.

### Pricing

This Actor is designed for **pay per event** pricing. The chargeable event is `search-user-result`, emitted once for each profile written to the Dataset. `no_results` status records are not charged as search results. The current event price is shown in the Actor's **Pricing** tab. Set `maxUsersPerQuery` to control the maximum number of billable profiles requested for each query. Apify platform usage can also apply according to your plan.

### Proxy, credentials, and privacy

The Actor uses Apify Proxy by default. X session credentials are managed privately by the Actor developer and are not requested through public input or written to the Dataset. Only public profile information returned by X People search is exported. Viewer-specific relationship fields—such as whether the scraping account follows, blocks, mutes, or can message a profile—are intentionally excluded.

For temporary network failures and HTTP `401`, `403`, `404`, `429`, or `5xx` responses, the Actor retries up to two times. Each retry switches to the next available credential and a new Apify Proxy session, then reloads X transaction data before repeating the search request.

### Limitations

- This Actor returns People results only; it does not search posts or return tweet content.
- Search order and result availability are controlled by X and can change between runs.
- Protected accounts may expose fewer public fields.
- Some optional fields, including Grok bio translations, may be unavailable.
- X can change its web responses or apply temporary rate limits, which may affect a run.
- `maxUsersPerQuery: 0` follows available pages but cannot guarantee every account on X matching a phrase.

Use the data responsibly and comply with applicable laws, privacy requirements, X's terms, and Apify's terms. This independent Actor is not affiliated with, endorsed by, or sponsored by X Corp.

### Support

If a run fails or the output changes, open an issue on the Actor page and include the Apify run ID, input, and expected behavior. Do not include passwords, cookies, tokens, or other secrets.

# Actor input Schema

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

Enter one keyword or phrase per line. Each query is sent independently to X People search, and results follow X's own ranking. You can search for a name, handle, organization, profession, topic, niche, or location phrase. Operators intended for post search are not supported.

## `maxUsersPerQuery` (type: `integer`):

Maximum number of unique profiles saved for each individual search query. The default 20 normally fetches one X results page. Enter a larger number to continue pagination, or 0 to follow all result pages made available by X. When multiple queries are provided, this limit applies separately to each query.

## Actor input object example

```json
{
  "searchQueries": [
    "AI researcher"
  ],
  "maxUsersPerQuery": 20
}
```

# Actor output Schema

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

Structured public profiles returned by X People search.

# 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 = {
    "searchQueries": [
        "AI researcher"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("arjun_code/x-twitter-people-search-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 = { "searchQueries": ["AI researcher"] }

# Run the Actor and wait for it to finish
run = client.actor("arjun_code/x-twitter-people-search-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 '{
  "searchQueries": [
    "AI researcher"
  ]
}' |
apify call arjun_code/x-twitter-people-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,arjun_code/x-twitter-people-search-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/FcAofOHb1aYDTujVf/builds/OPU74xt6KP3bhbfPD/openapi.json
