# Quickstart

> First request in two minutes.

xdataapi.io is a read-only HTTP API for public X (Twitter) data: profiles, tweets, timelines, threads and search.
One credit is one tweet or one profile returned. Empty results and failed requests cost nothing.

## 1. Get a key [#1-get-a-key]

Sign in at [xdataapi.io/dashboard](https://xdataapi.io/dashboard) with your email. No password: you get a six-digit
code. Create a key there. Every new account starts with 5,000 free credits.

## 2. Make a request [#2-make-a-request]

Send the key in the `x-api-key` header. All endpoints are `GET`.

```bash
curl "https://api.xdataapi.io/v1/users/x" \
  -H "x-api-key: xd_live_..."
```

```json
{
  "data": {
    "id": "783214",
    "handle": "X",
    "name": "X",
    "followers": 60738793,
    "created_at": "2007-02-20T14:35:54Z"
  },
  "items": 1,
  "credits_charged": 1,
  "balance_remaining": 4999,
  "cache": "miss",
  "request_id": "3d4f3d1c-..."
}
```

Every response carries `items`, `credits_charged`, `balance_remaining`, `cache` and `request_id`.
Keep `request_id` when you report a problem.

## 3. Search [#3-search]

```bash
curl "https://api.xdataapi.io/v1/tweets/search?q=from:x%20since:2026-09-01&count=20" \
  -H "x-api-key: xd_live_..."
```

`q` takes the same operators as the search box on x.com. See [Search](/docs/search).

## Endpoints [#endpoints]

| Endpoint                             | Returns                           | Credits                                           |
| ------------------------------------ | --------------------------------- | ------------------------------------------------- |
| `GET /v1/users/{handle}`             | one profile                       | 1                                                 |
| `GET /v1/users/{user}/tweets`        | latest tweets of a user           | 1 per tweet                                       |
| `GET /v1/tweets/{id}`                | one tweet                         | 1                                                 |
| `GET /v1/tweets/{id}/thread`         | the tweet, its thread and replies | 1 per tweet                                       |
| `GET /v1/tweets/{id}/replies`        | direct replies to a tweet         | 1 per reply                                       |
| `GET /v1/tweets/{id}/quotes`         | tweets that quote it              | 1 per tweet                                       |
| `GET /v1/tweets/{id}/retweeters`     | accounts that retweeted it        | 0.5 per profile                                   |
| `POST /v1/users/batch`               | up to 100 profiles                | 1 per profile                                     |
| `POST /v1/tweets/batch`              | up to 100 tweets                  | 1 per tweet                                       |
| `GET /v1/tweets/search`              | advanced search                   | 1 per tweet, or per profile with `product=People` |
| `GET /v1/users/{user}/followers`     | followers                         | 0.1 per profile                                   |
| `GET /v1/users/{user}/followers/ids` | follower ids only, no profiles    | 0.02 per id                                       |
| `GET /v1/users/{user}/following`     | accounts followed                 | 0.1 per profile                                   |
| `GET /v1/me`                         | your balance and rate limit       | 0                                                 |

`{user}` accepts a numeric id or a handle. The full contract is in the [API reference](/reference).
