# X (Twitter) Profile Scraper (`bareezh_codes/x-twitter-profile-scraper`) Actor

Scrape public X (Twitter) profiles and their latest posts by handle or URL: bio, followers, following, joined date, verification, plus each post's text, likes, reposts, replies, views, bookmarks and media. No login, no cookies. Auto-switches to residential proxy if rate-limited.

- **URL**: https://apify.com/bareezh_codes/x-twitter-profile-scraper.md
- **Developed by:** [Salman Bareesh](https://apify.com/bareezh_codes) (community)
- **Categories:** Social media, Marketing
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.35 / 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

## X (Twitter) Profile Scraper

Scrape public X (Twitter) profiles and their latest posts. Give it handles or profile links and
get the profile details (bio, followers, following, joined date, verification, website) plus each
recent post with likes, reposts, replies, quotes, **views** and **bookmarks**, media and quoted posts.

- **No login, no cookies.** Your X account is never used, so it can never be locked or banned.
- **Engagement you can't get from embeds:** view counts, reposts and bookmarks on every post.
- **Auto-unblock.** If the run gets rate-limited it switches itself to Apify Residential Proxy
  with a fresh IP per retry. Nothing to configure.
- **Pay only for results.** Missing, suspended and invalid profiles are logged, never charged.

### Who uses it

- Marketers and agencies benchmarking competitors' posting cadence and engagement
- Founders and creators building swipe files of what performs for accounts in their niche
- Sales and partnerships teams qualifying creators and influencers by followers and views
- Researchers and analysts tracking what public figures post

### Input

```json
{
  "profiles": ["naval", "@paulg", "https://x.com/levelsio"],
  "maxTweetsPerProfile": 20,
  "includeRetweets": true
}
```

- `profiles`: handles (with or without `@`) or profile URLs. A post URL works too; its author is used.
- `maxTweetsPerProfile`: latest posts per profile, newest first, up to 1000. `0` = profile details only.
- `includeRetweets`: turn off to keep only the profile's own posts.

### Output

Each profile gives one `profile` row, then one `tweet` row per post. Every row has the same keys
and carries the full `profile` object, so you can filter or export rows on their own.

```json
{
  "type": "tweet",
  "profileHandle": "paulg",
  "profile": {
    "id": "183749519",
    "handle": "paulg",
    "name": "Paul Graham",
    "url": "https://x.com/paulg",
    "bio": "",
    "location": null,
    "website": "http://paulgraham.com",
    "avatarUrl": "https://pbs.twimg.com/profile_images/1824002576/pg-railsconf_400x400.jpg",
    "bannerUrl": "https://pbs.twimg.com/profile_banners/183749519/1401332683",
    "followers": 5374704,
    "following": 801,
    "tweets": 54873,
    "likes": 158878,
    "mediaCount": 2000,
    "joinedAt": "2010-08-27T20:13:59+00:00",
    "verified": true,
    "verificationType": "individual",
    "protected": false
  },
  "tweetId": "2105546284140798182",
  "tweetUrl": "https://x.com/jessegenet/status/2105546284140798182",
  "text": "Incredible things can occur when you suggest action over whining...",
  "createdAt": "2026-10-01T06:32:07+00:00",
  "lang": "en",
  "likeCount": 1171,
  "repostCount": 12,
  "replyCount": 25,
  "quoteCount": 5,
  "viewCount": 131947,
  "bookmarkCount": 220,
  "isRetweet": true,
  "tweetAuthorHandle": "jessegenet",
  "tweetAuthorName": "Jesse Genet",
  "quotedTweetUrl": "https://x.com/MrsCMFrancis/status/2105424960667967609",
  "quotedTweetText": "The other day at breakfast...",
  "media": [],
  "articleTitle": null,
  "input": "https://x.com/paulg",
  "scrapedAt": "2026-10-01T15:36:52.000000+00:00"
}
```

On `profile` rows all post fields (`tweetId` ... `articleTitle`) are `null`. On reposts
(`isRetweet: true`), `tweetAuthorHandle` is the original author. Each `media` entry has
`type` (`photo`, `video`, `gif`), `url` (image or video thumbnail) and `videoUrl` (MP4).

### Pricing

Pay per result: each saved row (one profile row plus one row per post) is one result. Missing
profiles and failed requests are free. Set a maximum cost per run in the run options and the
Actor stops there.

### FAQ

**Do I need an X account, API key or cookies?** No.

**Where does the data come from?** The public FxTwitter API (open-source FxEmbed project),
which serves public X data without an account.

**Does it include replies?** No. The timeline lists a profile's posts and reposts, not its replies.

**Can I get every post an account ever made?** Up to 1000 latest posts per profile. Older posts
may not be reachable without login.

**Is it legal?** It only reads data that is public on X. You are responsible for how you use it,
including privacy law (GDPR/CCPA) where personal data is involved.

### Limits

- Public profiles only. Protected accounts return the profile row only; suspended accounts return nothing.
- Data relies on a third-party public API, which can change or slow down. We monitor the Actor daily.

# Actor input Schema

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

X handles or profile URLs, e.g. naval, @paulg or https://x.com/levelsio. Duplicates are removed.

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

How many of the latest posts to save for each profile (newest first). Set 0 to save only the profile details. Up to 1000.

## `includeRetweets` (type: `boolean`):

Also save posts the profile reposted (retweets). Turn off to keep only the profile's own posts.

## Actor input object example

```json
{
  "profiles": [
    "naval",
    "https://x.com/paulg"
  ],
  "maxTweetsPerProfile": 20,
  "includeRetweets": true
}
```

# Actor output Schema

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

Profile rows and post rows

# 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": [
        "naval",
        "https://x.com/paulg"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("bareezh_codes/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": [
        "naval",
        "https://x.com/paulg",
    ] }

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

```

## MCP server setup

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