# xdataapi.io

> Read-only HTTP API for public X (Twitter) data: profiles, tweets, timelines, threads, replies, quotes and search.
> One credit is one tweet or one profile returned. Empty results and failed requests cost nothing.
> Credits are bought once and never expire. Base URL: https://api.xdataapi.io. Auth: header x-api-key.

Give an agent everything in one line: MCP server at https://api.xdataapi.io/mcp (Streamable HTTP, header x-api-key).
Machine-readable contract: https://api.xdataapi.io/openapi.yaml (OpenAPI 3.1). Live health: https://api.xdataapi.io/status (JSON) and https://xdataapi.io/status.
SDKs: npm xdataapi (TypeScript), PyPI xdataapi (Python).
Every response has credits_charged, balance_remaining, cache and request_id. Errors are JSON with a stable code.

## Docs

- [Quickstart](https://xdataapi.io/docs/index.md): First request in two minutes.
- [Authentication](https://xdataapi.io/docs/authentication.md): Keys, headers and rate limits.
- [Credits and billing](https://xdataapi.io/docs/credits.md): What costs what, and what is free.
- [Pagination](https://xdataapi.io/docs/pagination.md): Cursors, page size and ordering.
- [Search](https://xdataapi.io/docs/search.md): Operators, products and limits.
- [Batch reads](https://xdataapi.io/docs/batch.md): Up to 100 profiles or tweets in one request.
- [MCP server](https://xdataapi.io/docs/mcp.md): Give an agent the whole API in one line.
- [For agents](https://xdataapi.io/docs/agents.md): Hand the whole API to an LLM or agent in one line.
- [SDKs](https://xdataapi.io/docs/sdks.md): Typed clients for TypeScript and Python.
- [Errors](https://xdataapi.io/docs/errors.md): Status codes, error codes and what to do.
- [Versioning](https://xdataapi.io/docs/versioning.md): What can change inside v1, and what happens before anything is removed.

## Optional

- [API reference (OpenAPI 3.1)](https://api.xdataapi.io/openapi.yaml)
- [Status JSON](https://api.xdataapi.io/status)
- [Full docs in one file](https://xdataapi.io/llms-full.txt)
