channel_urlstringobrigatório
Channel URL.
https://api.sandbase.ai/v1/api/youtube/web/channel-id-v2Resolves a YouTube channel URL into its unique channel ID and standardized channel URL. Accepts various URL formats including handles, custom URLs, and user links.
[
{
"data": {
"channel_id": "UCeu6U67OzJhV1KwBansH3Dg",
"channel_url": "https://www.youtube.com/channel/UCeu6U67OzJhV1KwBansH3Dg"
}
}
]Selecione um exemplo para carregar as entradas e o resultado no playground.
Takes a YouTube channel URL and returns the channel's unique ID and its standard channel URL. The input is channel_url, which can be a handle, custom URL, user link, or channel link.
@handle link into a UC... channel ID before you call other channel APIs.curl -X POST "https://api.sandbase.ai/v1/api/youtube/web/channel-id-v2" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"channel_url": "https://www.youtube.com/@CozyCraftYT"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
channel_url | string | Yes | Channel URL. |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"channel_id": "UCeu6U67OzJhV1KwBansH3Dg",
"channel_url": "https://www.youtube.com/channel/UCeu6U67OzJhV1KwBansH3Dg"
}
| Field | Meaning |
|---|---|
channel_id | The unique YouTube channel ID. It starts with UC, for example UCeu6U67OzJhV1KwBansH3Dg. |
channel_url | The standard channel URL built from the ID, in the form https://www.youtube.com/channel/<channel_id>. |
channel_url. The example uses a handle URL: https://www.youtube.com/@CozyCraftYT.channel_id and inside channel_url, so you can use either one.$0.001 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
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/web/channel-id-v2" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"channel_url": "https://static.sandbase.ai/examples/1e292b4d-4702-4fe1-a012-cba3b931bb0e/input/456962a8-0887-4ca6-aee3-9be7a5538cd5.bin"
}'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.
channel_urlstringobrigatórioChannel URL.
Resposta de exemplo salva para esta API; nenhuma requisição ao vivo é feita ao visualizá-la.
[
{
"data": {
"channel_id": "UCeu6U67OzJhV1KwBansH3Dg",
"channel_url": "https://www.youtube.com/channel/UCeu6U67OzJhV1KwBansH3Dg"
}
}
]Explorar mais
| API | Preço | Resposta |
|---|---|---|
YouTube Channel ID from URL (V2)Esta API YouTube | $0.001 por chamada | JSON |
YouTube | $0.001 por chamada | JSON |
YouTube | $0.001 por chamada | JSON |
YouTube | $0.001 por chamada | JSON |
YouTube | $0.001 por chamada | JSON |
YouTube | $0.001 por chamada | JSON |
Perguntas
Envie uma solicitação POST para https://api.sandbase.ai/v1/api/youtube/web/channel-id-v2 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.
$0.001 por chamada, cobrado do seu saldo SandBase. Você paga apenas pelas chamadas que fizer; não há assinatura.
Obrigatórios: channel_url (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 ID from URL (V2) 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.