API Douyin Commenti in sovrimpressione nei video
Stato di salute dell'API
- Operatività nelle ultime 24 ore
- Normale
- Buono / normale
- Disponibile
- Limitato
- Quasi del tutto inattivo
Ultime 24 ore
Ultimi 30 giorni
Read the on-screen comments (danmaku) of one Douyin video from its url: a numeric video ID, a https://www.douyin.com/video/<video_id> link, a v.douyin.com short link or a whole share text that contains a short link. Each page covers one stretch of the video of up to 32 seconds, so the number of rows per page varies; to read the whole video, keep passing next_page_token back as page_token until it is absent. Each row has id, text, video_id, video_time (mm:ss), video_time_seconds, like_count, author_uid, is_ad and danmaku_count (all danmaku on the video). Each page is billed once.
Invia POST https://api.everyinfra.com/api/v1/social con platform impostato su douyin e action impostato su danmaku. Prezzo $0.56 per 1.000 richieste ($0.000556 per chiamata). Le chiamate non riuscite e i risultati vuoti non vengono addebitati. Sincrona. Per i job più lenti, aggiungi "mode": "async" al corpo della richiesta, recupera il job_id ed esegui il polling.
Prompt per l'AI
#Aiutami a scrivere uno script di raccolta dei dati con l'endpoint Douyin Commenti in sovrimpressione nei video di EveryInfra (douyin/danmaku).
Come funziona l'endpoint:
- Richiesta: POST https://api.everyinfra.com/api/v1/social con l'header Authorization: Bearer <chiave API>. Leggi la chiave dalla variabile d'ambiente EVERYINFRA_API_KEY e non scriverla mai direttamente nel codice.
- Nel corpo della richiesta imposta platform su douyin e action su danmaku, e inserisci i parametri in params.
- Parametri obbligatori:
- url: The Douyin video whose danmaku you want: a numeric video ID, a https://www.douyin.com/video/<video_id> link, a v.douyin.com short link or a whole share text that contains a short link.
- Parametri facoltativi:
- page_token: Page token for danmaku. Leave it out for the first page, then pass back the previous response's next_page_token exactly as received, keeping the other inputs unchanged. Tokens last 24 hours.
- limit: Numero massimo di righe da restituire in questa chiamata: un intero pari o superiore a 1. Se lo ometti, viene applicato il valore predefinito; una chiamata può restituire meno righe.
- Restituisce un elenco di record. Campi principali di ogni record: id, text, video_id (ID del video: in comments, il video a c…), video_time, video_time_seconds, like_count, author_uid (ID utente numerico dell'autore (nelle r…), is_ad (Indica se il post è un annuncio), danmaku_count.
- Esempio di corpo della richiesta:
{
"platform": "douyin",
"action": "danmaku",
"params": {
"url": "https://www.douyin.com/video/7633646113853104116"
}
}
- Prezzo: $0.56 per 1.000 richieste; le richieste non riuscite e i risultati vuoti non vengono addebitati.
- Per decine o centinaia di target, aggiungi "mode": "async" al corpo: ricevi subito un job_id ed esegui il polling su GET https://api.everyinfra.com/api/v1/jobs/{job_id} per ottenere il risultato.
- In caso di 422, correggi la richiesta usando i nomi dei parametri e i valori consentiti suggeriti nell'errore; in caso di 429 o 503, attendi il tempo indicato da Retry-After e riprova.
Prima di scrivere il codice, chiedimi quali target mi servono, quanti, quali campi e quale formato di output voglio; poi conferma con me il piano e il costo indicativo.Parametri della richiesta
#| Nome | Posizione | Tipo | Obbligatorio | Predefinito | Descrizione |
|---|---|---|---|---|---|
Authorization | header | string | Sì | - | Bearer seguito dalla tua chiave API. Creala nella console; non inserirla mai in un URL o in un repository di codice. |
platform | body | string | Sì | douyin | Identificativo della piattaforma, valore fisso. |
action | body | string | Sì | danmaku | Identificativo della funzionalità, valore fisso. |
url | body.params | string | Sì | - | The Douyin video whose danmaku you want: a numeric video ID, a https://www.douyin.com/video/<video_id> link, a v.douyin.com short link or a whole share text that contains a short link. |
page_token | body.params | string | No | - | Page token for danmaku. Leave it out for the first page, then pass back the previous response's next_page_token exactly as received, keeping the other inputs unchanged. Tokens last 24 hours; the last page has no next_page_token. Each page is one stretch of up to 32 seconds of the video; to read the whole video, page until there is no next_page_token. |
limit | body.params | integer (1–) | No | - | Numero massimo di righe da restituire in questa chiamata: un intero pari o superiore a 1. Se lo ometti, viene applicato il valore predefinito; una chiamata può restituire meno righe. |
Esempi di codice
#curl -X POST 'https://api.everyinfra.com/api/v1/social' \
-H "Authorization: Bearer $EVERYINFRA_API_KEY" \
-H 'Content-Type: application/json' \
--data-raw '{
"platform": "douyin",
"action": "danmaku",
"params": {
"url": "https://www.douyin.com/video/7633646113853104116"
}
}'Definizione OpenAPI (JSON)Gli esempi leggono la chiave dalla variabile d'ambiente EVERYINFRA_API_KEY; il codice copiato non contiene mai la tua chiave.
Esempio di risposta
#{ "id": "req_…", "platform": "douyin", "action": "danmaku", "results": [ { "id": "•••", "text": "好厉害", "video_id": "7633646113853104116", "video_time": "00:00", "video_time_seconds": 0, "like_count": 0, "author_uid": "•••", "is_ad": false, "danmaku_count": 868, "platform": "douyin" }, { "id": "•••", "text": "小学生想吃", "video_id": "7633646113853104116", "video_time": "00:00", "video_time_seconds": 0, "like_count": 0, "author_uid": "•••", "is_ad": false, "danmaku_count": 868, "platform": "douyin" } ], "next_page_token": …, "pagination": { … }, "count": 824, "billing": { "charged": …, "charged_usd": …, "balance_after_usd": …, … }, "quota": { … }}
Campi della risposta
#I dati di business si trovano in results. La tabella elenca i campi che un record può contenere; i valori che la piattaforma non mostra non vengono mai inventati.
| Campo | Significato |
|---|---|
id | ID univoco del record sulla piattaforma. È univoco solo all'interno di una piattaforma; gli ID possono ripetersi tra piattaforme diverse. |
text | Testo del contenuto senza HTML, restituito per intero e mai troncato (su alcune piattaforme i risultati degli elenchi contengono solo un estratto; lo indicano le note sui campi della piattaforma). |
video_id | ID del video: in comments, il video a cui appartiene il commento; in post_history, il video che hai richiesto. |
video_time | Mantiene il significato attribuito dalla piattaforma |
video_time_seconds | Mantiene il significato attribuito dalla piattaforma |
like_count | Like. null significa che la piattaforma o questa funzionalità non li rende noti; non equivale a 0. |
author_uid | ID utente numerico dell'autore (nelle righe comments, di chi ha commentato). author_id è il secUid; entrambi identificano la stessa persona. |
is_ad | Indica se il post è un annuncio. |
danmaku_count | Mantiene il significato attribuito dalla piattaforma |
platform | Identificativo della piattaforma di origine, uguale a platform nella richiesta (ad esempio xiaohongshu, tiktok). |
Errori e addebiti
#- 401
- Chiave mancante o non valida.
- 402
- Saldo insufficiente. Effettua prima una ricarica.
- 422
- Nome o valore del parametro non valido. Correggilo seguendo i suggerimenti dell'errore. Nessun addebito.
- 429
- Raggiunto il limite di richieste al minuto. Attendi il tempo indicato da Retry-After, poi riprova.
- 503
- Impossibile completare. L'importo trattenuto torna sul tuo saldo. Se l'esito è incerto, verificalo prima di riprovare.
- Risposta 200 vuota
- Nessun dato. Nessun addebito.