xdataapi.io

xdataapi.io API

Read-only X (Twitter) data API. One credit is one tweet or one profile returned. Empty results and failed requests cost nothing. Every response carries…

Social#social

Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.

Overview

Read-only X (Twitter) data API. One credit is one tweet or one profile returned.
Empty results and failed requests cost nothing. Every response carries
credits_charged, balance_remaining, cache and request_id.

Batch reads: /v1/users/batch and /v1/tweets/batch take up to 100 handles or ids per call.
MCP: the same data is served to agents at https://api.xdataapi.io/mcp (Streamable HTTP, same key).
Docs for agents: https://xdataapi.io/llms.txt.

Versioning and deprecation

The major version is in the path: every endpoint begins /v1/. Inside a major
version we only add — new endpoints, new optional parameters, new fields on an
object. Adding a field is not a breaking change, so parse defensively and ignore
what you do not know.

A change that would break a caller opens /v2/ instead. When that happens /v1/
keeps answering for at least 12 months, and every /v1/ response carries the
notice for the whole of that period:

  • Deprecation: — when the version was declared deprecated (RFC 9745).
  • Sunset: — the earliest date it may stop answering (RFC 8594).
  • Link: ; rel="deprecation" — what changed

and how to move.

No header, no sunset: absence of Sunset on a response is the promise that this
version is not going away inside the notice period. Nothing is ever removed from
/v1/ without it.

Rate limits

Every /v1/ response carries RateLimit and RateLimit-Policy (RFC 9331), on a
refusal as much as on a success, so a client can throttle without first being
refused. A 429 also carries Retry-After in whole seconds. The limit is per
account, not per key, and rises with the total paid: 1 request per second before
the first pack, 20 from it, up to 200.

The keyless endpoints — GET /, /status, /healthz and /openapi.yaml — carry
the same two headers under a separate policy named public: 10 requests per second
per address. That is far above any real caller and exists to stop a loop, not to
ration a public document.

Errors

Every failure is one shape, documented as Error below: an error object with a
stable machine-readable code, a human-readable message, and the request_id
to quote in support. The same body is served as application/problem+json
(RFC 9457) to callers that ask for it, with type, title, status and
detail alongside the same fields. Failed requests are never charged.

Endpoints 17

users

  • POSTProfiles by handle or by user id, batch/v1/users/batchUp to 100 profiles in one call, by handle (handles) or by numeric user id (ids). Send one of the two lists. The id stays the same when a user changes the…
  • GETProfile by user id/v1/users/id/:idThe same profile as /v1/users/{handle}, found by the numeric user id. The id stays the same when a user changes the handle, so it is the key to store. 1…
  • GETProfile by handle/v1/users/:handle1 credit per profile.
  • GETLatest tweets of a user/v1/users/:user/tweets1 credit per tweet. user is a numeric id or a handle.
  • GETFollowers of a user/v1/users/:user/followers0.1 credit per user returned. Up to 200 per page. Availability depends on the reading session's trust level at X: some sessions get HTTP 403 access_denied (X…
  • GETFollower ids of a user/v1/users/:user/followers/idsNumeric user ids only, no profiles. 0.02 credit per id. Up to 200 per page. It is the same page /followers reads, so a page fetched through either endpoint is…
  • GETAccounts a user follows/v1/users/:user/following0.1 credit per user returned. Up to 200 per page. Same availability note as followers.

tweets

  • GETAdvanced search/v1/tweets/search?q=from:x since:2026-09-011 credit per tweet, or per profile with product=People (then data is a list of User). q accepts X advanced search operators (from:, since:, until:,…
  • POSTTweets by id, batch/v1/tweets/batchUp to 100 tweets in one call. 1 credit per tweet found; deleted or private tweets are listed in errors and cost nothing. Results in input order. Also GET…
  • GETTweet by id/v1/tweets/:id1 credit.
  • GETTweet with its thread and replies/v1/tweets/:id/thread1 credit per tweet returned. The focal tweet comes first.
  • GETDirect replies to a tweet/v1/tweets/:id/replies1 credit per reply. Only replies to this tweet, not the thread above it or nested replies. Use cursor for more.
  • GETTweets that quote a tweet/v1/tweets/:id/quotes1 credit per tweet, newest first. Up to 50 per page.
  • GETAccounts that retweeted a tweet/v1/tweets/:id/retweeters0.5 credit per profile. Up to 200 per page. Not every reading session at X may read this; then the answer is 403 and free.

account

  • GETKey, balance and rate limit/v1/me

billing

  • GETCredit packs on sale/v1/billing/packs
  • POSTBuy a credit pack/v1/billing/checkoutReturns a Stripe Checkout URL. Open it in a browser; after payment the credits land in the wallet of the key's account within seconds. The rate limit follows…

API details

Base URL
https://api.xdataapi.io
Authentication
An API key in the x-api-key header
OAuth 2.0 (authorization code flow) with 1 scope
Operations
17 operations on 17 pathsGET 14POST 3
Main resources
tweets 7users 7billing 2account 1
Response formats
application/json
Description format
OpenAPI 3.1.0, API version 0.3.0

How to test the xdataapi.io API in Swastik Codes

  1. Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
  2. Fork it into your workspaceChoose a workspace. You get your own copy of the xdataapi.io API collection, without the publisher's secrets.
  3. Add your credentialsThis API uses an API key in the x-api-key header. Add yours in the collection's variables or an environment; the requests already reference it.
  4. Send a requestPick an endpoint, for example “Profiles by handle or by user id, batch” (POST /v1/users/batch), and press Send. Check the response, add tests and run the whole collection with the runner.

Frequently asked questions

What is the xdataapi.io API?

Read-only X (Twitter) data API. One credit is one tweet or one profile returned. Empty results and failed requests cost nothing. Every response carries… It is listed under Social and has 17 endpoints.

Who publishes the xdataapi.io API?

It is listed from xdataapi.io's public API description (an OpenAPI document), not published by xdataapi.io on Swastik Codes. Anyone who controls xdataapi.io can claim the profile by adding a DNS TXT record.

What is the base URL of the xdataapi.io API?

Requests go to https://api.xdataapi.io. Endpoint paths are added to this base URL.

How do I authenticate with the xdataapi.io API?

It accepts 2 methods: an API key in the x-api-key header; OAuth 2.0 (authorization code flow) with 1 scope.

How many endpoints does the xdataapi.io API have?

17 operations on 17 paths (14 GET, 3 POST). The largest groups are tweets, users, billing, account.

Is forking the xdataapi.io API free?

Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.

Suggest an API

Tell us which public API is missing. We check it, then add it here with its endpoints when it has an OpenAPI (Swagger) description.