# TikTok Trending Hashtags (`tiktok.trending_hashtags`)

TikTok Creative Center's trending hashtag board for one market and industry, with post counts, views and a daily popularity curve.

Docs: https://primaryapi.com/docs/api-reference/tiktok/trending_hashtags

- Endpoint: `POST https://api.primaryapi.com/v1/run/tiktok.trending_hashtags`
- Category: Web Intelligence · Platform: `tiktok` · Kind: list · Status: live
- Price: 2 credits per call; up to 12 credits if a call is retried elsewhere. A quote’s `maxCredits` is the most a given call can cost.
- Billing unit: per successful call
- Reliability: routed to a healthy upstream and retried automatically when an attempt fails; live 30-day status: `GET https://api.primaryapi.com/v1/status/apis?sku=tiktok.trending_hashtags`
- Execution: synchronous (answers 202 only if it outlives the wait window)

## Input

| Field | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
| `region` | enum | no | "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 | Market whose board to read (27 Creative Center markets; each is ranked independently). |
| `industry` | enum | no |  | one of: apparel_accessories, baby_kids_maternity, beauty_personal_care, education, food_beverage, games, health, home_improvement, household_products, news_entertainment, pets, sports_outdoor, tech_electronics, travel, vehicle_transportation | Restrict the ranking to one of 15 industries. Omit for the all-industries board. |
| `period` | 7 \| 30 \| 90 | no | 7 |  | Lookback window in days: 7, 30 or 90 (default 7). |
| `limit` | integer | no | 3 | 1–100 | Maximum hashtags to return (1-100, default 3). TikTok shows anonymous viewers only the top 3. |

Unknown fields are rejected with `400 invalid_input`. The routing controls `preferLatencyUnderMs` and `maxCredits` may be sent in the same JSON body.

## Output

When `output.found` is `true`, `output.data` has this shape:

| Field | Type | Description |
|---|---|---|
| `items` | object[] |  |
| `items[].rank` | integer \| null |  |
| `items[].hashtag` | string | Hashtag without # |
| `items[].hashtagId` | string \| null |  |
| `items[].posts` | integer \| null | Posts using the hashtag |
| `items[].views` | integer \| null | Video views in the period |
| `items[].popularity` | object[] \| null | Daily popularity curve over the period |
| `items[].popularity[].date` | string \| null | YYYY-MM-DD |
| `items[].popularity[].value` | number \| null |  |
| `items[].momentum` | number \| null | Recent-vs-window popularity ratio when the source computes it |
| `items[].trendStage` | string \| null | rising / peaking / fading / steady when the source computes it |
| `items[].industryIds` | string[] | Creative Center industry ids (empty when the source does not report them) |
| `items[].topCreators` | object[] \| null | Leading creators as reported by the source (raw objects) |
| `nextCursor` | null |  |

When the thing you asked about does not exist (or a search matches nothing) the call still succeeds: `output.found` is `false`, `output.data` is `null` and `output.reason` says why (`not_found`, `private`, `no_results`, …). Misses are free unless the notes below say misses are billed.

## Example request

_Input values are placeholders built from the schema._

```bash
curl -sS -X POST "https://api.primaryapi.com/v1/run/tiktok.trending_hashtags" \
  -H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## Example response

_Values are placeholders that follow the output schema; `credits` is what this call would cost at the usual price._

```json
{
  "output": {
    "found": true,
    "data": {
      "items": [
        {
          "rank": 0,
          "hashtag": "string",
          "hashtagId": "string",
          "posts": 0,
          "views": 0,
          "popularity": [
            {
              "date": "string",
              "value": 0
            }
          ],
          "momentum": 0,
          "trendStage": "string",
          "industryIds": [
            "string"
          ],
          "topCreators": [
            {}
          ]
        }
      ],
      "nextCursor": null
    }
  },
  "provider": "PrimaryAPI",
  "credits": 2,
  "items": 1,
  "requestId": "req_01JBXK6Y2N9V8T4R3Q2P1M0A7Z",
  "nextCursor": null
}
```

## Pricing and reliability

- Usual price: 2 credits per call
- Price ceiling: up to 12 credits if a call is retried elsewhere. A quote’s `maxCredits` is the most a given call can cost; the `maxCredits` routing control caps it per call
- Live 30-day status, success rate, uptime and latency: `GET https://api.primaryapi.com/v1/status/apis?sku=tiktok.trending_hashtags`

## Errors to handle

`invalid_input`, `unauthorized`, `insufficient_balance`, `key_limit_reached`, `trial_cap_reached`, `forbidden`, `not_found`, `idempotency_conflict`, `rate_limited`, `all_sources_failed`, `service_unavailable`, `timeout`. See https://primaryapi.com/docs/errors.

## Notes

The doliz/tiktok-creative-center-scraper fallback was dropped: its README says the endpoints require TikTok Creative Center login cookies (research rule: logged-out data only).

