API Anything

X (Twitter) APIunofficial

Public X (Twitter) profiles by screen name, logged out: full profile via the UserByScreenName GraphQL query, or the profile card from the server-rendered page. No tweets (the logged-out timeline query 404s).

all live 2 operations, checked by the installs that call them.

Try it

Set up API Anything for your agents:

npx -y api-anything setup

Then ask your agent, which finds this site by itself, or call it from a shell:

api-anything pull x
api-anything call x getProfile screen_name=nasa

Operations

OperationMethodLoginWritesStatus
getProfile(screen_name) -> title, screen_name, bio, avatar, banner, posts, joined, url

Profile card of an X account from its server-rendered page (meta tags): name, bio, avatar, banner, post count as displayed (e.g. "74.3K"), join month. No follower count. Fallback if getUser breaks.

GET no no Live0 confirmations
getUser(screen_name) -> rest_id, core.name, core.screen_name, core.created_at_ms, profile_bio.description, location.location, relationship_counts.followers, relationship_counts.following, tweet_counts.tweets, verification.is_blue_verified, verification.verified_type, privacy.protected, avatar.image_url, banner.image_url

Public profile of an X account by screen name: id, name, bio, location, follower/following/post counts, verification, avatar. Uses the UserByScreenName GraphQL query with the public web-app bearer; no account needed.

GET no no Live0 confirmations

Notes

No account is needed. No tweets.

  • An unknown handle returns input from both ops.
  • getProfile's title looks like "NASA (@NASA) on X".
  • getUser's avatar.image_url is the _normal (48 px) size. Replace _normal with _400x400 for a larger one.
  • getUser sends X's public bearer, which X could rotate. Then X answers 400 "Bad Authentication data" (code 215), and the call re-learns the bearer from the page (a browser run, once).

About these operations

Each operation is a request learned from X (Twitter)'s own web pages: API Anything replays it over plain HTTP and falls back to a browser when it must. Read them as JSON.

← All shared sites