X (Twitter) Profile Scraper API: Read Public Profiles and Posts
A twitter profile scraper api takes an X handle and returns that account's public profile (follower count, bio, verified flag, join date) and its recent posts as JSON. You have two main routes. You can pay X directly through its pay-per-use API, or you can call a read-only public data API that returns the same public fields with one key and no X developer account. This guide covers what each route returns, what it actually costs per handle, where the data stops, and a live read we ran on @x on 2026-12-04.
What a Twitter profile scraper API returns
Almost every tool in this category returns the same two things.
The profile. This includes the display name, handle, numeric X ID, bio, join date, verified status, profile image, external link, follower count, following count, post count, and whether the account is protected.
Recent posts. This includes post text, timestamp, post ID, and engagement counts such as replies, reposts, likes and views, plus any attached media.
Inputs vary. Most tools accept a username, an @handle, a profile URL or a numeric user ID. Bulk input is common. Apify actors take batches of handles, and Bright Data accepts up to 5,000 URLs per call.
The differences that matter are elsewhere: how fresh the data is, whether the call returns right away or runs as a job, how failures are reported, and what you pay per handle.
A live read: @x on 2026-12-04
Here is a real /v1/profile request against the X account itself.
curl "https://api.sociallens.dev/v1/profile?platform=x&username=x" \
-H "Authorization: Bearer sk_live_YOUR_KEY"
{
"exists": true,
"username": "X",
"platform": "x",
"nickname": "X",
"verified": true,
"private": false,
"followers": 60553863,
"is_exact": true,
"following": 1,
"likes": null,
"videos": 15745,
"bio": "what's happening?!",
"id": "783214",
"created_at": "2007-02-20T14:35:54Z",
"external_link": "https://x.com",
"category": null,
"fetched_at": "2026-12-04T05:25:08Z",
"cached": false,
"credits": { "source": "paid", "charged": 1, "balance": 9955 }
}
Here is what the response tells you:
followersis the exact integer (60,553,863 at read time), andis_exact: trueconfirms it is not a rounded "60.5M" figure.idis the stable numeric X user ID. Store it, because handles can be renamed and the ID does not change.likesandcategoryarenullbecause the source did not expose them in this read. The API does not fill them with a guess.fetched_atandcached: falseshow that this was a live read, not a stale copy.credits.charged: 1means the read cost one credit. A handle that does not exist returns"exists": falseand costs nothing.
If you only need the follower number, the X follower count API guide goes deeper on that single field.
Reading recent posts for the same handle
Posts use the same key and the same request shape:
curl "https://api.sociallens.dev/v1/profile-posts?platform=x&username=x&limit=20" \
-H "Authorization: Bearer sk_live_YOUR_KEY"
Each post comes back with its url, text (caption), published_at timestamp and engagement counts (likes, comments, and views where X exposes them). To read the replies under a specific post, /v1/post-comments returns each reply's text, author, likes and replies. The comments API guide walks through that call.
So three calls (profile, posts, comments) cover a handle end to end. Each call is synchronous and each successful call costs one credit.
The official X API: what it costs per handle
X no longer sells new developers a flat monthly tier. According to X's pricing docs (checked 2026-12-04), the API is pay-per-usage. You buy credits in the Developer Console, reads are charged per resource returned, and writes are charged per request. Basic and Pro are legacy plans and closed to new signups, so articles that still list them as options are out of date.
These are the published read rates that matter for profile scraping:
| Resource | Price |
|---|---|
| User: Read | $0.010 per user returned |
| Posts: Read | $0.005 per post returned |
| Like: Read | $0.001 per resource |
Almost nobody works out the cost per handle, so here it is, calculated from those published rates:
- One profile: $0.010
- 100 recent posts: 100 × $0.005 = $0.50
- Profile plus 100 posts: about $0.51 per handle
- 1,000 profiles only: about $10
Pay-per-use plans are also capped at 3 million post reads per month. Above that, X points you to Enterprise (post cap docs). Some ranking articles still quote an older 2 million cap. When credits run out, requests fail until you top up.
X does deduplicate billing in one way: a post returned by several queries within the same day is billed once. Buying X API credits can also earn xAI API credits, up to 20% back.
The official endpoints
If you go direct, these are the calls you will use:
GET /2/users/by/username/:usernamefor one profile by handleGET /2/users/byfor up to 100 usernames per requestGET /2/users/:idfor one profile by IDGET /2/users/:id/tweetsfor the posts timeline
User lookup is rate limited to 300 requests per 15 minutes per app and 900 per user. Going over returns HTTP 429, and your remaining quota is reported in the x-rate-limit-* response headers. The full trade-off between the two routes is laid out in X API alternative: public profile data.
Official fields vs a public data API, side by side
If you are migrating code, this mapping saves time:
| Official X API v2 field | SocialLens field |
|---|---|
id |
id |
username |
username |
name |
nickname |
description |
bio |
verified |
verified |
protected |
private |
created_at |
created_at |
profile_image_url |
avatar |
url |
external_link |
public_metrics.followers_count |
followers (+ is_exact) |
public_metrics.following_count |
following |
The bigger difference is the shape. The same field names come back for TikTok, Instagram, YouTube and the other 14 networks, so one parser handles all of them.
Sync vs async: why it matters for lookups and agents
Third-party X data comes in two delivery styles, and the top-ranking pages rarely explain the difference.
Async jobs. Bright Data triggers a collection, then delivers results by webhook or cloud storage in JSON, NDJSON or CSV. Apify runs an actor, and you then fetch its dataset. This works well for large batch exports where waiting is fine.
Synchronous REST. You send one request and get JSON back in the same response. This suits live UI lookups, enrichment at signup, and AI agents that need the answer within the same conversational turn.
Neither style is better in general. If you are exporting a large list of handles overnight, async is natural. If a user types a handle and expects a number on screen, you want sync. We compare the two styles in more detail in our Bright Data alternative guide and our Apify alternative guide.
"No login, no API key" and what happens when it breaks
Several marketplace scrapers advertise "no login, no API key, no developer account." Some of them say they rely on X's guest GraphQL endpoints. X can change or throttle those endpoints without notice, and when that happens you may see:
- fields that suddenly come back empty
- a spike in errors or timeouts
- runs that finish "successfully" with fewer records than expected
Before you depend on any tool, ask how it reports failure. SocialLens returns explicit states. Not-found returns "exists": false, fields the source does not expose are null, and errors are non-200 responses that cost nothing. That way a broken read is never silently billed as data.
Read-only is a security feature
A profile scraper should not be able to post, like, DM or follow anyone. SocialLens is strictly read-only. It reads public data, never acts as an account, and never touches private data or DMs. Since there is no OAuth grant to any X account, there are no write scopes to leak and no user tokens to rotate. For teams worried about OAuth permissions in a vendor review, this is a real advantage over tools that ask you to connect an account.
For AI agents: X profiles through MCP
None of the ranking pages show this workflow, so here it is. Install the MCP server:
npx -y sociallens-mcp
Set SOCIALLENS_API_KEY in the environment. The server is listed in the official MCP registry as dev.sociallens/sociallens-mcp. Then ask your assistant something like "Get @x's profile and its last 20 posts, and summarize which posts got the most views." The agent calls the profile and posts tools and gets back the same JSON shown above.
Assistants that browse the web can also use the no-key lookup, which is rate limited per IP: https://sociallens.dev/lookup?username=x&platform=x. Setup details are in the agents guide and in best social media MCP server.
What the public data does not cover
An honest twitter profile scraper api has clear edges. These apply to every route, official or not:
- Protected accounts. Their posts are not public. The profile read returns
private: trueand no timeline. - Suspended, deleted or renamed handles. A handle that no longer resolves returns
"exists": false. If you track accounts over time, store the numericid. - Deleted posts. Once removed, they are gone from any public read.
- Full history. X's own timeline endpoint reaches back only 3,200 posts, or 800 if you exclude replies. Third-party tools usually face similar depth limits. Be skeptical of any tool that promises "full history" or "unrestricted access beyond platform restrictions."
- Owner-only analytics. Impressions breakdowns, profile visits and audience demographics for accounts you do not own are not public.
- Fraud or bot scoring. A data API returns raw public numbers, not a judgment about whether followers are real.
Terms of service and legality
X's developer terms govern automated access to its platform, and courts have ruled on public-data scraping cases involving X. Both the terms and case law change over time. Read the current terms at the source and get legal advice for your specific use case. Our guide to social media scraping legality summarizes the 2026 landscape. Whichever route you choose, limit yourself to public data, collect only what you need, and do not republish personal data carelessly.
Comparing options for X profile data
| Option | Delivery | Pricing model | X developer account needed | Notes |
|---|---|---|---|---|
| Official X API | Sync REST | Pay-per-use: $0.010 per user, $0.005 per post | Yes | 3M post-read monthly cap; 300 lookups per 15 min per app |
| SocialLens | Sync REST + MCP | 1 credit per successful read; errors and not-found free; credits never expire | No | Same schema across 17 networks; 250 free reads, no card; see pricing |
| Apify | Async actor runs | Per result or compute, varies by actor | No | Large marketplace; actor quality and upkeep vary |
| Bright Data | Async dataset jobs | Per record, with a free monthly allowance | No | Up to 5,000 URLs per call; webhook or storage delivery |
| EnsembleData | Sync REST | Per-call units | No | Per-endpoint unit cost |
| Data365 | REST | Subscription tiers | No | Monthly plans |
When another option is the better fit
- Your own account's analytics, or posting. Use the official X API, since a read-only tool cannot do either.
- Very large batch exports. If you need a one-time export of a huge handle list and latency does not matter, an async dataset vendor may suit you better.
- X only, at very high volume. If you only ever need X and your volume is massive, it can make sense to price out X Enterprise directly.
For live lookups, enrichment, multi-network work and AI agents, a single-key synchronous read is usually the simpler path. The broader buyer's view is in best X data API.
FAQ
What is a twitter profile scraper api? It is an API that takes an X handle, URL or user ID and returns that account's public profile and recent posts as structured JSON. It reads public data only and cannot post or act on the account.
Is the official X API free? No. X uses pay-per-usage credits with no free tier for new developers. User reads are $0.010 each and post reads are $0.005 each, per X's docs as of 2026-12-04.
How much does it cost to scrape 1,000 X profiles? On the official API, profile reads alone come to about $10, based on X's published rate. With SocialLens, each successful profile read costs one credit, handles that do not exist cost nothing, and the first 250 reads are free.
Can I get an account's entire post history? Usually not. X's timeline endpoint caps out at 3,200 recent posts (800 without replies), and third-party tools face similar depth limits.
Can I read protected X accounts?
No. Protected accounts return private: true, and their posts are not available through any legitimate public read.
Can an AI agent read X profiles directly?
Yes. Run npx -y sociallens-mcp with your API key, and the agent can fetch a handle's profile and posts on request.
Related guides
- Social Media APIs Compared: Official APIs vs One Public Data API
- Best X (Twitter) Data API in 2026: Profiles, Posts and Reposts
- X (Twitter) Follower Count API: Exact Counts, Following and Post Totals
- X API Alternative: Public Profile Data (2026)
- Facebook Page Scraper API: Read Public Page Profiles and Posts
- Instagram Scraper API: Public Profiles, Posts and Comments
- Best Reddit Data API in 2026: Subreddit Profiles, Posts and Comments