Healthy Available Limited Mostly unavailable No data
Healthy
Loading health status...
24h trend
30d trend
Retrieves comments for a Bilibili video identified by AID, with optional cursor pagination. Use it to review audience discussion, continue through comment pages, or support comment moderation and analysis.
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/bilibili/get-video-comment/v2?token=YOUR_API_KEY&aid=VALUE'
text
I want to use the "Video Comments (V2)" API from JustOneAPI.Base URL: https://api.justoneapi.com.API Path: /api/bilibili/get-video-comment/v2?token=YOUR_API_KEY&aid=VALUEAPI Endpoint: BASE_URL + /api/bilibili/get-video-comment/v2?token=YOUR_API_KEY&aid=VALUEHTTP Method: GETAuthentication: Append the "token" query parameter to the URL.OpenAPI Definition: https://docs.justoneapi.com/openapi/bilibili/video-comments-v2-en.jsonParameters:- token (query): Access token for the API. (Required)- aid (query): Bilibili Archive ID (AID). (Required)- cursor (query): Pagination cursor.Return format: safely handle JSON or text according to the actual Content-Type.Response Handling & Error Codes:1. Business results should be determined by the "code" field in the response body (code 0 means success).2. Timeout Recommendation: Set the request timeout to 120 seconds. If 120 seconds is too long for your use case, use at least 60 seconds, but a small number of requests may time out before receiving a result.3. Business Code Reference: - 0: Success - 100: Invalid or Inactive Token - 301: Collection Failed. Please Retry. - 302: Rate Limit Exceeded - 303: Daily Quota Exceeded - 400: Invalid Parameters - 500: Internal Server Error - 600: Permission Denied - 601: Insufficient Balance - 602: Token Budget Exceeded4. Code 601 means the shared account balance is insufficient. Code 602 means the current API token's own cumulative budget limit has been reached. Token budget limits do not transfer funds out of the shared account balance.Please help me write a script in my preferred programming language to call this API and handle the response.
python
import requestsBASE_URL = "https://api.justoneapi.com" # Provided by OpenAPI serversurl = BASE_URL + "/api/bilibili/get-video-comment/v2?token=YOUR_API_KEY&aid=VALUE"response = requests.get(url, timeout=120)print(response.status_code)if response.content: content_type = response.headers.get("content-type", "").lower() if "json" in content_type: try: print(response.json()) except ValueError: print(response.text) elif content_type.startswith("text/") or "xml" in content_type or content_type.split(";", 1)[0].strip() in {"application/javascript", "application/x-www-form-urlencoded", "application/graphql"}: print(response.text) else: with open("response.bin", "wb") as output: output.write(response.content) print(f"Saved {len(response.content)} bytes to response.bin")
Bilibili Video Comments API (V2)
Retrieves comments for a Bilibili video identified by AID, with optional cursor pagination. Use it to review audience discussion, continue through comment pages, or support comment moderation and analysis.
Parameters
tokenstringaidstringcursorstringCode Samples
Response Fields
Key fields in a successful response (
code = 0).Comments and pagination15 fields
data.dataComment page, pagination information, and pinned comments when present.
cursorobjectcursor.is_beginbooleancursor.is_endbooleancursor.previntegercursor.nextintegercursor.all_countintegercursor.modeintegercursor.mode_textstringcursor.pagination_replyobjectcursor.pagination_reply.next_offsetstringrepliesarraytop_repliesarray | nulltopobjectupperobjectupper.midintegerTop-level comment details24 fields
data.data.replies[]One top-level comment.
rpidintegerrpid_strstringoidintegeroid_strstringmidintegermid_strstringrootintegerroot_strstringparentintegerparent_strstringtypeintegerctimeintegerlikeintegercountintegerrcountintegerdialogintegerdialog_strstringup_actionobjectup_action.likebooleanup_action.replybooleanreply_controlobjectreply_control.time_descstringreply_control.locationstringrepliesarray | nullTop-level comment text and media26 fields
data.data.replies[].contentComment text and available rich content.
messagestringmembersarraymembers[]objectmembers[].midstringmembers[].unamestringmembers[].avatarstringat_name_to_midobjectat_name_to_mid.{key}integerat_name_to_mid_strobjectat_name_to_mid_str.{key}stringemoteobjectemote.{key}objectemote.{key}.idintegeremote.{key}.package_idintegeremote.{key}.textstringemote.{key}.urlstringemote.{key}.typeintegeremote.{key}.mtimeintegeremote.{key}.metaobjectemote.{key}.meta.sizeintegerpicturesarraypictures[]objectpictures[].img_srcstringpictures[].img_widthintegerpictures[].img_heightintegerpictures[].img_sizenumberTop-level comment authors25 fields
data.data.replies[].memberPublic profile details displayed for the comment author.
midstringunamestringavatarstringsignstringlevel_infoobjectlevel_info.current_levelintegerofficial_verifyobjectofficial_verify.typeintegerofficial_verify.descstringvipobjectvip.vipTypeintegervip.vipStatusintegerfans_detailobject | nullfans_detail.medal_idintegerfans_detail.medal_namestringfans_detail.levelintegerpendantobjectpendant.pidintegerpendant.namestringpendant.imagestringnameplateobjectnameplate.nidintegernameplate.namestringnameplate.imagestringnameplate.levelstringReply preview details23 fields
data.data.replies[].replies[]One reply included in the preview.
rpidintegerrpid_strstringoidintegeroid_strstringmidintegermid_strstringrootintegerroot_strstringparentintegerparent_strstringtypeintegerctimeintegerlikeintegercountintegerrcountintegerdialogintegerdialog_strstringup_actionobjectup_action.likebooleanup_action.replybooleanreply_controlobjectreply_control.time_descstringreply_control.locationstringReply text and emotes20 fields
data.data.replies[].replies[].contentComment text and available rich content.
messagestringmembersarraymembers[]objectmembers[].midstringmembers[].unamestringmembers[].avatarstringat_name_to_midobjectat_name_to_mid.{key}integerat_name_to_mid_strobjectat_name_to_mid_str.{key}stringemoteobjectemote.{key}objectemote.{key}.idintegeremote.{key}.package_idintegeremote.{key}.textstringemote.{key}.urlstringemote.{key}.typeintegeremote.{key}.mtimeintegeremote.{key}.metaobjectemote.{key}.meta.sizeintegerReply authors25 fields
data.data.replies[].replies[].memberPublic profile details displayed for the comment author.
midstringunamestringavatarstringsignstringlevel_infoobjectlevel_info.current_levelintegerofficial_verifyobjectofficial_verify.typeintegerofficial_verify.descstringvipobjectvip.vipTypeintegervip.vipStatusintegerfans_detailobject | nullfans_detail.medal_idintegerfans_detail.medal_namestringfans_detail.levelintegerpendantobjectpendant.pidintegerpendant.namestringpendant.imagestringnameplateobjectnameplate.nidintegernameplate.namestringnameplate.imagestringnameplate.levelstringPinned comments41 fields
data.data.top_replies[]One comment from the pinned list.
rpidintegerrpid_strstringoidintegeroid_strstringmidintegermid_strstringrootintegerroot_strstringparentintegerparent_strstringtypeintegerctimeintegerlikeintegercountintegerrcountintegerup_actionobjectup_action.likebooleanup_action.replybooleanreply_controlobjectreply_control.time_descstringreply_control.locationstringreply_control.is_up_topbooleancontentobjectcontent.messagestringmemberobjectmember.midstringmember.unamestringmember.avatarstringmember.signstringmember.level_infoobjectmember.level_info.current_levelintegermember.official_verifyobjectmember.official_verify.typeintegermember.official_verify.descstringmember.vipobjectmember.vip.vipTypeintegermember.vip.vipStatusintegermember.fans_detailobjectmember.fans_detail.medal_idintegermember.fans_detail.medal_namestringmember.fans_detail.levelintegerUploader-pinned comment41 fields
data.data.top.upperComment pinned by the video uploader, when returned. It can also appear in top_replies.
rpidintegerrpid_strstringoidintegeroid_strstringmidintegermid_strstringrootintegerroot_strstringparentintegerparent_strstringtypeintegerctimeintegerlikeintegercountintegerrcountintegerup_actionobjectup_action.likebooleanup_action.replybooleanreply_controlobjectreply_control.time_descstringreply_control.locationstringreply_control.is_up_topbooleancontentobjectcontent.messagestringmemberobjectmember.midstringmember.unamestringmember.avatarstringmember.signstringmember.level_infoobjectmember.level_info.current_levelintegermember.official_verifyobjectmember.official_verify.typeintegermember.official_verify.descstringmember.vipobjectmember.vip.vipTypeintegermember.vip.vipStatusintegermember.fans_detailobjectmember.fans_detail.medal_idintegermember.fans_detail.medal_namestringmember.fans_detail.levelintegerBilibili response status2 fields
dataBilibili's response for the requested video comments.
codeintegermessagestringResponse Example