# Twitter/ X Followers Scraper (`api402/twitter-x-ff`) Actor

high-speed, cost-effective Apify Actor to scrape followers, following, and verified lists from any public X (formerly Twitter) profile. Extract complete profile data including handles, display names, bios, locations, follower counts, and verification types for just $0.10 per 1,000 profiles.

- **URL**: https://apify.com/api402/twitter-x-ff.md
- **Developed by:** [Synapz (Api402)](https://apify.com/api402) (community)
- **Categories:** Social media, Lead generation, Developer tools
- **Stats:** 1 total users, 0 monthly users, 85.7% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.20 / 1,000 results

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/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) Followers & Following Scraper

A high-speed, cost-effective Apify Actor to scrape followers, following, and verified followers lists from any public X (formerly Twitter) profile. Extract complete profile data including handles, display names, bios, locations, follower counts, and verification types for just **$0.10 per 1,000 profiles**. No X API keys required.

---

### Key Features

- **Scrape X (Twitter) Followers**: Extract complete profile data of any user's follower base.
- **Scrape X (Twitter) Following**: Export details of all accounts followed by a target profile.
- **Scrape Verified Followers Only**: Target Premium/blue-badge accounts (ideal for high-value B2B lead generation).
- **Bulk Scrapes**: Paste up to 5 profile handles or full URLs in a single run.
- **Country Pinning (Anti-Block)**: Pin residential proxies to specific countries (e.g., US, IN, DE) to keep scraper sessions stable and secure.
- **Pay-Per-Result Pricing**: Only pay **$0.10 per 1,000 profiles** successfully scraped.
- **No X API Key Needed**: Zero configuration of Twitter API keys, logins, or developer accounts required.
- **Clean Formats**: Download datasets in JSON, CSV, Excel, or HTML.

---

### What Data Does It Extract?

For every profile scraped, the Actor retrieves the following structured information:

| Field Name | Type | Description |
| :--- | :--- | :--- |
| `id` | String | Numeric X User ID |
| `username` | String | Profile handle (without `@`) |
| `name` | String | Display name |
| `profile_url` | String | Link to the user profile (e.g., `https://x.com/username`) |
| `description` | String | Bio text |
| `followers_count` | Integer | Total followers count |
| `friends_count` | Integer | Total following count |
| `statuses_count` | Integer | Total tweets posted |
| `favourites_count` | Integer | Total likes given |
| `media_count` | Integer | Total media uploaded |
| `is_blue_verified` | Boolean | Premium / verified profile status |
| `verified_type` | String | Type of verification (`blue`, `business`, `government`, or `none`) |
| `location` | String | Self-reported profile location |
| `profile_image_url` | String | URL of the avatar image |
| `profile_banner_url` | String | URL of the banner image |
| `created_at` | String | Account creation date (ISO timestamp) |
| `relationship_type` | String | Relation type (`followers`, `following`, or `verified_followers`) |
| `target_user` | String | Shorthand handle you scraped this profile from |
| `scraped_at` | String | Scrape execution timestamp |

---

### How to Use the Scraper

