Skip to content
scrapeatlas.Dashboard

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.

6 endpointsx-api-key

Retrieve public X profiles, tweets, timelines, highlights, communities and community posts, with optional compact records.

API availability: Available

Base URL · local workerhttp://localhost:3036Public API: https://api.scrapeatlas.com.
Authenticationx-api-keyCustomer key from your account. See Authentication.

Endpoints

GET/v1/twitter/profile

Get 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
GET/v1/twitter/user-tweets

List 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
GET/v1/twitter/user-highlights

Get 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
GET/v1/twitter/tweet

Get 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
GET/v1/twitter/community

Get 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
GET/v1/twitter/community/tweets

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

Reference

Quick start

Create an API key on your account page, then call the public API. Values below are placeholders.

Terminal
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.
Error codes
15
HTTPfailure.codeMeaning
400invalid_requestMissing, duplicate, malformed or unsupported parameters, handles or URLs.
401unauthorizedInvalid API key.
404not_foundUnknown handle, tweet or community.
403restricted_pageThe account is suspended or unavailable, or the tweet is withheld, protected or age-restricted for logged-out visitors.
429upstream_rate_limitedX rate limited guest activation or the GraphQL read.
502upstream_challengedX refused the guest token or the request (status challenged).
502operation_unavailableX no longer serves the pinned persisted query for this operation.
502unsafe_redirectX answered the API request with a redirect.
502unsupported_pageThe GraphQL result is missing, mismatched or structurally unsupported.
502response_too_largeThe operation’s response byte budget was exceeded.
502payload_too_complexThe response exceeded the JSON depth or node limits.
502request_limitThe upstream request budget was exhausted.
502upstream_errorNetwork failure, HTTP 5xx after the single retry, or X returned the post without its author and text.
503busyAll retrieval slots are busy.
504timeoutThe operation’s deadline elapsed.