aidstringobligatoire
Bilibili Archive ID (AID).
https://api.sandbase.ai/v1/api/bilibili/video-danmuGet one page of danmaku comments for a Bilibili video segment identified by AID and CID. Use it to review time-synchronized audience reactions or page through danmaku for a known video.
Votre sortie apparaîtra ici
Complétez les entrées, puis cliquez sur Exécuter.
Returns one page of danmaku (time-synced viewer comments) for a Bilibili video segment. It needs the video's aid and cid, and takes an optional page number.
stime value.page.curl -X POST "https://api.sandbase.ai/v1/api/bilibili/video-danmu" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"aid": "80433022", "cid": "137649199"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
aid | string | Yes | Bilibili Archive ID (AID). |
cid | string | Yes | Bilibili Chat ID (CID). |
page | string | No | Page number for pagination. |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
[
{
"color": 16777215,
"date": 1593092327,
"dmid": "34576873522987015",
"id": 34576873522987015,
"mode": 1,
"size": 25,
"stime": 95453,
"text": "80年代迪厅必放金曲",
"uhash": "d2b24dbe",
"weight": 9
}
]
| Field | Meaning |
|---|---|
text | The danmaku comment text shown on screen. |
stime | Time position of the comment in the video. The value 95453 suggests milliseconds, but the response does not state the unit. |
date | Time the comment was posted, as a Unix timestamp in seconds. |
id / dmid | Unique ID of the danmaku. dmid is the same number as id, returned as a string. |
uhash | Hashed ID of the user who sent the comment. It is not a plain user ID. |
color | Comment color as a decimal number. The value 16777215 is white (#FFFFFF). |
mode / size / weight | Display mode, font size and weight value of the comment. All three are plain numbers. |
page to move through further pages for the same aid and cid.aid from a BV ID, call Bilibili BV to AID Converter.cid values, call Bilibili Video Parts.$0.014286 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
Commencer à construire
Point de terminaison de l'API de la plateforme avec authentification unifiée et suivi de l'utilisation.
curl -X POST "https://api.sandbase.ai/v1/api/bilibili/video-danmu" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"aid": "80433022",
"cid": "137649199"
}'Définissez votre clé API SandBase dans l'environnement de votre serveur. Les requêtes utilisent l'authentification Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Conservez votre clé côté serveur. Ne l'exposez pas dans le code du navigateur.
aidstringobligatoireBilibili Archive ID (AID).
cidstringobligatoireBilibili Chat ID (CID).
pagestringPage number for pagination.
Exemple de réponse enregistré pour cette API ; aucune requête en direct n'est effectuée lors de l'affichage.
Aucune réponse enregistrée n'a été publiée. Exécutez l'API dans Playground pour inspecter sa réponse.
Explorer plus
| API | Prix | Réponse |
|---|---|---|
Bilibili Video DanmakuCette API Bilibili | $0.014286 par appel | JSON |
Bilibili | $0.001 par appel | JSON |
Bilibili | $0.001 par appel | JSON |
Bilibili | $0.001 par appel | JSON |
Bilibili | $0.001 par appel | JSON |
Bilibili | $0.001 par appel | JSON |
Questions
Envoyez une requête POST à https://api.sandbase.ai/v1/api/bilibili/video-danmu avec votre clé API SandBase dans l’en-tête Authorization (Bearer) et les paramètres dans un corps JSON. Vous pouvez aussi l’essayer dans le Playground sur cette page sans écrire de code.
$0.014286 par appel, facturé depuis votre solde SandBase. Vous ne payez que les appels que vous effectuez ; aucun abonnement.
Obligatoire : aid (string) et cid (string). Facultatif : page (string). Le tableau des paramètres et le Playground sur cette page listent tous les champs.
Une réponse JSON renvoyée dans la même requête HTTP (synchrone). Le README sur cette page inclut un exemple de réponse.
Non. Bilibili Video Danmaku fonctionne via SandBase, donc une seule clé API SandBase couvre ce point de terminaison ainsi que toutes les autres API et tous les modèles du catalogue. Vous n’avez pas besoin de demander un accès API Bilibili séparément.