#### Step 1: Input Targets
Provide the profile handles or full URLs of the accounts you want to scrape (up to 5).
```json
{
  "usernamesOrUrls": [
    "elonmusk",
    "https://x.com/nasa"
  ]
}
````

#### Step 2: Toggle List Types

Choose which lists to scrape:

- `Followers` (Default: `true`)
- `Following` (Default: `true`)
- `Verified` (verified followers only, Default: `false`)

#### Step 3: Configure Proxy & Country Pinning (Crucial)

To ensure the scraper remains completely stable and bypasses Twitter's geo-locking limits:

1. Keep **Use Residential Proxy** toggled `on`.
2. Under **Proxy Country Code**, input the two-letter code (e.g. `IN` for India, `US` for United States, `GB` for Great Britain) matching the country of the scraping cookies. Pinning the proxy country prevents session invalidation due to sudden geographic jumps.

#### Step 4: Run and Export

Click **Start** to run the Actor. Once completed, go to the **Storage** tab to export your profiles list to CSV, Excel, or JSON.

***

### Input Parameters Schema

| Param | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| `usernamesOrUrls` | Array | Yes | List of target Twitter/X handles or profile URLs (max 5). |
| `Followers` | Boolean | No | Extract target's followers list. Default is `true`. |
| `Following` | Boolean | No | Extract target's following list. Default is `true`. |
| `Verified` | Boolean | No | Extract target's verified followers list. Default is `false`. |
| `useResidentialProxy`| Boolean | No | Use residential proxy groups for anti-bot bypass. Default is `true`. |
| `proxyCountryCode` | String | No | Two-letter country code (e.g. `US`, `IN`) to pin the proxy IP location. |
| `proxyConfiguration` | Object | No | Custom proxy options if not using the default residential groups. |

***

### Output Example

```json
{
  "target_user": "rish_w3b",
  "relationship_type": "following",
  "username": "elonmusk",
  "name": "Elon Musk",
  "id": "44196397",
  "description": "Owner of Tesla, SpaceX, xAI & X",
  "followers_count": 185200000,
  "friends_count": 521,
  "statuses_count": 42500,
  "favourites_count": 21500,
  "is_blue_verified": true,
  "verified_type": "blue",
  "profile_url": "https://x.com/elonmusk",
  "profile_image_url": "https://pbs.twimg.com/profile_images/...",
  "profile_banner_url": "https://pbs.twimg.com/profile_banners/...",
  "created_at": "2009-06-02T20:12:29.000Z",
  "scraped_at": "2026-06-02T08:50:00.000Z"
}
```

***

### Pricing & Costs

- **Billing Rate**: **$0.10 per 1,000 items** written to the dataset.
- **Platform Usage**: Apify infrastructure compute costs are fully included in the rate.
- **Pay for Results**: You are only charged for successfully scraped profiles that enter your dataset. There are no startup fees or subscriptions.

***

### Use Cases

- **Lead Generation**: Scrape B2B leads by targeting followers of industry leaders or competitors, then filter by keywords in their bio.
- **Audience Analysis**: Segment follower demographics by analyzing their locations and bio metadata.
- **Influencer Discovery**: Export following lists of niche influencers to find relevant brands, co-creators, or market partners.
- **Competitor Tracking**: Monitor who is following competitor accounts over time.

***

### Legal & Ethical Scraping Disclaimer

This scraper only extracts publicly available profile information that users choose to share openly on X (Twitter). It does not access private data, emails, phone numbers, or passwords. Scraping public web data is legal, but personal data in certain regions may be protected by regulations like GDPR. Ensure your scraping activities comply with local data protection laws.

***

#### Need Help or Custom Integrations?

This Actor is developed and maintained by **mikolabs** ([mikolabs.xyz](https://mikolabs.xyz)). For custom scrapers, questions, or issues, open a ticket in the **Issues** tab on the Actor console page or visit our website.

# Actor input Schema

## `usernamesOrUrls` (type: `array`):

List of Twitter/X usernames or profile URLs to scrape (maximum 5). E.g. \<pii\_masked: name> or https://x.com/gyan\_w3b

## `Followers` (type: `boolean`):

If enabled, extracts the full lists of followers

## `Following` (type: `boolean`):

If enabled, extracts the full lists of following.

## `Verified` (type: `boolean`):

If enabled, extracts the full lists of verified followers.

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

Residential proxies are required to bypass Twitter's anti-bot protection.

## Actor input object example

```json
{
  "usernamesOrUrls": [
    "gyan_w3b",
    "https://x.com/rish_w3b"
  ],
  "Followers": true,
  "Following": true,
  "Verified": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (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 = {
    "usernamesOrUrls": [
        "gyan_w3b",
        "https://x.com/rish_w3b"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("api402/twitter-x-ff").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 = { "usernamesOrUrls": [
        "gyan_w3b",
        "https://x.com/rish_w3b",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("api402/twitter-x-ff").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 '{
  "usernamesOrUrls": [
    "gyan_w3b",
    "https://x.com/rish_w3b"
  ]
}' |
apify call api402/twitter-x-ff --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Twitter/ X Followers Scraper",
        "description": "high-speed, cost-effective Apify Actor to scrape followers, following, and verified lists from any public X (formerly Twitter) profile. Extract complete profile data including handles, display names, bios, locations, follower counts, and verification types for just $0.10 per 1,000 profiles.",
        "version": "0.0",
        "x-build-id": "CeRSQe7XcymJCIK8N"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/api402~twitter-x-ff/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-api402-twitter-x-ff",
                "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/api402~twitter-x-ff/runs": {
            "post": {
                "operationId": "runs-sync-api402-twitter-x-ff",
                "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/api402~twitter-x-ff/run-sync": {
            "post": {
                "operationId": "run-sync-api402-twitter-x-ff",
                "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",
                "properties": {
                    "usernamesOrUrls": {
                        "title": "Target Usernames or Profile URLs",
                        "maxItems": 5,
                        "type": "array",
                        "description": "List of Twitter/X usernames or profile URLs to scrape (maximum 5). E.g. <pii_masked: name> or https://x.com/gyan_w3b",
                        "default": [
                            "gyan_w3b",
                            "https://x.com/rish_w3b"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "Followers": {
                        "title": "Scrape Followers Lists",
                        "type": "boolean",
                        "description": "If enabled, extracts the full lists of followers",
                        "default": true
                    },
                    "Following": {
                        "title": "Scrape Following Lists",
                        "type": "boolean",
                        "description": "If enabled, extracts the full lists of following.",
                        "default": true
                    },
                    "Verified": {
                        "title": "Scrape Verified Followers Lists",
                        "type": "boolean",
                        "description": "If enabled, extracts the full lists of verified followers.",
                        "default": false
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Residential proxies are required to bypass Twitter's anti-bot protection.",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ]
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
