# Douyin Trending history API (douyin.trending_history)

- Canonical page: [https://everyinfra.com/en/douyin-api/trending_history](https://everyinfra.com/en/douyin-api/trending_history?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "douyin", "action": "trending_history", "params": {...}}
- Price: $0.000792 per call ($0.79 per 1,000 requests); failed calls and empty results are not charged
- Returns: list
- Mode: sync; add "mode": "async" for slow tasks

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=douyin&action=trending_history

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| board | enum: challenge / entertainment / hotspot / social | no | not declared | Board to read: `hotspot` (default), `entertainment`, `social` or `challenge`. |
| hours | integer | no | not declared | For `trending_history`: how many hours to look back, from 1 to 168 (default 24). |
| limit | integer (1–) | no | not declared | The most rows to return in this call, an integer of 1 or more. The default applies when you leave it out, and a call can return fewer rows. |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| keyword | Keyword: the trending phrase on trending and trending_history, the search term on billboard_search_hot, the suggested search on search_suggest. |
| board | Board the entry belongs to: `hotspot`, `entertainment`, `social`, `challenge` or `seeding`. |
| first_seen_at | When the term was first recorded on the board within the window (`trending_history`, ISO 8601, UTC). |
| last_seen_at | When the term was last recorded on the board within the window (`trending_history`, ISO 8601, UTC). |
| snapshot_count | How many times the term was recorded on the board in the window (`trending_history`); the board is recorded about every ten minutes. |
| best_rank | Best position the term reached in the window (`trending_history`); 1 is highest. Absent for pinned terms that have no rank. |
| peak_hot_value | Highest heat value the term reached in the window (`trending_history`), on the same scale as `hot_value` in `trending`. |
| is_on_board | Whether the term was still on the board at the latest snapshot (`trending_history`). |
| platform | Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok). |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "douyin",
  "action": "trending_history",
  "params": {}
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "douyin",
        "action": "trending_history",
        "params": {},
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "douyin",
  "action": "trending_history",
  "results": [
    {
      "keyword": …,
      "board": …,
      "first_seen_at": …,
      "last_seen_at": …,
      "snapshot_count": …,
      "best_rank": …,
      "peak_hot_value": …,
      "is_on_board": …,
      "platform": …
    }
  ],
  "count": …,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=douyin
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
