Bilibili-Web-API

获取动态评论/Get dynamic comments

Changed on

[中文]

用途:

  • 获取图文、文字动态的评论列表。

参数:

  • dynamic_id、oid 必须且只能提供一个。
  • dynamic_id: 动态链接中的ID,自动识别评论区及评论类型。
  • oid: 评论区ID,可从动态详情的 data.data.item.basic.rid_str 获取(旧版为comment_id_str),不是动态ID。
  • comment_type: 仅配合oid使用,11为图文(默认),17为文字;使用dynamic_id时不传。
  • mode: 3为热门,2为时间。
  • pagination_str: 首页留空;下一页传入 {"offset":"上一页的next_offset值"}。

返回与翻页:

  • data.data.replies: 评论列表;data.data.top_replies: 置顶评论。
  • data.data.cursor.pagination_reply.next_offset: 下一页offset,作为字符串原样使用。
  • data.data.cursor.is_end 为true时停止翻页,不再发起下一页请求。

[English]

Purpose:

  • Get comments on image and text dynamics.

Parameters:

  • Provide exactly one of dynamic_id and oid.
  • dynamic_id: ID from the dynamic URL; identifies the comment section and type automatically.
  • oid: Comment-section ID from data.data.item.basic.rid_str (comment_id_str in older responses); not the dynamic ID.
  • comment_type: Only with oid; 11 for image posts (default), 17 for text. Omit when using dynamic_id.
  • mode: 3 for hot, 2 for time.
  • pagination_str: Leave empty for page one; then pass {"offset":"previous next_offset value"}.

Response and pagination:

  • data.data.replies: Comments; data.data.top_replies: Pinned comments.
  • data.data.cursor.pagination_reply.next_offset: Use this string unchanged as the next offset.
  • Stop pagination when data.data.cursor.is_end is true.

[示例/Example]

dynamic_id = "DYNAMIC_ID" mode = 3 pagination_str = ""

get/api/v1/bilibili/web/fetch_dynamic_comments

Request

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

Query parameters

dynamic_idstring nullable

动态ID,与oid二选一/Dynamic ID; provide either dynamic_id or oid

oidstring nullable

评论区ID,与dynamic_id二选一/Comment-section ID; provide either oid or dynamic_id

comment_typeinteger nullable

仅配合oid使用,默认11(图文)/Only with oid; defaults to 11 (image posts)

modeinteger

排序:3热门,2时间/Sort: 3 hot, 2 time

pagination_strstring

翻页JSON,首页留空/Pagination JSON; leave empty for the first page

Example:{"offset":""}

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