> ## Documentation Index
> Fetch the complete documentation index at: https://docs.full-tiktok-api.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> How to authenticate requests to the TikTok Intel API.

## Overview

The TikTok Intel API is distributed exclusively through **RapidAPI**. Authentication is handled by passing your RapidAPI subscription key in a request header — no OAuth flows, no token rotation, no expiry management.

<Note>
  If you call the API directly (not through the RapidAPI gateway), you must include the `x-rapidapi-key` header manually. When using RapidAPI's built-in proxy or code snippets, the header is injected automatically.
</Note>

## Getting a key

1. Go to the [TikTok Intel API listing on RapidAPI](https://rapidapi.com/search/tiktok-intel).
2. Click **Subscribe to Test** and select a plan.
3. Your key is shown in the **Security** section of the API playground — copy it.

## Sending the header

Add `x-rapidapi-key` to every request:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET \
    "https://tiktok-marketing-intelligence-api-production.up.railway.app/api/v1/users/charlidamelio" \
    -H "x-rapidapi-key: YOUR_API_KEY"
  ```

  ```python Python theme={null}
  import requests

  headers = {
      "x-rapidapi-key": "YOUR_API_KEY"
  }

  response = requests.get(
      "https://tiktok-marketing-intelligence-api-production.up.railway.app/api/v1/users/charlidamelio",
      headers=headers
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://tiktok-marketing-intelligence-api-production.up.railway.app/api/v1/users/charlidamelio",
    {
      headers: {
        "x-rapidapi-key": "YOUR_API_KEY"
      }
    }
  );
  const data = await response.json();
  ```

  ```typescript TypeScript theme={null}
  const res = await fetch(
    "https://tiktok-marketing-intelligence-api-production.up.railway.app/api/v1/users/charlidamelio",
    {
      headers: { "x-rapidapi-key": process.env.RAPIDAPI_KEY! }
    }
  );
  const data = await res.json();
  ```
</CodeGroup>

## Error responses

| HTTP status             | `error.code`   | Meaning                                           |
| ----------------------- | -------------- | ------------------------------------------------- |
| `401 Unauthorized`      | `UNAUTHORIZED` | Key missing or malformed                          |
| `403 Forbidden`         | `FORBIDDEN`    | Key valid but plan does not include this endpoint |
| `429 Too Many Requests` | `RATE_LIMITED` | Monthly quota or per-second rate limit exceeded   |

## Rate limits

Rate limits are enforced by RapidAPI based on your plan tier. Check your current plan on the RapidAPI dashboard. If you need higher throughput, upgrade or contact us.
