API YouTube Channel playlists
Stato di salute dell'API
- Operatività nelle ultime 24 ore
- Normale
- Buono / normale
- Disponibile
Ultime 24 ore
Ultimi 30 giorni
List the playlists on a YouTube channel's Playlists tab from channel_id. Each row has title, link, thumbnail, playlist_id, video_count and is_course. About 30 per page; pass next_page_token back as page_token for more, and pass a row's playlist_id to playlist_videos to list its videos. When nothing could be read this time, the call returns 503 and is not charged.
Invia POST https://api.everyinfra.com/api/v1/social con platform impostato su youtube e action impostato su channel_playlists. 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 YouTube Channel playlists di EveryInfra (youtube/channel_playlists).
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 youtube e action su channel_playlists, e inserisci i parametri in params.
- Parametri obbligatori:
- channel_id: The channel for channel_lives and channel_playlists: a channel ID starting with UC, a channel link (https://www.youtube.com/@NASA) or an @handle. A value that is not recognized returns 422 and is not charged.
- Parametri facoltativi:
- page_token: Page token. Leave it out for the first page, then pass back the previous response's next_page_token exactly as received, with the other parameters unchanged. About 30 playlists per page, and the count varies.
- Restituisce un elenco di record. Campi principali di ogni record: type, id, url, title, author_name, author_id, author_url, thumbnail_url, playlist_id (ID della playlist o del mix quando la r…), video_count (Numero di video), video_count_estimated (true significa che video_count (video)…), is_course (Whether the playlist is a course (chann…).
- Esempio di corpo della richiesta:
{
"platform": "youtube",
"action": "channel_playlists",
"params": {
"channel_id": "UCLA_DiR1FfKNvjuUpBHmylQ"
}
}
- 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ì | youtube | Identificativo della piattaforma, valore fisso. |
action | body | string | Sì | channel_playlists | Identificativo della funzionalità, valore fisso. |
channel_id | body.params | string | Sì | - | The channel for channel_lives and channel_playlists: a channel ID starting with UC, a channel link (https://www.youtube.com/@NASA) or an @handle. A value that is not recognized returns 422 and is not charged. |
page_token | body.params | string | No | - | Page token. Leave it out for the first page, then pass back the previous response's next_page_token exactly as received, with the other parameters unchanged. About 30 playlists per page, and the count varies; each page is one call and limit has no effect. Tokens last 24 hours, and the last page has no next_page_token. |
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": "youtube",
"action": "channel_playlists",
"params": {
"channel_id": "UCLA_DiR1FfKNvjuUpBHmylQ"
}
}'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": "youtube", "action": "channel_playlists", "results": [ { "type": …, "id": …, "url": …, "title": …, "author_name": …, "author_id": …, "author_url": …, "thumbnail_url": …, "playlist_id": …, "video_count": …, "video_count_estimated": …, "is_course": …, "platform": … } ], "next_page_token": …, "pagination": { … }, "count": …, "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 |
|---|---|
type | Tipo di record; i valori dipendono dalla funzionalità (ad esempio video / image / text). |
id | ID univoco del record sulla piattaforma. È univoco solo all'interno di una piattaforma; gli ID possono ripetersi tra piattaforme diverse. |
url | Link al record sulla piattaforma. |
title | Titolo. null quando la piattaforma non prevede titoli (ad esempio post di solo testo). |
author_name | Nome visualizzato dell'autore. |
author_id | ID univoco dell'autore sulla piattaforma. |
author_url | Link al profilo dell'autore sulla piattaforma. |
thumbnail_url | Link alla miniatura, a risoluzione inferiore rispetto a image_url. |
playlist_id | ID della playlist o del mix quando la riga è una di queste; altrimenti null. |
video_count | Numero di video. |
video_count_estimated | true significa che video_count (video) è una stima convertita dal valore arrotondato mostrato da YouTube (ad esempio 1.2M), non un conteggio esatto. Il campo non compare quando il conteggio è esatto. |
is_course | Whether the playlist is a course (channel_playlists). |
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.