# Douyin Search API (douyin.search)

- Canonical page: https://everyinfra.com/en/douyin-api/search
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "douyin", "action": "search", "params": {...}}
- Price: $0.008333 per call ($8.33 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, default 10, max 50 per call
- Pagination: pass next_page_token back as page_token for the next page, other params unchanged; one call per page, tokens last 24 hours
- Mode: sync; add "mode": "async" for slow tasks

Douyin Search finds videos by `keyword` and returns each video's caption, hashtags, like, comment, share and save counts, the author's nickname, Douyin ID and follower count, and the publish time, plus the video length, cover image and a signed play link. Use it to see which videos are spreading around a topic and who made them: trend and topic research, sampling brand mentions, or working back from videos to creators worth following.

Order results with `sort` (relevance, newest or most liked) and narrow them with `publish_time` (the last day, week or half year). Judge reach with `like_count`, `comment_count` and `share_count`: Douyin does not publish play counts, so `view_count` says nothing about real views. `author_id` can be passed straight on to read the author's profile and videos.

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | Search term for the video search action, passed as a string, for example `latte art`. It finds videos; it is not an account nickname or a video ID. |
| page_token | not declared | no | not declared | Page token. To start paging, send an empty string `page_token=""`; then pass back the previous response's `next_page_token` exactly as received to get the next page, keeping `keyword`, `sort` and `publish_time` unchanged. Each page is one call and comes as whole Douyin result pages, not cut: at least `limit` videos (default 10, up to 50; fewer on the last page), often a few more. Videos Douyin repeats from the previous page are left out. Tokens last 24 hours and only work for the same account and the same parameters; an expired or mismatched token returns 422, so start again from the first page. On the last page the response has no `next_page_token`. Without `page_token` the call is a single fetch of up to `limit` videos with no `next_page_token`. |
| publish_time | enum: half_year / one_day / one_week / unlimited | no | not declared | Filters video search results by publishing time window. Allowed values are `unlimited` (default), `one_day` (last 24 hours), `one_week` (last 7 days), and `half_year` (last 6 months). |
| sort | enum: most_liked / newest / relevance | no | not declared | Sorts video search results. Allowed values are `relevance` (default), `newest` for the latest publish date, and `most_liked` for highest likes. Supports legacy compatibility aliases `general` (mapped to `relevance`) and `latest` (mapped to `newest`). |
| limit | integer (1–50) | no | 10 | The most rows to return in this call, an integer from 1 to 50. The default applies when you leave it out, and a call can return fewer rows. Larger values return 422 before any charge. |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| next_page_token | Page token (search / user_posts / comments / comment_replies / billboard_video_hot / billboard_low_fan_explosion / billboard_high_completion / billboard_account_search / music_search): pass it back unchanged as page_token to fetch the next page, keeping the other parameters the same; valid for 24 hours. Every row of a page carries the same value, which also appears at the top level of the response. Absent on the last page. Comment pages walk all top-level comments page by page. |
| id | The record's unique ID on the platform. Unique only within one platform; IDs can repeat across platforms. |
| url | Link to the record on the platform. |
| text | Body text with HTML removed, returned in full and never cut short (on a few platforms the list results themselves carry only an excerpt; the platform's field notes say so). |
| media_type | Media type: video, or image for image posts. |
| video_url | Video playback URL (signed, expires; download promptly if you need to keep it). Null for image posts or when the source omits it. |
| like_count | Likes. null means the platform or this capability does not disclose it; it is not 0. |
| comment_count | Comments. null means not disclosed, not 0. |
| share_count | Shares. null means not disclosed, not 0. |
| collect_count | Saves or favorites. null means not disclosed, not 0. |
| view_count | This is not a real play count. Douyin does not publish video play counts; most results omit this field and some show 0, and neither reflects real plays. Judge reach by like_count, comment_count, share_count and collect_count. |
| author_name | Author's display name. |
| author_id | Author's unique ID on the platform. |
| author_douyin_id | The author's Douyin ID. |
| author_uid | Numeric user ID of the author (on comments, of the commenter). author_id is the secUid; both identify the same person. |
| author_bio | The author's profile bio (search / user_posts / video rows). |
| author_avatar_url | Author avatar image URL: the creator on search, user_posts and video rows, the commenter on comments rows. |
| author_follower_count | Author's follower count. null means not disclosed. |
| cover_image_url | Video or image-post cover thumbnail URL (search / user_posts rows). |
| video_width | Video frame width in pixels. |
| video_height | Video frame height in pixels. |
| duration_seconds | Duration in seconds. null for content that is not video or audio. |
| region | Region. |
| hashtags | Hashtags in the text, in order of appearance; absent when there are none. |
| posted_at | Publish time in ISO 8601, UTC (for example 2026-08-07T12:34:56+00:00). Non-standard strings from the platform are passed through as is, so parse defensively. null means the platform does not disclose it. |
| platform | Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok). |
| image_urls | Array of image links in the platform's display order; absent when there are no images. |
| duration_sec | Video length in seconds. |
| hashtag_ids | platform-native meaning |
| search_rank | platform-native meaning |
| author_is_verified | Whether the author is verified (search / user_posts / video rows). |
| author_following_count | How many accounts the author follows (search / user_posts / video rows). |
| author_like_count | Total likes the author's profile has received (search / user_posts / video / transcript). |
| author_video_count | Total number of posts on the author's profile (search / user_posts / video rows). |
| author_ip_location | The author's IP location, which Douyin displays on every profile. |
| title | Title. null when the platform has no titles (for example text-only posts). |
| music | Background track: id, title, author, is_original (original sound or not), duration_sec, cover_url and play_url (audio link, may expire). Absent when there is no music information. |
| download_count | How many times the post was downloaded. |
| forward_count | How many times the post was forwarded. |
| is_pinned | Whether the item is pinned (post rows: pinned on the author's profile; trending: pinned on the board). |
| is_ad | Whether the post is an ad. |
| video_tags | Content category tags Douyin assigned to the post (for example food or store visit). |
| video_resolution | Video quality tier as Douyin labels it (for example 720p). |
| animated_cover_url | Animated cover link. |
| city | City name in the platform's language, not normalized. |
| city_code | platform-native meaning |
| location | Location description passed through as is; the format varies by platform. |
| text_language | platform-native meaning |
| video_bitrates | platform-native meaning |
| download_url | platform-native meaning |
| has_watermark | platform-native meaning |
| video_url_expires_at | platform-native meaning |
| permissions | platform-native meaning |
| author_gender | platform-native meaning |
| author_age | platform-native meaning |

## 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": "search",
  "params": {
    "keyword": "城市骑行"
  }
}'
```

```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": "search",
        "params": {
            "keyword": "城市骑行",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-09-26T08:56:04Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "douyin",
  "action": "search",
  "results": [
    {
      "id": "•••",
      "url": "https://www.douyin.com/video/7635624004494435825",
      "text": "一个人的解压方式 夜晚 骑行 听歌 晚风和自由#骑行",
      "media_type": "video",
      "like_count": 1578935,
      "comment_count": 26631,
      "share_count": 228957,
      "collect_count": 117174,
      "view_count": 0,
      "author_name": "•••",
      "author_id": "•••",
      "author_douyin_id": "•••",
      "author_follower_count": 9028,
      "region": "CN",
      "posted_at": "2026-05-03T11:20:52+00:00",
      "platform": "douyin",
      "duration_sec": 8,
      "hashtags": [
        "骑行"
      ]
    }
  ],
  "next_page_token": …,
  "pagination": { … },
  "count": 1,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### Why can't I get view counts?

Douyin does not publish play counts, so `view_count` in these results does not reflect real views and cannot tell you whether anyone watched. Compare videos by `like_count`, `comment_count` and `share_count`, read alongside the publish time.

### Can I search only recent videos?

Yes. Set `publish_time` to `one_day`, `one_week` or `half_year` to keep videos published in that window; the default, `unlimited`, applies no window. Set `sort` to `newest` to list them newest first.

### How do I get more than 50 results?

Page through them. Send `page_token` as an empty string on the first request, then pass each response's `next_page_token` back unchanged, keeping `keyword`, `sort` and `publish_time` the same. Each page is one call and holds at least `limit` videos; videos Douyin repeats from the previous page are left out. The last page has no `next_page_token`, and tokens last 24 hours.

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