Pricing
from $1.50 / 1,000 results
Go to Apify Store
X Profile Scraper
Fetch public X/Twitter profile details by username or profile URL using Guest GraphQL API. No login cookies required.
Pricing
from $1.50 / 1,000 results
Rating
0.0
(0)
Developer
Actor stats
0
Bookmarked
2
Total users
1
Monthly active users
10 days ago
Last modified
Categories
Share
X Profile Scraper (Apify Actor)
Fetch public X/Twitter profile data by username or profile URL โ no login cookies required.
Uses X's internal Guest Token + GraphQL API (UserByScreenName).
Features
- Input:
usernames(@handleorhandle) and/orprofileUrls(x.com/...,twitter.com/...) - Auto-discovers rotating GraphQL
queryIdfrom X's JS bundle - Guest token refresh on expiry, 401/403, and 429
- Apify Proxy support (recommended)
Input example
{"usernames":["elonmusk","NASA"],"profileUrls":["https://x.com/OpenAI"],"delayMs":1500,"maxRetries":2,"tokenRefreshAfter":50,"proxyConfiguration":{"useApifyProxy":true}}
Output example
{"id":"44196397","screen_name":"elonmusk","name":"Elon Musk","bio":"...","followers_count":237726440,"following_count":1305,"tweet_count":100356,"is_blue_verified":true,"profile_image_url":"https://pbs.twimg.com/profile_images/.../photo_400x400.jpg","profile_url":"https://x.com/elonmusk","scrape_method":"guest_graphql","scraped_at":"2026-06-08T12:00:00.000Z"}
Local development
npminstallapify run
Or with a local input file at storage/key_value_stores/default/INPUT.json.
Limitations
- Profiles only โ no tweets, followers, or search
- Public data โ protected accounts return limited info
- X rotates GraphQL query IDs every few weeks; this actor discovers them at runtime
- Datacenter IPs are often blocked โ use Apify Proxy
Project structure
.actor/ Actor metadata and input schemasrc/main.js Entry point and orchestrationsrc/guestToken.js Guest token acquisitionsrc/graphql.js GraphQL profile fetchsrc/queryIds.js Dynamic queryId discoverysrc/parseProfile.js Response parsingsrc/normalizeInput.js Username /URL normalization
