handlestring
YouTube channel handle.
https://api.sandbase.ai/v1/api/youtube/channelFetch a YouTube channel's stats (subscribers, video count, total views, description) and the links on its About page, by handle or channel ID.
Sua saída aparecerá aqui
Preencha as entradas e clique em Executar.
Returns public stats for one YouTube channel: title, handle, channel ID, subscriber count, video count, total views, description and avatar. It needs a channel handle such as @mkbhd or a channelId that starts with UC.
handle into a channelId so you can call other channel endpoints.curl -X POST "https://api.sandbase.ai/v1/api/youtube/channel" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"handle": "@mkbhd"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
channelId | string | No | YouTube channel ID (UC...). Pass it directly when you have it: some sources accept only the ID and otherwise look up the handle first, which adds a step. |
handle | string | No | YouTube channel handle. |
requireFields | array | No | Optional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example views, and it is served only by a source that returns every one of t |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"data": {
"avatarUrl": "https://yt3.ggpht.com/qu4TmIaYUlS41-dJ9gZ7DUR3nilvmB5_11i6OKSdvNnBNiyOusZP1bMN6I…",
"channelId": "UCBJycsmduvYEL83R_U4JriQ",
"description": "MKBHD: Quality Tech Videos | YouTuber | Geek | Consumer Electronics | Tech Head …",
"handle": "@mkbhd",
"subscribers": 21400000,
"title": "Marques Brownlee",
"url": "https://www.youtube.com/channel/UCBJycsmduvYEL83R_U4JriQ",
"videos": 1863,
"views": 5860083118
},
"found": true
}
| Field | Meaning |
|---|---|
found | true when the channel exists. A lookup that finds nothing returns found: false. |
data.channelId | The channel's ID. It starts with UC. |
data.handle | The channel handle, including the leading @. |
data.title | The channel's display name. |
data.subscribers | Subscriber count as a whole number. |
data.videos | Number of videos on the channel. |
data.views | Total view count across the channel, as a whole number. |
data.description | The channel description text. It can contain line breaks and contact details. |
data.url / data.avatarUrl | url is the channel page link built from the channel ID. avatarUrl is the link to the channel's profile image. |
handle or channelId. Pass channelId when you have it, because it skips a handle lookup.requireFields with values such as links or views if you need those fields. The response shown here did not include a links field, so a request that requires it may be served by a different source.channelId.Billed at the actual cost of each call, about $0.00045 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" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"handle": "@mkbhd"
}'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.
handlestringYouTube channel handle.
channelIdstringYouTube channel ID (UC...). Pass it directly when you have it: some sources accept only the ID and otherwise look up the handle first, which adds a step.
requireFieldsarrayOptional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example `views`, and it is served only by a source that returns every one of them. Fields you do not name are still returned whenever the serving source has them. This can raise your price: when the cheapest source cannot return a named field, a dearer source serves, and you are quoted and charged its price. A named field can still be absent on a record that genuinely lacks it. Naming a combination that no single source returns together is refused as invalid input, with no charge.
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 ChannelEsta API 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 | 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 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.00045 por chamada, cobrado do seu saldo SandBase. Você paga apenas pelas chamadas que fizer; não há assinatura.
Nenhum parâmetro é obrigatório. Opcionais: handle (string), channelId (string) e requireFields (array). 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 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.