> Documentation index: https://docs.scrapier.io/llms.txt
> Auth: header `X-API-Key: <key>` · Base: https://api.scrapier.io/api/v2 · Synchronous; paginate with `cursor` ← `data.next_cursor`.

# TikTok Users Audience Demographics

Structured TikTok data: send `usernames`. Cursor-paginated, 3 credits per successful call.

`GET|POST https://api.scrapier.io/api/v2/tiktok-users-audience-demographics/` · 3 credits per successful call · Cursor-paginated

## Overview

Call `GET /api/v2/tiktok-users-audience-demographics/` with `usernames`. The results are in `data.demographics`; send `data.next_cursor` back as `cursor` to get the next page. 5 optional parameters refine the call (see Parameters).

## Request

```bash
curl -G "https://api.scrapier.io/api/v2/tiktok-users-audience-demographics/" \
  -H "X-API-Key: YOUR_API_KEY" \
  --data-urlencode "usernames=shakira" \
  --max-time 210
```

```python
import requests

resp = requests.get(
    "https://api.scrapier.io/api/v2/tiktok-users-audience-demographics/",
    headers={"X-API-Key": "YOUR_API_KEY"},
    params={"usernames": "shakira"},
    timeout=210,
)
body = resp.json()
if not resp.ok:
    raise RuntimeError(body.get("error") or body.get("detail"))

print(body["data"]["demographics"])
```

POST with a JSON body works too (same parameters; the body is merged over the query string).

## Parameters

| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| `X-API-Key` (header) | string | yes | — | Your API key. |
| `usernames` | string | yes | e.g. `shakira` | TikTok handle or profile URL: "shakira", "@shakira" or "https://www.tiktok.com/@shakira". One profile per call (single lookup, next_cursor is always null). |
| `cursor` | string | no | — | Pagination cursor returned in the previous response's `next_cursor`. Pass it back unchanged to fetch the next page. When `next_cursor` is null, you have reached the last page. |
| `sample_size` | integer | no | `40` | Recent followers to sample (default 40). v2 runs synchronously, so it is CAPPED at 40 here and the whole lookup has a 40s deadline: if it runs out, the followers located so far are returned with status "partial" + a `warning`. Use v1 (async) for up to 500 (richer sample). |
| `sample_spread_hours` | integer | no | `12` | Spread the sample over the last N hours of follows; 0 = most recent followers first. |
| `videos_per_follower` | integer | no | `1` | Latest public videos checked per follower (1-5); >1 = majority vote. Multiplies runtime. |
| `max_countries` | integer | no | — | Cap the audience_locations rows (sorted by count desc). Empty = all. |
| `use_proxy` | boolean | no | `true` | Route the request through Scrapier's residential proxy pool. Default: `true`. Leave as is unless support tells you otherwise. |
| `raw_data` | boolean | no | `false` | When true, the response carries the full raw upstream payload(s) the scraper received (GraphQL / JSON API bodies, HTML, embedded JSON-LD -- exactly as the platform returned them) under `raw_responses`, in place of the formatted items. When false (default) you get the formatted output. Pagination (`cursor` / `next_cursor`) works the same in both modes. |

## Response

HTTP 200. Results are in `data.demographics`. Sample from the live catalog, arrays trimmed to 3 items.

```json
{
  "success": true,
  "data": {
    "usernames": "shakira",
    "demographics": {
      "input_username": "shakira",
      "username": "shakira",
      "profile_url": "https://www.tiktok.com/@shakira",
      "status": "ok",
      "note": null,
      "warning": null,
      "error": null,
      "nickname": "Shakira",
      "user_id": "168541398546182144",
      "verified": true,
      "followers": 56808125,
      "profile": {
        "user_id": "168541398546182144",
        "unique_id": "shakira",
        "nickname": "Shakira",
        "verified": true,
        "private_account": false,
        "language": "en",
        "followers": 56808125,
        "following": 75,
        "likes": 525536532,
        "videos": 436,
        "bio_link": "https://linktr.ee/shakira"
      },
      "sample": {
        "followers_total": 56808125,
        "followers_requested": 40,
        "followers_sampled": 60,
        "followers_checked": 60,
        "followers_located": 35,
        "followers_private": 12,
        "followers_no_videos": 13,
        "followers_failed": 0,
        "followers_unchecked": 0,
        "coverage": "58.33%",
        "videos_per_follower": 1,
        "sample_spread_hours": 12,
        "follower_pages": 2,
        "time_windows_used": 2,
        "order": "spread evenly over the last 12h of follows",
        "method": "country where each sampled follower's latest public video(s) were created (TikTok locationCreated); private accounts and accounts without public videos cannot be located as a guest"
      },
      "countries_found": 18,
      "top_country": {
        "country": "Bangladesh",
        "country_code": "BD",
        "count": 6,
        "percentage": "17.14%",
        "continent": "Asia"
      },
      "audience_locations": [
        {
          "country": "Bangladesh",
          "country_code": "BD",
          "count": 6,
          "percentage": "17.14%",
          "continent": "Asia"
        },
        {
          "country": "Pakistan",
          "country_code": "PK",
          "count": 4,
          "percentage": "11.43%",
          "continent": "Asia"
        },
        {
          "country": "Mexico",
          "country_code": "MX",
          "count": 3,
          "percentage": "8.57%",
          "continent": "North America"
        }
      ],
      "audience_continents": [
        {
          "continent": "Asia",
          "count": 15,
          "percentage": "42.86%"
        },
        {
          "continent": "Africa",
          "count": 11,
          "percentage": "31.43%"
        }
      ],
      "elapsed_seconds": 9.4,
      "requests_made": 92,
      "scraped_at": "2026-09-19T00:00:00.000Z"
    },
    "next_cursor": null
  }
}
```

