# Introduction

> TwittrAPI is a REST API for public Twitter/X data. Send your key in a header, get X's JSON back, pay per call from a prepaid balance.

HTML page: https://www.twittrapi.com/docs

TwittrAPI is a REST API for public X (Twitter) data: profiles, tweets, followers, search, lists, communities, jobs and trends. You do not need an X developer account. TwittrAPI is not affiliated with X Corp.

## How it works

- **Base URL:** `https://api.twittrapi.com`
- **Auth:** your API key in the `X-API-KEY` header. See [Authentication](https://www.twittrapi.com/docs/helpful-infos/authentication).
- **Requests:** plain HTTPS. Read endpoints are `GET` with path and query parameters.
- **Responses:** the JSON that X's own web app receives, passed through unchanged, with a few documented exceptions. See [Response format](https://www.twittrapi.com/docs/response-format).
- **Billing:** one call is one billed request, from a prepaid balance. Calls that fail with 400, 407, 408, 409 or a 5xx error are refunded. See [Pricing and billing](https://www.twittrapi.com/docs/billing).
- **Limits:** a per-key limit in requests per second. See [Rate limits](https://www.twittrapi.com/docs/helpful-infos/rate-limits).

```bash
curl 'https://api.twittrapi.com/user/by/username/jack' \
  --header 'X-API-KEY: YOUR_API_KEY'
```

## Where to go next

- [First request](https://www.twittrapi.com/docs/getting-started): get a key and make a call with curl, Python, Node.js or Go.
- [API reference](https://www.twittrapi.com/docs/reference): every read endpoint with parameters, limits, errors and examples.
- [Account actions](https://www.twittrapi.com/docs/account-actions): post, reply, like, follow, DMs, lists and more with your own X account, cookie and proxy.
- [SDKs and integrations](https://www.twittrapi.com/docs/integrations): Python, Node.js and Go clients, an MCP server, n8n, LangChain, LlamaIndex, Apify and Make.
- [For AI agents](https://www.twittrapi.com/docs/for-agents): how an agent gets a key, the MCP server, budget and retry rules. Machine-readable: [OpenAPI spec](https://www.twittrapi.com/openapi.json), [all docs in one Markdown file](https://www.twittrapi.com/llms-full.txt), [pricing as JSON](https://www.twittrapi.com/pricing.json).
- Switching from another provider? Migration guides with endpoint mappings: [from twitterapi.io](https://www.twittrapi.com/guides/migrate-from-twitterapi-io), [from SocialData](https://www.twittrapi.com/guides/migrate-from-socialdata) and [from the official X API](https://www.twittrapi.com/guides/migrate-from-official-x-api).

## What you can and cannot get

The read endpoints return public data only: what a logged-out visitor or any logged-in user could see. Protected accounts and other private content are not available through them.

Write endpoints act on your own X account: post (with media, a poll or a schedule), reply, like, retweet, follow, bookmarks, mute, block, lists, communities, drafts, profile, media upload and direct messages. They need [your X session cookie](https://www.twittrapi.com/docs/x-session) and your own proxy, and cost the same per call as reads. See [Account actions](https://www.twittrapi.com/docs/account-actions).
