> 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 Trending Hashtag

Structured TikTok data: every input is optional. Cursor-paginated, 2 credits per successful call.

`GET|POST https://api.scrapier.io/api/v2/tiktok-trending-hashtag/` · 2 credits per successful call · Cursor-paginated

## Overview

Call `GET /api/v2/tiktok-trending-hashtag/`. The results are in `data.data`; send `data.next_cursor` back as `cursor` to get the next page. 9 optional parameters refine the call (see Parameters).

## Request

```bash
curl -G "https://api.scrapier.io/api/v2/tiktok-trending-hashtag/" \
  -H "X-API-Key: YOUR_API_KEY" \
  --max-time 210
```

```python
import requests

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

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

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

## Parameters

> **Note:** No parameter is strictly required, but send at least the inputs shown in the example.

| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| `X-API-Key` (header) | string | yes | — | Your API key. |
| `country` | string | no | `US` | TikTok ranking country. One country per request; defaults to US. One of: `US`, `FR`, `DE`, `IT`, `ES`, `GB`, `AR`, `AU`, `BR`, `CA`, `CO`, `EG`, `ID`, `IL`, `JP`, `KR`, `MY`, `MX`, `PH`, `SA`, `SG`, `ZA`, `TW`, `TH`, `TR`, `AE`, `VN`. |
| `period` | integer | no | `30` | Ranking window in days. Legacy 120 maps to 90. One of: `7`, `30`, `90`, `120`. |
| `result_type` | string | no | `top100` | top100 is ranking-only. Analytics modes add trend and optional challenge metrics; anonymous source does not guarantee 100 results. One of: `top100`, `top100_with_analytics`, `hashtag_analytics`. |
| `industry_id` | string | no | — | Optional top-level TikTok industry ID. Restricts the feed to that industry. |
| `include_industries` | boolean | no | `false` | Expand overall ranking with industry rankings. Rank remains relative to each industry; more requests. |
| `related_videos_source` | string | no | `none` | Optional TikWM third-party related videos in analytics modes. Adds requests; no cookies. One of: `none`, `tikwm`. |
| `related_items_limit` | integer | no | `3` | Related videos per hashtag when TikWM is enabled. Deadline may return fewer with a warning. |
| `related_items_cursor` | integer | no | `0` | Optional TikWM starting cursor for related videos. |
| `use_proxy` | boolean | no | `true` | Route the request through Scrapier's residential proxy pool. Default: `true`. Leave as is unless support tells you otherwise. |
| `cursor` | string | no | — | Opaque continuation token. Cursor-only calls preserve country, window, industry, and analytics options. |
| `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.data`. Sample from the live catalog, arrays trimmed to 3 items.

```json
{
  "success": true,
  "data": {
    "success": true,
    "data": {
      "country": "US",
      "period": 30,
      "result_type": "top100",
      "page": 1,
      "page_size": 3,
      "hashtags": [
        {
          "hashtag_id": "7696402918877954061",
          "hashtag_name": "musteatinmycity",
          "industry_info": {
            "id": 27000000000,
            "value": "Food & Beverage",
            "label": "label_27000000000"
          },
          "video_views": 2345135987,
          "publish_cnt": 2563515,
          "rank": 1,
          "rank_diff_type": null,
          "record_id": "US:30:7696402918877954061",
          "country": "US",
          "period": 30,
          "result_type": "top100",
          "ranking_scope": "overall",
          "ranking_industry_id": null,
          "related_videos_source": "none",
          "warning": "Anonymous rankings are source-limited. Industry ranks belong to their industry.",
          "scraped_at": "2026-11-16T09:00:00.000Z"
        }
      ],
      "next_cursor": null,
      "warning": "Anonymous rankings are source-limited. Industry ranks belong to their industry."
    }
  }
}
```

## Response fields

| Field | Type | Example | Description |
|---|---|---|---|
| `success` | boolean | `true` |  |
| `data` | object | `{…}` | The results. |
| `data.country` | string | `US` |  |
| `data.period` | integer | `30` |  |
| `data.result_type` | string | `top100` |  |
| `data.page` | integer | `1` |  |
| `data.page_size` | integer | `3` |  |
| `data.hashtags` | array | `[1 item]` |  |
| `data.next_cursor` | null | `null` |  |
| `data.warning` | string | `Anonymous rankings are source-limited. Indust…` |  |

## 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-trending-hashtag/"
HEADERS = {"X-API-Key": "YOUR_API_KEY"}
params = {}
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("data"))
    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

- The response data carries its own `success` field from the scraper. The outer `success` is what counts: an HTTP 200 with outer `success: true` is billed, even if the inner field says otherwise.

## 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.
