# Twitter/X User Scraper: Metadata, Followers, Followings & More! (`scrape.badger/twitter-user-scraper`) Actor

ScrapeBadger's Twitter/X User Profile Scraper extracts public user data: IDs, profiles, followers, followings, & latest tweets. Perfect for market research, influencer ID, and building datasets. It's cost-effective, easy to use, and requires no API key. Get powerful user insights today!

- **URL**: https://apify.com/scrape.badger/twitter-user-scraper.md
- **Developed by:** [ScrapeBadger](https://apify.com/scrape.badger) (community)
- **Categories:** Social media
- **Features:** Limited permissions
- **Stats:** 606 total users, 67 monthly users, 100.0% runs succeeded, 15 bookmarks
- **User rating**: 4.94 out of 5 stars

## Pricing

from $0.12 / 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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

[![Scrapebadger Twitter Scraper](https://raw.githubusercontent.com/ScrapeBadger/twitter-scraper/refs/heads/main/scrapebadger.png)](https://scrapebadger.com)

ScrapeBadger provides powerful data extraction capabilities to scrape Twitter/X user profiles, offering an incredibly affordable solution for comprehensive user data collection. Dive deep into public Twitter profiles, from fetching specific user details by <b>Twitter user ID</b> or username to extracting followers, followings, and even their latest tweets. All this starts at just <b>$0.20 per 1,000 results.</b>

Unleash the potential of public Twitter (now X) user data with ScrapeBadger's Twitter profiles scraper. Whether you're a market researcher, a social media analyst, a developer, or simply aiming to get Twitter user IDs and associated profile information, our tool provides a streamlined and cost-effective way to collect valuable insights. Gain reliable access to structured user information without the complexities of direct APIs, ideal for competitor analysis, influencer identification, audience segmentation, and more.

### What can X User Scraper do?

- **Effortless User Data Retrieval:** Designed for **ease of use**, ScrapeBadger allows you to **select a Mode and provide its corresponding identifier** (e.g., User ID for "Get User by ID", username for "Get User by Username", search query for "Search Users").
- **Comprehensive User Profile Acquisition:**
  - **Get Twitter user ID** and detailed profile information for any public user by their ID or username. Access data points like name, screen name, profile image, bio, location, follower/following counts, and more.
  - **Get User About** information including account location, username history, and verification details.
  - Efficiently **scrape Twitter profile** data to build rich datasets for analysis.
- **Network Analysis & Engagement:**
  - Extract lists of **followers** and **followings** for any public user.
  - Get **verified followers** and **followers you know** (mutual connections).
  - Retrieve **latest followers** and **latest following** for recent network changes.
  - Access user's **highlighted tweets** and **subscriptions** (premium content).
- **Targeted User Search:** Perform powerful searches to discover Twitter/X users by keywords.
- **Flexible and Structured Output:** Data is delivered in Apify's standard Dataset, ready for export in CSV, JSON, etc.
- **Enterprise-Grade Reliability:** Built on the robust Apify platform for consistent results.
- **Cost-Effective Solution:** Just **$0.20 per 1,000 results**.

### Why scrape X (Twitter) profiles?

- **Social Media Marketing:** Identify influencers, analyze audience demographics, and track competitor followers.
- **Market Research:** Build datasets of users interested in specific topics, products, or services.
- **Academic & Research:** Gather data for social network analysis, demographic studies, and behavioral patterns.
- **Lead Generation:** Discover potential leads or connections based on their Twitter activity and connections.
- **Cybersecurity & OSINT:** Investigate public profiles for relevant information.
- **Developers & Data Scientists:** Integrate structured user data into your applications and analytical models.

### How to scrape X user profiles

| Mode | Description | Key Input Parameter | JSON Parameter | Optional |
|:-----|:------------|:--------------------|:---------------|:---------|
| Get User by ID | Retrieve profile details using unique User ID | **User ID** | `user_id` | - |
| Get User by Username | Obtain profile information using username | **Username** | `username` | - |
| Get User About | Get extended about info (location, username history, verification) | **Username** | `username` | - |
| Get User Followers | Extract all users who follow a specified username | **Username** | `username` | `max_results` |
| Get User Followings | Retrieve all users that a username follows | **Username** | `username` | `max_results` |
| Get User Latest Tweets | Fetch recent tweets posted by a username | **Username** | `username` | `max_results` |
| Get User Highlights | Get a user's highlighted/pinned tweets | **User ID** | `user_id` | `max_results` |
| Get User Subscriptions | Get premium accounts a user subscribes to | **User ID** | `user_id` | `max_results` |
| Get Verified Followers | Extract only verified followers of a user | **User ID** | `user_id` | `max_results` |
| Get Followers You Know | Get mutual followers (followers you also follow) | **User ID** | `user_id` | `max_results` |
| Get Latest Followers | Get most recent followers of a user | **Username** | `username` | `max_results` |
| Get Latest Following | Get accounts a user most recently followed | **Username** | `username` | `max_results` |
| Search Users | Search for users by keywords | **Search Query** | `query` | `max_results` |

### Request and response examples

#### 1. Get User by ID

**Request:**

```json
{
  "mode": "Get User by ID",
  "user_id": "183543469142"
}
```

#### 2. Get User by Username

**Request:**

```json
{
  "mode": "Get User by Username",
  "username": "elonmusk"
}
```

#### 3. Get User About

**Request:**

```json
{
  "mode": "Get User About",
  "username": "elonmusk"
}
```

**Response includes:**

- Account location/region
- Username change history
- Verification status and type
- Extended profile metadata

#### 4. Get User Followers

**Request:**

```json
{
  "mode": "Get User Followers",
  "username": "elonmusk",
  "max_results": 1000
}
```

#### 5. Get User Followings

**Request:**

```json
{
  "mode": "Get User Followings",
  "username": "elonmusk",
  "max_results": 1000
}
```

#### 6. Get User Latest Tweets

**Request:**

```json
{
  "mode": "Get User Latest Tweets",
  "username": "elonmusk",
  "max_results": 100
}
```

#### 7. Get User Highlights

**Request:**

```json
{
  "mode": "Get User Highlights",
  "user_id": "44196397",
  "max_results": 50
}
```

#### 8. Get User Subscriptions

**Request:**

```json
{
  "mode": "Get User Subscriptions",
  "user_id": "44196397",
  "max_results": 100
}
```

#### 9. Get Verified Followers

**Request:**

```json
{
  "mode": "Get Verified Followers",
  "user_id": "44196397",
  "max_results": 500
}
```

#### 10. Get Followers You Know

**Request:**

```json
{
  "mode": "Get Followers You Know",
  "user_id": "44196397",
  "max_results": 100
}
```

#### 11. Get Latest Followers

**Request:**

```json
{
  "mode": "Get Latest Followers",
  "username": "elonmusk",
  "max_results": 200
}
```

#### 12. Get Latest Following

**Request:**

```json
{
  "mode": "Get Latest Following",
  "username": "elonmusk",
  "max_results": 200
}
```

#### 13. Search Users

**Request:**

```json
{
  "mode": "Search Users",
  "query": "data scientist",
  "max_results": 100
}
```

### What data can X User Scraper extract?

User profile objects include:

- **Core:** id, username, name, description, location, url
- **Metrics:** followers_count, following_count, tweet_count, listed_count, favourites_count, media_count
- **Profile:** profile_image_url, profile_banner_url
- **Verification:** verified, verified_type, is_blue_verified
- **Account:** created_at, protected, possibly_sensitive
- **Relationships:** followed_by, following, blocking, muting, can_dm

**Important Note:** To prevent API abuse and ensure fair resource allocation, you will be charged for requests that return an empty results set.

### How much does it cost to scrape X profiles?

- **Highly Targeted User Data:** Precisely extract the Twitter/X user information you need.
- **Efficient and Reliable:** Built for speed and stability on the Apify platform.
- **Unbeatable Value:** Just $0.20 per 1,000 results.
- **User-Friendly:** Easy to configure regardless of technical expertise.
- **Seamless Integration:** Output data readily available for analysis.

### About ScrapeBadger

This actor is powered by [ScrapeBadger](https://scrapebadger.com) - a reliable Twitter/X data extraction service.

- **Official Website:** [scrapebadger.com](https://scrapebadger.com)
- **Faster Support:** Get priority support directly through the ScrapeBadger website
- **SDK & API Access:** Want to use ScrapeBadger outside of Apify? The Python SDK and REST API are available for direct integration into your own applications

### Ready-to-run examples

Each of these is a live, pre-configured task — open one and press **Start**, no setup:

- [Vet an influencer before a campaign](https://apify.com/scrape.badger/twitter-user-scraper/examples/vet-an-influencer-before-a-campaign)
- [Export a competitor's followers](https://apify.com/scrape.badger/twitter-user-scraper/examples/export-a-competitors-followers)
- [Map who a founder follows](https://apify.com/scrape.badger/twitter-user-scraper/examples/map-who-a-founder-follows)
- [Track an account's latest posts](https://apify.com/scrape.badger/twitter-user-scraper/examples/track-an-accounts-latest-posts)
- [Check account authenticity](https://apify.com/scrape.badger/twitter-user-scraper/examples/check-account-authenticity)
- [Build a lead list from verified followers](https://apify.com/scrape.badger/twitter-user-scraper/examples/build-a-lead-list-from-verified-followers)
- [Discover accounts by keyword](https://apify.com/scrape.badger/twitter-user-scraper/examples/discover-accounts-by-keyword)
- [Monitor new followers daily](https://apify.com/scrape.badger/twitter-user-scraper/examples/monitor-new-followers-daily)
- [See who an account just followed](https://apify.com/scrape.badger/twitter-user-scraper/examples/see-who-an-account-just-followed)
- [Collect a creator's highlights](https://apify.com/scrape.badger/twitter-user-scraper/examples/collect-a-creators-highlights)

### What can you do with X (Twitter) profiles data?

#### Influencer vetting

Follower count alone is worthless. Pull the profile, the About panel and the recent timeline together and you can see a bought audience, a rebranded account or a creator whose reach has quietly collapsed — before a contract is signed.

#### B2B lead generation

A competitor's followers are your prospects, and verified followers skew heavily towards real businesses. Export either, score by bio and follower count, and you have a list built on declared interest.

#### Audience overlap analysis

Pull the follower lists of two accounts and intersect them. High overlap means a partnership reaches the same people twice; low overlap means genuine expansion.

#### Hiring and recruitment signals

Search profiles by role rather than posts by keyword. 'devrel', 'growth marketer', 'founder' surface people by what they actually do.

#### Account authenticity checks

Country, join date and former usernames are the fastest tells for an impersonation or a resold handle — all in one cheap call.

### Is scraping X legal?

This Actor requests only public X fields — the same content any logged-out visitor can see. It does not access private accounts, direct messages or anything behind a login.

Results can still contain personal data. Personal data is protected by the GDPR in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers.

### Frequently asked questions

#### Do I need an X (Twitter) API key?

No. You need a [ScrapeBadger](https://scrapebadger.com) API key, which has a free tier, and nothing from X.

#### Can I look up a user by ID instead of handle?

Yes — *Get User by ID* takes the numeric ID. Modes that need an ID also accept a `username` and resolve it for you.

#### What happens if an account is suspended or protected?

The run writes a record with `reason: "unavailable"` and completes normally, so one bad handle in a list never fails the whole run.

#### How large can a follower export get?

Set **Max Results** to whatever you need. Large accounts page for a long time, so cap it deliberately — each page is a charged request.

### Your feedback and support

Found a bug, missing a field, or need a mode that is not here? Open a ticket on the **Issues** tab, or email <support@scrapebadger.com>.

# Changelog

This Actor's version history is a separate document: https://apify.com/scrape.badger/twitter-user-scraper/changelog.md

# Actor input Schema

## `mode` (type: `string`):

Select the type of user data to scrape. Each mode requires different input parameters.

## `username` (type: `string`):

Twitter username without the @ symbol. Example: for https://x.com/<b>elonmusk</b>, enter <b>elonmusk</b>. Required for username-based modes.

## `user_id` (type: `string`):

The numeric Twitter User ID. You can find this using 'Get User by Username' mode first. Example: <b>15347622</b>. Required for ID-based modes.

## `query` (type: `string`):

Keywords to search for users. Searches usernames, display names, and bios. Example: <b>data scientist</b> or <b>crypto trader</b>. Required for 'Search Users' mode.

## `max_results` (type: `integer`):

Maximum number of items to return. Higher values increase run time and cost. Default: 1000.

## Actor input object example

```json
{
  "mode": "Get User by ID",
  "username": "james",
  "user_id": "15347622",
  "query": "intern",
  "max_results": 1000
}
```

# Actor output Schema

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

All scraped data including user profiles, tweets, and status indicators stored in the default dataset

# 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 = {
    "username": "james",
    "user_id": "15347622",
    "query": "intern"
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrape.badger/twitter-user-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 = {
    "username": "james",
    "user_id": "15347622",
    "query": "intern",
}

# Run the Actor and wait for it to finish
run = client.actor("scrape.badger/twitter-user-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 '{
  "username": "james",
  "user_id": "15347622",
  "query": "intern"
}' |
apify call scrape.badger/twitter-user-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrape.badger/twitter-user-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/TKLtfBQ02rrtQYmUa/builds/3azM7Os297Wty4eKZ/openapi.json
