Platforms/YouTube/Search

YouTube Search API

GET ยท 1 credit

Send words to search for, and get the videos and Shorts that match, 10 to 20 videos a page, with filters for type, length, date and country.

GET /v1/youtube/search

What people use it for

  • Keyword research: see which videos rank for a search in each country.
  • Brand monitoring: search your brand every day with time=day and catch new videos about it.
  • Trend tracking: compare the most viewed videos on a topic with sort=popular.

How it works with other endpoints

Each result's id goes to Video, Video comments and Video transcript. For channels or playlists instead, use Channel search and Playlist search; Search suggestions gives related queries.

Limits

  • 10 to 20 videos a page, with Shorts mixed in.
  • published is relative, as YouTube words it.

Example request

const url = `${process.env.API_URL}/v1/youtube/search?q=running`;

const response = await fetch(url, {
  headers: { "x-api-key": process.env.API_KEY },
});

const { data } = await response.json();
console.log(data);

Parameters

ParameterRequiredDescription
qYesWhat to search for.
typeNoOnly videos, or only shorts. Both when left out.
durationNoOnly videos of this length.
timeNoOnly videos uploaded in the last day, week, month or year.
sortNoThe order: relevance, or popular (most viewed first).
regionNoA country's two-letter code, such as GB: results as YouTube ranks them there. US when left out.
cursorNoFor the next page: page.next_cursor from the page before. Send the other parameters again with it.

Example response

{
  "data": [
    {
      "id": "Rn4Kp8Wq2Zx",
      "url": "https://www.youtube.com/watch?v=Rn4Kp8Wq2Zx",
      "title": "How to Start Running: A Beginner's Guide",
      "is_short": false,
      "thumbnail": "https://i.ytimg.com/vi/Rn4Kp8Wq2Zx/hqdefault.jpg",
      "duration_seconds": 612,
      "views": 2300000,
      "published": "1 year ago",
      "channel_id": "UC0000000000000000000003",
      "channel_name": "Run With Me",
      "channel_handle": "runwithme",
      "badges": [
        "4K"
      ],
      "description": "Everything you need for your first 5K."
    }
  ],
  "page": {
    "next_cursor": "eyJ0b2tlbiI6IkVnWlEifQ",
    "has_more": true
  },
  "meta": {
    "platform": "youtube",
    "endpoint": "search",
    "params": {
      "q": "running",
      "sort": "relevance"
    },
    "request_id": "sp_req_1f8c2d3e4a5b6c7d",
    "api_version": "v1",
    "fetched_at": "2026-11-30T09:30:00Z",
    "cached": false
  }
}

An illustrative answer: live answers have the same shape, with the page's current data.

Every field, with its type, is in the API reference, and every error code in Errors.

Price

Each call costs 1 credit, a not-found answer too. Cached answers and other errors cost nothing, and credits never expire. New accounts start with 100 free credits. See pricing for the packs.

FAQ

Which filters are there?

type (video or short), duration (under_3_min, 3_to_20_min, over_20_min), time (day, week, month, year), sort (relevance or popular) and region, a country's two-letter code.

Which country are results from?

US when region is left out; pass GB, IN or any two-letter code to see results as YouTube ranks them there.

How many results a page?

10 to 20 videos a page, plus the Shorts YouTube mixes in. is_short tells them apart.

Works with

On other platforms

Use cases

YouTube guides

Start free

Your first 100 credits are on us

Sign up, create a key and make your first call in a few minutes.

No credit card required