Перейти к навигации

If I only have an AV ID, must I convert it to BV first?

No. You do not need to convert an AV ID to a BV ID before fetching comments. Pass the numeric AV ID directly to bilibili.app.fetch_video_comments using av_id, sending only one video identifier per request.

Passing av_id or bv_id to bilibili.app.fetch_video_comments

For a video such as av123456, strip the av prefix and send av_id:"123456" to bilibili.app.fetch_video_comments:

{"action":"bilibili.app.fetch_video_comments","params":{"av_id":"123456"}}

When you have a BV ID instead, pass bv_id to bilibili.app.fetch_video_comments without av_id. To retrieve recent comments using an AV ID, include mode:2 as documented in the sorting FAQ:

{"action":"bilibili.app.fetch_video_comments","params":{"av_id":"123456","mode":2}}

App comments vs Web comments identifier support

Choose the Bilibili comments action based on the identifier available:

  • bilibili.app.fetch_video_comments: Accepts either av_id or bv_id (one identifier per request) and supports mode:2 for recent comments.
  • bilibili.web.fetch_video_comments: Accepts only bv_id and cannot take av_id directly.

Request checks before calling

  • Send either av_id or bv_id in each bilibili.app.fetch_video_comments call, never both at once.
  • Pass only the numeric digits in av_id (for example "123456" for av123456).
  • If you need to prepare or normalize a video identifier from a URL, see Prepare a video identifier.