Comparisons

YouTube Search API Without Quota Limits

The YouTube Data API allows about 100 searches a day. How its quota works, what it costs to go beyond it, and how to search YouTube from code without units.

By FetchTranscript teamPublished Updated 6 min read

The official YouTube Data API v3 gives each project 10,000 quota units a day and charges 100 units for every search, so a default project can run about 100 searches a day. To search YouTube from code beyond that, you either apply for a quota extension, scrape the results page yourself, or use a search API that bills per call instead of per unit. This guide explains how the quota works, what each option really costs, and shows working code for searching YouTube by keyword without units.

How the YouTube Data API quota works

Every request to the Data API costs a number of units, and every Google Cloud project gets a daily budget of 10,000 units by default, reset at midnight Pacific time. The costs that matter for search projects:

MethodCostWhat you get
search.list100 unitsOne page of up to 50 results
videos.list1 unitDetails of up to 50 videos
commentThreads.list1 unitOne page of comment threads
channels.list1 unitChannel details

So the budget is lopsided. You can read details of hundreds of thousands of videos a day, but only about 100 search pages. And a search result from search.list contains only snippets: to get durations and view counts you add a videos.list call per page.

When the budget runs out, every call fails with a quotaExceeded error until the next reset. Creating more projects to multiply the quota is against Google's API terms, and projects found doing it can be suspended.

The legitimate way up is the quota extension request: you fill in Google's audit form, describe your use case, and Google reviews your application for compliance with the YouTube API Services terms. Many teams get an increase; it takes time, it is not guaranteed, and the audit covers how you display and store the data. The details are in the official quota documentation.

Option 1: stay within the official quota

If you need a few dozen searches a day, use the Data API. It is free, first-party and stable. Some ways to stretch the budget:

  • Ask for maxResults=50 on every search: a page of 50 costs the same 100 units as a page of 5.
  • Cache results. The same query an hour later returns nearly the same videos.
  • Use videos.list (1 unit) instead of a search whenever you already know the IDs, for example from a channel's uploads playlist.

Option 2: scrape the results page

The YouTube results page embeds its data as a large JSON object, and tools such as yt-dlp can run searches with the ytsearch prefix (yt-dlp "ytsearch10:python tutorial" --flat-playlist --dump-json). On a laptop this is free and works well. On servers, YouTube rate-limits and challenges datacenter IP addresses, so at volume you end up running residential proxies, retries and a parser you update every time the page changes. That is a real engineering cost even if no invoice arrives.

Option 3: a search API billed per call

A hosted search API runs the scraping on its side and bills you per request. With the YouTube Search API of FetchTranscript, one search returns up to 50 videos and costs one credit, whatever the query:

Shell
curl -H "X-API-Key: yt_your_api_key" \
  "https://api.fetchtranscript.com/v1/search?q=python+tutorial&limit=20"
JSON
{
  "query": "python tutorial",
  "total_results": 20,
  "results": [
    {
      "video_id": "rfscVS0vtbw",
      "title": "Learn Python - Full Course for Beginners",
      "description": "This course will give you a full introduction into all of the core concepts in python...",
      "channel_name": "freeCodeCamp.org",
      "channel_id": "UC8butISFwT-Wl7EV0hUK0BQ",
      "duration": 16012,
      "view_count": 48000000,
      "thumbnail_url": "https://i.ytimg.com/vi/rfscVS0vtbw/hqdefault.jpg",
      "upload_date": null
    }
  ]
}

The parameters are q (required, the search text) and limit (1 to 50, default 10). Each result already carries the duration in seconds and the view count, so you do not need a second call to rank or filter. Results are videos only: the channels and playlists that the results page mixes in are left out. (The values above are illustrative.)

One limit to know: upload_date is null in search results, because the results page shows relative dates only. When you need the exact upload date, call the video metadata endpoint for the videos you keep.

Search YouTube with Python

Python
import requests

API_KEY = "yt_your_api_key"

def search_youtube(query, limit=50):
    response = requests.get(
        "https://api.fetchtranscript.com/v1/search",
        headers={"X-API-Key": API_KEY},
        params={"q": query, "limit": limit},
        timeout=30,
    )
    if response.status_code == 429:
        raise RuntimeError(f"rate limited, retry in {response.headers.get('Retry-After')} s")
    response.raise_for_status()
    return response.json()["results"]

