SerpBase
Redes sociaisDisponível

YouTube Search

Search YouTube videos, Shorts, and creator channels with query and region parameters.

Endpoint
POST https://api.serpbase.dev/youtube/search
Preço
1 crédito
Autenticação
X-API-Key

Você paga só pelas solicitações com sucesso. Cada endpoint tem um preço fixo em créditos — a maioria 1 ou 2 — e uma solicitação que falha devolve os créditos automaticamente. Cobrança →

Exemplo

cURL
curl -X POST 'https://api.serpbase.dev/youtube/search' \
  -H "Content-Type: application/json" \
  -H 'X-API-Key: YOUR_API_KEY' \
  --max-time 60 \
  -d '{"gl":"us","q":"nextjs tutorial"}'
Resposta · real, resumida
{
  "status": 0,
  "credits_charged": 1,
  "request_id": "r-4b27fe8a36d9ac303a5da7dd",
  "product_id": "youtube_search",
  "query": "nextjs tutorial",
  "action": "search",
  "pagination": {
    "has_more": true,
    "next_cursor": "EpkEEg9uZXh0anMgdHV0b3JpYWwaggRTQlNDQVF0NGJrOTNUMEpaWVVFemQ0SUJDMU5yYkdOZlpsRkNiV056Z2dFTFdsWnVhazlR…"
  },
  "source": "youtube",
  "url": "https://www.youtube.com/results?gl=US&search_query=nextjs+tutorial",
  "videos": [
    {
      "badges": [
        "4K"
      ],
      "channel": {
        "id": "UC8S4rDRZn6Z_StJ-hh7ph8g",
        "image_url": "https://yt3.ggpht.com/Qizn_VAgeCADuMk0RhVQ11j_9TWKrtQ1ifDGo5Yomj4Kjx29OgnHuZc6dQds5jztNlk3LAt6NA=s68…",
        "link": "https://www.youtube.com/channel/UC8S4rDRZn6Z_StJ-hh7ph8g",
        "title": "PedroTech",
        "url": "https://www.youtube.com/channel/UC8S4rDRZn6Z_StJ-hh7ph8g",
        "verified": true
      },
      "description": "If you know react, but don't know what NextJS is, this is the video for you. NextJS offers a variety…",
      "duration": "7:35",
      "id": "xnOwOBYaA3w",
      "link": "https://www.youtube.com/watch?v=xnOwOBYaA3w",
      "media": [
        {
          "type": "thumbnail",
          "url": "https://i.ytimg.com/vi/xnOwOBYaA3w/hq720.jpg?sqp=-oaymwEcCNAFEJQDSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs…"
        }
      ],
      "published_at": "1y ago",
      "title": "Learn NextJS in 7 Minutes",
      "url": "https://www.youtube.com/watch?v=xnOwOBYaA3w",
      "views_count": "301453"
    },
    {
      "badges": [
        "4K"
      ],
      "channel": {
        "id": "UCsBjURrPoezykLs9EqgamOA",
        "image_url": "https://yt3.ggpht.com/3fPNbkf_xPyCleq77ZhcxyeorY97NtMHVNUbaAON_RBDH9ydL4hJkjxC8x_4mpuopkB8oI7Ct6Y=s6…",
        "link": "https://www.youtube.com/channel/UCsBjURrPoezykLs9EqgamOA",
        "title": "Fireship",
        "url": "https://www.youtube.com/channel/UCsBjURrPoezykLs9EqgamOA",
        "verified": true
      },
      "description": "Learn the basics of Next.js in 100 Seconds! Then build your first server-rendered react app with a f…",
      "duration": "11:52",
      "id": "Sklc_fQBmcs",
      "link": "https://www.youtube.com/watch?v=Sklc_fQBmcs",
      "media": [
        {
          "type": "thumbnail",
          "url": "https://i.ytimg.com/vi/Sklc_fQBmcs/hq720.jpg?sqp=-oaymwEcCNAFEJQDSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs…"
        }
      ],
      "published_at": "5y ago",
      "title": "Next.js in 100 Seconds // Plus Full Beginner's Tutorial",
      "url": "https://www.youtube.com/watch?v=Sklc_fQBmcs",
      "views_count": "1541058"
    }
  ]
}
Parâmetros · O que volta

Perguntas frequentes

Quanto custa a API de YouTube Search?

Cada requisição custa 1 crédito. Os créditos vêm de pacotes pré-pagos ou do plano mensal, e contas novas começam com créditos grátis.

Como chamo a API de YouTube Search?

Envie uma requisição POST para https://api.serpbase.dev/youtube/search com sua chave de API no cabeçalho X-API-Key. A resposta é JSON; verifique status (0 significa sucesso).

Quais dispositivos são suportados?

Dispositivos suportados: desktop. O padrão é desktop.

A API de YouTube Search já está disponível?

Sim. Qualquer chave de API ativa pode chamá-la.