Douyin-Search-API

获取视频搜索 V5/Fetch video search V5

Changed on

[中文]

用途:

  • 按关键词搜索视频(V5 版本),只返回视频内容。
  • 翻页参数与综合搜索 V3 一致,响应结构统一(config + items + pagination)。

备注:

  • 首次请求 offset 传 0、page 传 1,search_id 与 backtrace 传空字符串。
  • 翻页时把上一次响应 data.pagination 里的 offset、search_id、backtrace 原样传回,并把 page 加 1。
  • data.pagination.has_more 为 0 表示已经到最后一页。
  • 每页固定 10 条,不支持指定数量。page 上限为 200,超出会返回参数错误。

参数:

  • keyword: 搜索关键词,如 "猫咪"
  • offset: 翻页游标(首次请求传 0)
  • page: 页码,取值 1~200(首次请求传 1)
  • search_id: 搜索ID(首次请求传空字符串)
  • backtrace: 翻页回溯标识(首次请求传空字符串)

请求体示例:

payload = {
    "keyword": "猫咪",
    "offset": 0,
    "page": 1,
    "search_id": "",
    "backtrace": ""
}

返回(部分常用字段,实际返回字段更多,一切以实际响应为准):

  • config: 本次搜索的配置信息(透传)
  • items[]: 视频列表(已按卡片类型解包)
    • aweme_id: 视频ID
    • desc: 视频描述
    • create_time: 发布时间(时间戳)
    • author: 作者信息(uid、sec_uid、nickname、avatar_thumb.url_list 等)
    • video: 播放信息(play_addr.url_list、cover.url_list、duration 等)
    • statistics: 互动数据(digg_count、comment_count、share_count、play_count)
    • share_url: 视频分享链接
  • pagination: 翻页信息
    • offset: 下一页的翻页游标(原样传回)
    • cursor: 同 offset
    • search_id: 下一页的搜索ID(原样传回)
    • backtrace: 下一页的回溯标识(原样传回)
    • has_more: 是否还有更多数据(1=有,0=无)
    • next_page: 下一页页码(没有更多数据时为 null)

[English]

Purpose:

  • Search videos by keyword (V5), returning video content only.
  • Pagination parameters match general search V3, and the response structure is unified (config + items + pagination).

Notes:

  • For the first request set offset to 0, page to 1, and search_id / backtrace to empty strings.
  • For pagination, pass back offset, search_id and backtrace from data.pagination of the previous response, and increment page by 1.
  • data.pagination.has_more = 0 means the last page has been reached.
  • Page size is fixed at 10 and cannot be changed. page is capped at 200; exceeding it returns a parameter error.

Parameters:

  • keyword: Search keyword, e.g., "cat"
  • offset: Offset cursor (0 for the first request)
  • page: Page number, 1-200 (1 for the first request)
  • search_id: Search ID (empty for the first request)
  • backtrace: Backtrace identifier (empty for the first request)

Request Body Example:

payload = {
    "keyword": "cat",
    "offset": 0,
    "page": 1,
    "search_id": "",
    "backtrace": ""
}

Response (common fields, actual response may contain more fields):

  • config: Search configuration returned by the upstream (passed through)
  • items[]: Video list (already unwrapped by card type)
    • aweme_id: Video ID
    • desc: Video description
    • create_time: Publish timestamp
    • author: Author info (uid, sec_uid, nickname, avatar_thumb.url_list, etc.)
    • video: Playback info (play_addr.url_list, cover.url_list, duration, etc.)
    • statistics: Interaction data (digg_count, comment_count, share_count, play_count)
    • share_url: External share link
  • pagination: Pagination info
    • offset: Offset cursor for the next page (pass back as-is)
    • cursor: Same as offset
    • search_id: Search ID for the next page (pass back as-is)
    • backtrace: Backtrace for the next page (pass back as-is)
    • has_more: Whether more results are available (1=Yes, 0=No)
    • next_page: Next page number (null when there are no more results)
post/api/v1/douyin/search/fetch_video_search_v5

Request

  • Base URL
    https://api.tikhub.io (the document declares no server; this is the origin it was published from)
  • Auth
    HTTP bearer

Request body

keywordstring

搜索关键词 / Search keyword

offsetinteger

翻页游标,从上一次响应的 data.pagination.offset 获取,首次请求传 0 / Offset cursor for pagination, obtained from data.pagination.offset of the last response, 0 for the first request

pageinteger

页码,取值 1~200,首次请求传 1,之后每次加 1 / Page number, 1-200, start with 1 and increment by 1 each time

search_idstring

搜索ID,从上一次响应的 data.pagination.search_id 获取,首次请求传空字符串 / Search ID, obtained from data.pagination.search_id of the last response, empty for the first request

backtracestring

翻页回溯标识,从上一次响应的 data.pagination.backtrace 获取,首次请求传空字符串 / Backtrace, obtained from data.pagination.backtrace of the last response, empty for the first request

Response

Successful Response

codeinteger

HTTP status code | HTTP状态码

request_idstring nullable

Unique request identifier | 唯一请求标识符

messagestring

Response message (EN-US) | 响应消息 (English)

message_zhstring

Response message (ZH-CN) | 响应消息 (中文)

supportstring

Support message | 支持消息

timestring

The time the response was generated | 生成响应的时间

time_stampinteger

The timestamp the response was generated | 生成响应的时间戳

time_zonestring

The timezone of the response time | 响应时间的时区

docsstring nullable

Link to the API Swagger documentation for this endpoint | 此端点的 API Swagger 文档链接

cache_messagestring nullable

Cache message (EN-US) | 缓存消息 (English)

cache_message_zhstring nullable

Cache message (ZH-CN) | 缓存消息 (中文)

cache_urlstring nullable

The URL to access the cached result | 访问缓存结果的 URL

routerstring

The endpoint that generated this response | 生成此响应的端点

paramsunknown
dataunknown

Changes