## Response fields

| Field | Type | Example | Description |
|---|---|---|---|
| `usernames` | string | `shakira` |  |
| `demographics` | object | `{…}` | The results. |
| `next_cursor` | null | `null` | Pass back as `cursor` for the next page. `null` on the last page. |
| `demographics.input_username` | string | `shakira` |  |
| `demographics.username` | string | `shakira` |  |
| `demographics.profile_url` | string | `https://www.tiktok.com/@shakira` |  |
| `demographics.status` | string | `ok` |  |
| `demographics.note` | null | `null` |  |
| `demographics.warning` | null | `null` |  |
| `demographics.error` | null | `null` |  |
| `demographics.nickname` | string | `Shakira` |  |
| `demographics.user_id` | string | `168541398546182144` |  |
| `demographics.verified` | boolean | `true` |  |
| `demographics.followers` | integer | `56808125` |  |
| `demographics.profile` | object | `{…}` |  |
| `demographics.sample` | object | `{…}` |  |
| `demographics.countries_found` | integer | `18` |  |
| `demographics.top_country` | object | `{…}` |  |
| `demographics.audience_locations` | array | `[3 items]` |  |
| `demographics.audience_continents` | array | `[2 items]` |  |
| `demographics.elapsed_seconds` | number | `9.4` |  |
| `demographics.requests_made` | integer | `92` |  |
| `demographics.scraped_at` | string | `2026-09-19T00:00:00.000Z` |  |

## Pagination

Pass `data.next_cursor` back as `cursor` until it is `null`. Required inputs are ignored once a cursor is sent. Each page is one billed call.

```python
import requests

URL = "https://api.scrapier.io/api/v2/tiktok-users-audience-demographics/"
HEADERS = {"X-API-Key": "YOUR_API_KEY"}
params = {"usernames": "shakira"}
items = []

for _ in range(10):  # each page is one billed call
    resp = requests.get(URL, headers=HEADERS, params=params, timeout=210)
    resp.raise_for_status()
    data = resp.json()["data"]
    items.append(data.get("demographics"))
    if not data.get("next_cursor"):  # None = last page
        break
    params = {"cursor": data["next_cursor"]}
```

## Errors

Failed calls are free. Branch on HTTP status; the message is in `error` (or `detail`). See https://docs.scrapier.io/errors.md

- **400** Bad input. The exact message varies by endpoint. `{"success":false,"error":"…"}`
- **402** Balance below the endpoint's price. `{"error":"Insufficient credits. Buy more to scrape more.","balance":1,"required":2}`
- **403** Invalid or unknown API key. `{"detail":"Authentication service unavailable or invalid API key."}`
- **429** Throttled — wait for Retry-After. `{"detail":"Request was throttled. Expected available in N seconds."}`
- **404** unknown slug · **503** busy (retry after `Retry-After`) · **5xx** upstream failure or timeout (retry with backoff).

## Notes

- Nothing special: send the inputs, read the result.

## Related

- [TikTok Ad Library Leads](https://docs.scrapier.io/api-reference/tiktok/tiktok-ad-library-leads.md): Structured TikTok data: every input is optional. Single lookup, 3 credits per successful call.
- [TikTok Ad Library](https://docs.scrapier.io/api-reference/tiktok/tiktok-ads.md): Structured TikTok data: send `urls`. Cursor-paginated, 1 credit per successful call.
- [TikTok Ads Top](https://docs.scrapier.io/api-reference/tiktok/tiktok-ads-top.md): Structured TikTok data: every input is optional. Cursor-paginated, 1 credit per successful call.
- [TikTok Collection Videos](https://docs.scrapier.io/api-reference/tiktok/tiktok-collection-videos.md): Structured TikTok data: send `urls`. Cursor-paginated, 1 credit per successful call.