# Long tutorials (over 20 minutes) about a topic, most viewed first
results = search_youtube("fastapi tutorial")
long_ones = [r for r in results if (r["duration"] or 0) > 20 * 60]
for r in sorted(long_ones, key=lambda r: r["view_count"] or 0, reverse=True):
    print(f'{r["view_count"] or 0:>12,}  {r["duration"] // 60:>4} min  {r["title"]}')

The SDK equivalent is client.search.videos("fastapi tutorial", limit=50) after pip install fetchtranscript.

Search YouTube with JavaScript

JavaScript
// Node 18+ as an ES module (a .mjs file, or "type": "module"), for the top-level await
const API_KEY = 'yt_your_api_key';

async function searchYouTube(q, limit = 10) {
  const url = new URL('https://api.fetchtranscript.com/v1/search');
  url.searchParams.set('q', q);
  url.searchParams.set('limit', String(limit));
  const res = await fetch(url, { headers: { 'X-API-Key': API_KEY } });
  const body = await res.json();
  if (!res.ok) throw new Error(`${body.detail.error}: ${body.detail.message}`);
  return body.results;
}

const results = await searchYouTube('react server components', 25);
console.table(results.map((r) => ({ id: r.video_id, channel: r.channel_name, views: r.view_count })));

Getting more than 50 results for a topic

A search call returns one page of up to 50 videos, and there is no second page to ask for. That matches how most people use YouTube search (the first results are the ones that get the views), but research projects often want more. The practical approach is to widen the net with several related queries rather than to go deeper into one:

  1. Start from a seed query, for example "home espresso".
  2. Add modifiers that real viewers type: "home espresso beginner", "home espresso machine review", "home espresso latte art", "home espresso grinder".
  3. Run each query with limit=50 and merge the results by video_id.
  4. Stop when new queries bring mostly videos you already have.

Ten queries cost ten credits and typically give a few hundred distinct videos. If what you really want is everything a set of creators has published, search is the wrong tool: take the channel_id values from the results and list each channel's uploads instead, page by page, as explained in how to get all videos from a YouTube channel.

Two more tips. Results reflect YouTube's ranking at the moment of the call, so store the date you ran each query if you compare rankings over time. And keep queries as people write them, typos and all: the results for the misspelt version of a brand are often different and revealing.

Comparing the costs

For a project that runs 1,000 searches a day:

ApproachDaily searches possibleMoneyEngineering
Data API, default quotaabout 100FreeLow, but blocked at 10 per cent of the need
Data API with an approved extensionAs approvedFreeAudit, compliance review, waiting
Self-hosted scrapingUnlimited in theoryProxies and serversParser and blocking upkeep
Per-call search APIUp to 500 requests per minuteAbout $1 for 1,000 searchesNone

Every FetchTranscript account gets 100 free calls a month, then it is $1 per 1,000 calls, and searches that fail are not billed. See the pricing page for bulk packs.

Useful search workflows

Build a research corpus. Search a handful of queries, deduplicate by video_id, then fetch the transcripts of the results. The Python transcript guide shows the second step, and the RAG guide shows how to chunk them for embeddings.

Monitor a niche. Run the same queries every day and store which video_id values are new. New entries in the results for "your product name review" are worth a look.

Find what an audience asks. Search a topic, keep the most viewed videos, then scrape their comments and count recurring questions.

Seed a channel crawl. The channel_id of each result lets you list that channel's videos with the channel endpoint.

Frequently asked questions

How many searches does the YouTube Data API allow per day?

With the default 10,000 units and 100 units per search.list call, about 100 search pages a day per project. Quota extensions are possible after Google's audit.

Is there a YouTube search API without a quota?

There is always a limit somewhere. A per-call API such as FetchTranscript has no daily units: you pay 1 credit per search, within 500 requests per minute. You can try the search endpoint free without an account.

Why is upload_date null in the search results?

The results page only shows relative dates such as "3 weeks ago". Call GET /v1/videos/{video_id} for the exact upload_date of the videos you keep.

Up to 50 per call with limit=50. Results are videos only, with title, channel, duration, views and thumbnail.

Can I use several Google projects to get more quota?

Splitting one application across projects to get around the quota is against Google's API terms and can get the projects suspended. Request an extension instead.

Try it on your own videos

100 free calls every month, no credit card. Then $1 per 1,000 calls, only for the calls that succeed.

← All articles