Social networks
X (Twitter) API
Retrieve public X (Twitter) profiles, a user's newest public tweets and highlights, single tweets, and communities and their posts exactly as X's own web client receives them, without an account.
Retrieve public X profiles, tweets, timelines, highlights, communities and community posts, with optional compact records.
API availability: Available
http://localhost:3036Public API: https://api.scrapeatlas.com.Endpoints
/v1/twitter/profileGet an X (Twitter) profile
Retrieve a public X profile by handle: the raw UserByScreenName user object with identity, bio, entities, counters, images, verification and affiliation labels, tip jar, highlights and business fields.
Reference/v1/twitter/user-tweetsList an X (Twitter) user's public tweets
Retrieve a profile's public tweets, newest first by default or in X's ranked order, with the pinned tweet flagged and a URL for each tweet.
Reference/v1/twitter/user-highlightsGet an X (Twitter) user’s highlights
Retrieve the posts an X account selected for its Highlights tab, with each tweet’s author, text, media, engagement counters and original URL. Use trim=true for compact tweet records.
Reference/v1/twitter/tweetGet an X (Twitter) tweet
Retrieve one public tweet by permalink: the raw TweetResultByRestId tweet object with its author, text, entities, media, quoted or retweeted tweet, note text for long posts, engagement counters and views.
Reference/v1/twitter/communityGet an X (Twitter) community
Retrieve a public X community by URL: the raw CommunityQuery object with name, description, member count, join policy, rules, creator, banners, member face pile and trending hashtags.
Reference/v1/twitter/community/tweetsGet an X (Twitter) community’s tweets
Retrieve posts from a public X community, with each tweet’s text, author, media, engagement counters and original URL.
ReferenceQuick start
Create an API key on your account page, then call the public API. Values below are placeholders.
curl "https://api.scrapeatlas.com/v1/twitter/profile?handle=example" \
-H "x-api-key: YOUR_API_KEY"Coverage & limits
- Handle operations accept 1–15 letters, digits or underscores, with an optional leading @.
- Tweet Details accepts X or Twitter status permalinks, including /i/web/status/{id} and /i/status/{id}; query strings and fragments are ignored.
- Community operations accept https://x.com/i/communities/{id} URLs, with twitter.com accepted as well.
- User Tweets accepts sort=latest or ranked and optional since and until publication dates or ISO timestamps.
- User Tweets, User Highlights and Tweet Details accept trim=true for compact tweet records.
| HTTP | failure.code | Meaning |
|---|---|---|
| 400 | invalid_request | Missing, duplicate, malformed or unsupported parameters, handles or URLs. |
| 401 | unauthorized | Invalid API key. |
| 404 | not_found | Unknown handle, tweet or community. |
| 403 | restricted_page | The account is suspended or unavailable, or the tweet is withheld, protected or age-restricted for logged-out visitors. |
| 429 | upstream_rate_limited | X rate limited guest activation or the GraphQL read. |
| 502 | upstream_challenged | X refused the guest token or the request (status challenged). |
| 502 | operation_unavailable | X no longer serves the pinned persisted query for this operation. |
| 502 | unsafe_redirect | X answered the API request with a redirect. |
| 502 | unsupported_page | The GraphQL result is missing, mismatched or structurally unsupported. |
| 502 | response_too_large | The operation’s response byte budget was exceeded. |
| 502 | payload_too_complex | The response exceeded the JSON depth or node limits. |
| 502 | request_limit | The upstream request budget was exhausted. |
| 502 | upstream_error | Network failure, HTTP 5xx after the single retry, or X returned the post without its author and text. |
| 503 | busy | All retrieval slots are busy. |
| 504 | timeout | The operation’s deadline elapsed. |