cursorstring
Continuation token from a previous response for pagination.
https://api.sandbase.ai/v1/api/youtube/channel-playlistsList a YouTube channel's playlists by handle or channel ID with cursor pagination (title, video count, thumbnail).
Sua saída aparecerá aqui
Preencha as entradas e clique em Executar.
Returns the playlists of a YouTube channel, with each playlist's title, video count, thumbnail and links. It needs a channel handle such as @veritasium or a channelId.
curl -X POST "https://api.sandbase.ai/v1/api/youtube/channel-playlists" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"handle": "@veritasium"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
channelId | string | No | YouTube channel ID. |
cursor | string | No | Continuation token from a previous response for pagination. |
handle | string | No | YouTube channel handle. |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"data": {
"nextCursor": null,
"playlists": [
{
"id": "PLkahZjV5wKe8w9GC_n2yyhx6Wj-NKzzeE",
"playlistUrl": "https://www.youtube.com/playlist?list=PLkahZjV5wKe8w9GC_n2yyhx6Wj-NKzzeE",
"thumbnail": "https://i.ytimg.com/vi/AaZ_RSt0KP8/hqdefault.jpg?sqp=-oaymwEXCOADEI4CSFryq4qpAwk…",
"title": "Computing",
"videoCount": 5,
"videoId": "AaZ_RSt0KP8",
"videoUrl": "https://www.youtube.com/watch?v=AaZ_RSt0KP8"
}
]
},
"found": true
}
| Field | Meaning |
|---|---|
data.playlists[].id | The playlist ID. It starts with PL and works as the list value in the playlist URL. |
data.playlists[].title | The playlist name, for example Computing. |
data.playlists[].videoCount | The number of videos in the playlist. |
data.playlists[].playlistUrl | A direct link to the playlist page on YouTube. |
data.playlists[].thumbnail | The thumbnail image URL for the playlist. |
data.playlists[].videoId / data.playlists[].videoUrl | The ID and watch link of the video that supplies the thumbnail. This is the video shown as the playlist cover. |
data.nextCursor | The token for the next page of playlists. It is null when there are no more pages. |
found | true when the channel was found. |
handle (with the leading @) or channelId. The example request uses handle.data.nextCursor value as cursor in the next request. Stop when it is null.id to YouTube Playlist.Billed at the actual cost of each call, about $0.0012 for the request above. Failed calls are not charged.
Comece a construir
Endpoint da API da plataforma com autenticação unificada e rastreamento de uso.
curl -X POST "https://api.sandbase.ai/v1/api/youtube/channel-playlists" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"handle": "@veritasium"
}'Defina sua chave da API SandBase no ambiente do seu servidor. As requisições usam autenticação Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Mantenha sua chave no servidor. Não a exponha em código do navegador.
cursorstringContinuation token from a previous response for pagination.
handlestringYouTube channel handle.
channelIdstringYouTube channel ID.
Resposta de exemplo salva para esta API; nenhuma requisição ao vivo é feita ao visualizá-la.
Nenhuma resposta salva foi publicada. Execute a API no Playground para inspecionar a resposta.
Explorar mais
| API | Preço | Resposta |
|---|---|---|
YouTube Channel PlaylistsEsta API YouTube | A partir de $0.0012 por chamada | JSON |
YouTube | A partir de $0.00045 por chamada | JSON |
YouTube | A partir de $0.0012 por chamada | JSON |
YouTube | A partir de $0.0012 por chamada | JSON |
YouTube | $0.014286 por chamada | JSON |
YouTube | $0.014286 por chamada | JSON |
Perguntas
Envie uma solicitação POST para https://api.sandbase.ai/v1/api/youtube/channel-playlists com sua chave de API da SandBase no cabeçalho Authorization (Bearer) e os parâmetros no corpo JSON. Você também pode testar no Playground desta página sem escrever código.
A partir de $0.0012 por chamada, cobrado do seu saldo SandBase. Você paga apenas pelas chamadas que fizer; não há assinatura.
Nenhum parâmetro é obrigatório. Opcionais: cursor (string), handle (string) e channelId (string). A tabela de Parâmetros e o Playground nesta página listam todos os campos.
Uma resposta JSON retornada na mesma solicitação HTTP (síncrona). O README desta página inclui um exemplo de resposta.
Não. YouTube Channel Playlists funciona via SandBase, então uma única chave de API da SandBase cobre este endpoint e todas as outras APIs e modelos do catálogo. Você não precisa solicitar acesso à API do YouTube separadamente.