# Quickstart

Get a key (a free trial with $0.10 of credit), make one call, read the answer: about 2 minutes, and each of the 21 platforms after this works the same way.

## Three steps

### 1. Get a key

[Sign in](https://dataxapi.com/signin/) with a 6-digit code sent to your email, or with Google. There is no password. A new account can try it free ($0.10 of credit), once per email: enough for 50 calls at $0.0020.

Your first key is shown once, right after sign-up. Copy it then: it cannot be read back later. Keep it in the environment variable `DATAXAPI_API_KEY`, never in code.

```bash
export DATAXAPI_API_KEY="<your key>"
```

### 2. Make a call

This calls `tiktok.videos.search`, [TikTok video search](https://dataxapi.com/apis/tiktok/videos/search/). Every other endpoint is called the same way.

cURL

```bash
curl -G "https://api.dataxapi.com/v1/tiktok/videos/search" \
  --data-urlencode "query=space station" \
  -H "Authorization: Bearer $DATAXAPI_API_KEY"
```

Python

```python
from dataxapi import DataXAPI

dx = DataXAPI()  # reads DATAXAPI_API_KEY
result = dx.tiktok.videos.search(query="space station")
print(result["data"]["items"])
```

TypeScript

```ts
import { DataXAPI } from "@dataxapi/sdk";

const dx = new DataXAPI(); // reads DATAXAPI_API_KEY
const result = await dx.tiktok.videos.search({ query: "space station" });
console.log(result.data.items);
```

CLI

```bash
dataxapi call tiktok.videos.search 'query=space station'
```

The Python and TypeScript forms use the [SDK](https://dataxapi.com/docs/sdk/); the last one uses the [command line](https://dataxapi.com/docs/cli/).

The price is $0.0020 a call. A call that fails costs nothing. [Run it in the Playground](https://dataxapi.com/console/playground/): it needs a sign-in and runs on your own balance.

This is a recorded response, cut to its first item. Names, text, IDs and links are examples, not the recorded ones; the figures are as recorded, and the request ID, the cursor and the balance are made up.

```json
{
  "code": "ok",
  "request_id": "eecdbf3f-64ce-4b11-b396-ee190d7ff728",
  "data": {
    "items": [
      {
        "id": "7566364515678793552",
        "url": "https://www.tiktok.com/@trail_and_lens/video/7566364515678793552",
        "type": "video",
        "text": "My honest take on space station, a month in.",
        "lang": "en",
        "published_at": "2026-10-11T23:17:34.000Z",
        "author": {
          "id": "6279025233109159764",
          "username": "trail_and_lens",
          "name": "Maya Chen",
          "avatar_url": "https://p16-sign-va.tiktokcdn.com/tos-maliva-avt-0068/fff322a0d982cccf1e82~c5_100x100.jpeg",
          "followers": 92601
        },
        "metrics": {
          "likes": 353,
          "comments": 11,
          "shares": 19,
          "favorites": 40,
          "views": 7561
        },
        "hashtags": [
          "weekendvibes",
          "gearreview"
        ],
        "mentions": []
      }
    ]
  },
  "page": {
    "next_cursor": "c1.bGY_kn5Dxsgl6MN3VXHyMcLAdlxPxQw-FwjswIlE",
    "cursor_expires_at": "2026-10-12T20:17:24.000Z",
    "has_more": true,
    "returned": 30
  },
  "warnings": [],
  "meta": {
    "capability": "tiktok.videos.search",
    "result_status": "complete",
    "fetched_at": "2026-10-12T19:17:24.000Z",
    "cached": false,
    "replayed": false,
    "unavailable": {
      "title": "platform",
      "images": "capability",
      "author.verified": "capability",
      "metrics.reposts": "capability",
      "mentions.username": "capability",
      "mentions.name": "capability",
      "post_id": "platform",
      "parent_id": "platform",
      "root_id": "platform",
      "is_pinned": "capability"
    },
    "billing": {
      "amount": "0.002",
      "currency": "USD",
      "balance_after": "9.998"
    }
  }
}
```

Four things to know:

- `data.items`: The data: a list of standard objects, here [post](https://dataxapi.com/docs/objects/post/). The same object has the same fields on every platform.
- `page.next_cursor`: Pass it back as `cursor` to get the next page; `null` when there is none. Each page is a call of its own.
- `meta.unavailable`: The fields this endpoint cannot give, each with the reason. A field that is absent from `data.items` and listed here is not a fault.
- `meta.billing`: What this call was charged (`amount`) and the balance after it (`balance_after`).

> A call that fails answers in one structure instead: `code`, `message`, `charged`, `retry`. Too little balance, for one, is [`insufficient_balance`](https://dataxapi.com/docs/errors/#insufficient_balance) with `charged` false: nothing was taken. Every code is on the [error codes](https://dataxapi.com/docs/errors/) page.

### 3. Connect your AI

No code needed: copy this sentence into an AI that can act, such as Claude Code, Cursor or Codex. It reads the setup page and connects the MCP server; from then on you ask in plain words.

```text
Read https://dataxapi.com/agents.md and set up DataXAPI in this agent. My API key is dx_…; use it for every DataXAPI call.
```

> Put your own key where `dx_…` is. The Console's [connect page](https://dataxapi.com/console/connect/) copies the same sentence with a key made for that agent.

To set it up by hand, the MCP address is `https://api.dataxapi.com/mcp`. Once connected, your AI gets 5 tools:

- `find`: Finds the endpoint for a question.
- `describe`: Reads up to 5 endpoints in full: parameters, fields, price.
- `call`: Runs one endpoint and returns one page of data.
- `read_more`: Re-reads a result for 24 hours.
- `account`: Balance, usage and receipts.

## Next

- [Authentication](https://dataxapi.com/docs/authentication/): more keys, each with its own limit, expiry and scope.
- [Requests and responses](https://dataxapi.com/docs/requests/): the parameter names and the envelope, the same on all 21 platforms.
- [Pagination](https://dataxapi.com/docs/pagination/) and [billing](https://dataxapi.com/docs/billing/): what the next page is and what it costs.
- [Rate limits](https://dataxapi.com/docs/rate-limits/) and [error codes](https://dataxapi.com/docs/errors/): when to wait and when to stop.
- [SDKs](https://dataxapi.com/docs/sdk/), the [command line](https://dataxapi.com/docs/cli/) and the [MCP server](https://dataxapi.com/docs/mcp/).
- [All 207 endpoints](https://dataxapi.com/apis/), each on a page with its price.

---

Catalog revision c48ce454ae6c4c65. [HTML version](https://dataxapi.com/docs/quickstart/)
