YouTube · Guide

How to run a YouTube search

TL;DR
To run a YouTube search, sign up for a free Captapi key, then send one GET request to /v1/youtube/search with your input. You get clean JSON back in seconds for 20 credits per call — no OAuth, scraping or platform SDKs. Search YouTube programmatically and get structured, ranked results.

How to run a YouTube search (step by step)

  1. 1

    Get a free API key

    Create a free Captapi account (100 credits, no card) and generate an API key from the dashboard.

  2. 2

    Call the YouTube Search API

    Send an authenticated GET request to /v1/youtube/search with your input. No OAuth, no scraping setup.

  3. 3

    Read the JSON response

    Parse the clean JSON response. Results are cached for 24 hours, so repeat calls are free.

Code example

curl "https://api.captapi.com/v1/youtube/search?q=structured%20data%20api" \
  -H "Authorization: Bearer capt_live_..."

What the response looks like

{
  "success": true,
  "cached": false,
  "creditsUsed": 20,
  "data": {
    "query": "lofi hip hop",
    "totalReturned": 10,
    "results": [
      {
        "url": "https://www.youtube.com/watch?v=CLeZyIID9Bo&list=RDCLeZyIID9Bo&start_radio=1",
        "title": "Chill Lofi Mix [chill lo-fi hip hop beats]",
        "channelName": "Settle",
        "viewCount": 33459572,
        "publishedAt": "2022-08-12T11:30:07.000Z",
        "thumbnailUrl": "https://i.ytimg.com/vi/CLeZyIID9Bo/maxresdefault.jpg?sqp=-oaymwEmCIAKENAF8quKqQMa8AEB-AH-CYAC0AWKAgwIABABGEMgZChlMA8=&rs=AOn4CLDIwJBf3enz-v4OqrWuTikp5Wk7KA",
        "durationSeconds": null
      },
      {
        "url": "https://www.youtube.com/watch?v=UYwhisrQ-po&list=RDUYwhisrQ-po&start_radio=1",
        "title": "Work Lofi for Productivity & Focus - Smooth lofi hiphop/ neo soul beats",
        "channelName": "A Lofi Soul",
        "viewCount": 856339,
        "publishedAt": "2024-08-20T12:00:35.000Z",
        "thumbnailUrl": "https://i.ytimg.com/vi/UYwhisrQ-po/maxresdefault.jpg",
        "durationSeconds": null
      }
    ]
  }
}

Request parameters

NameTypeRequiredDescription
qstring YesSearch query or keywords (min 2 characters).
limitintegerNoMax items to return (default 20, max 200). Billed per result.

Frequently asked questions

What does the YouTube Search API do?

The YouTube Search API lets you search and return matching results from a public YouTube query using one GET request to /v1/youtube/search. It returns clean JSON — no OAuth or scraping setup required.

How many credits does the YouTube Search API cost?

Each successful call costs 20 credits. Responses are cached for 24 hours, and cached results cost 0 credits. Failed or empty results are never charged.

Do I need a YouTube API key or OAuth?

No. A single Captapi key works across YouTube, TikTok, Instagram, and Facebook. We handle proxies, rate limits, retries, and authentication for you.

Is the YouTube Search API suitable for production use?

Yes. It is a stable REST endpoint with predictable JSON, automatic retries, and a shared 24-hour cache. Use it for RAG pipelines, analytics, monitoring, and content automation.

Ready to run a YouTube search?

Start free with 100 credits — no credit card required.

Get your free API key