FetchPI
Log in
← Browse all APIs

X Data API

X profiles, posts, replies, follower graphs and trends through one REST interface that returns normalized JSON.

  • 10 capability families
  • 10 documented endpoints

Endpoints by capability family

profile

1 documented endpointsOpen the profile capability page →

Account identity: profile lookups with bio, verification and audience fields as normalized JSON.

MethodPathCapability
GET/v1/x/users/{username}x.profile

user_posts

1 documented endpointsOpen the user_posts capability page →

Publishing and activity feeds: what an account, hashtag or music page has posted, in order.

MethodPathCapability
GET/v1/x/users/{username}/postsx.user_posts

post

1 documented endpointsOpen the post capability page →

Single-content lookups: one post and what is attached to it — comments, likers, media — normalized.

MethodPathCapability
GET/v1/x/posts/{id}x.post

comments

1 documented endpointsOpen the comments capability page →

Single-content lookups: one post and what is attached to it — comments, likers, media — normalized.

MethodPathCapability
GET/v1/x/posts/{id}/commentsx.comments

search_posts

1 documented endpointsOpen the search_posts capability page →

Search and trends: keyword search over posts and accounts, hot lists and trending topics.

MethodPathCapability
GET/v1/x/search/postsx.search_posts

user_followers

1 documented endpointsOpen the user_followers capability page →

Relationship graphs: follower and following lists as paginated, normalized JSON.

MethodPathCapability
GET/v1/x/users/{username}/followersx.user_followers

user_following

1 documented endpointsOpen the user_following capability page →

Relationship graphs: follower and following lists as paginated, normalized JSON.

MethodPathCapability
GET/v1/x/users/{username}/followingx.user_following

user_replies

1 documented endpointsOpen the user_replies capability page →

Publishing and activity feeds: what an account, hashtag or music page has posted, in order.

MethodPathCapability
GET/v1/x/users/{username}/repliesx.user_replies

user_media

1 documented endpointsOpen the user_media capability page →

Single-content lookups: one post and what is attached to it — comments, likers, media — normalized.

MethodPathCapability
GET/v1/x/users/{username}/mediax.user_media

trends

1 documented endpointsOpen the trends capability page →

Search and trends: keyword search over posts and accounts, hot lists and trending topics.

MethodPathCapability
GET/v1/x/trendsx.trends

Frequently asked questions

The documented surface spans profiles, single posts, comment threads, account activity (posts, replies, media), the follower and following graphs, post search and the trends endpoint — 10 endpoints in all, each with its own reference page.

About the X Data API

What is the X Data API?

The X Data API is FetchPI's read interface for X: documented REST endpoints that return publicly available X data as structured JSON. Instead of parsing pages or maintaining a per-platform scraper, you call an endpoint and read a normalized response with stable field names — the same schema shape every FetchPI platform uses. All 10 documented endpoints belong to capability families, each with its own reference page, parameter table and examples.

What data can the X Data API retrieve?

The API covers the X capability families listed in the table above: 10 families and 10 endpoints, each documented with its parameters and response schema. Typical workloads include profile enrichment, post and comment collection, follower-graph analysis, keyword monitoring and trend tracking. The exact fields a family returns are documented on its capability page — the API does not promise any data type that is not in the contract.

Capability families published for X today:

  • profile
  • user_posts
  • post
  • comments
  • search_posts
  • user_followers
  • user_following
  • user_replies
  • user_media
  • trends

How to use the X Data API

Three steps from zero to the first response:

Step 1 — Create a free account

Register in the console. A workspace is provisioned automatically and sign-up includes free Credits for your first calls.

Step 2 — Grab your API key

Create a key in the console and send it as a standard Authorization: Bearer header on every request.

Step 3 — Call an endpoint

Start with a documented endpoint such as GET /v1/x/users/{username} and read the normalized JSON from the response. The copy-paste example below uses the contract's demo values:

curl -H "Authorization: Bearer $MESHDATA_API_KEY" \
  "https://api.fetchpi.com/v1/x/users/newdev"

How data freshness works

Every endpoint accepts the freshness parameters the whole Data API shares: cache answers from the stored snapshot without touching the upstream, live queries fresher data and may cost extra credits, and max_age caps the acceptable data age in seconds. The response meta block reports the mode, age and serving layer that produced each answer, so downstream systems can act on freshness instead of guessing it. What the API does not promise is real-time upstream state — the meta block is the honest report of what you got.

The X Data API compared with building your own scraper

A self-built X scraper owns the happy path and everything after it: page layouts change, anti-bot measures tighten, and every parser fix lands on your roadmap. The Data API turns that maintenance into a contract — documented request and response schemas, published error codes for the not-found and rate-limited cases, and one integration shape reused across every FetchPI platform. The scope stays honest on both sides: the API serves publicly available data only, never asks for your account credentials, and is not an official X product.

Why teams use FetchPI for X data

Three reasons that show up in the integration, not just the pitch:

  • One normalized schema — X responses use the same field structure as every other FetchPI platform, so a multi-platform pipeline parses once.
  • Transparent freshness — every response reports its freshness mode, age and serving layer; you choose cache or live per request and pay accordingly.
  • Usage-based billing — per-request Credits with published per-capability prices, no seats and no flat plans; the meta block reports what each call consumed.

Costs and limits

Billing is per request in Credits: each capability has a published per-call price, cache answers cost less than live fetches, and top-ups are self-serve. Endpoints are rate-limited — a throttled call returns the documented RATE_LIMIT_EXCEEDED error rather than a silent failure — and every response's meta block reports the credits it consumed. Current per-capability prices live on the pricing page; the docs carry the full error-code and rate-limit reference.

View pricing →