youtube data api v3 reference
buy me a coffee

user@youtube:~$ man zerodig

documentation

Everything zerodig can do, how it talks to the YouTube Data API, and how to keep your API key safe. No account, no server, no tracking.

01

Quick start

zerodig is a client-side interface to the YouTube Data API v3. It runs entirely in your browser and exposes every search filter the API offers, plus local filters the API can't do (views, likes, length).

  1. Get a free API key (see §02).
  2. Paste it into the key field on the search page and hit Save. It is stored only in your browser (localStorage).
  3. Type a query, pick a type (video / channel / playlist), tune the filters, and hit Search. Use Load more to page deeper into results.

Presets

One-click filter setups. Click one to apply its filters, then hit Search:

  • Hidden Gems: under 1,000 views and at least a year old, sorted fewest-views-first.
  • Fresh Drops: uploaded in the last 7 days, newest first.
  • Deep Dives: long videos (20min+), most-viewed first.

Hit + save current to store your own filter setup as a custom preset (the query is left out, so it works on any search). To save a whole search including its query, run it and hit ☆ star above the results; starred searches are listed under ★ starred searches in the builder, one click to re-run.

02

Get an API key (free)

The default quota is 10,000 units per day and needs no billing account.

  1. Open the Google Cloud Console ↗ and create or select a project.
  2. Enable the API: YouTube Data API v3 library ↗Enable.
  3. Create the key: APIs & Services → Credentials ↗Create credentials → API key.
  4. Copy the key, paste it into zerodig, hit Save.

Then lock it down (see §03).

03

Secure your key

Because zerodig is a static site, the key travels only to Google, but anyone who opens the page and looks at the browser's network tab can read it while you use it. Restrict it so a leaked key is useless to others:

  1. Open your key in Credentials ↗.
  2. Application restrictions → HTTP referrers, add:
    https://flazeiguess.github.io/zerodig/*
    (and http://localhost:* if you run it locally).
  3. API restrictions → Restrict key → select only YouTube Data API v3.
  4. Save. Referrer + API restrictions mean the key only works from your page, only for this API.
Want it fully hidden? Move the two fetch calls behind a tiny proxy (Cloudflare Worker / Django) that holds the key server-side. The frontend logic stays identical; only the request origin changes.
04

How it works

The API can't sort or filter by view count, likes or exact length, so zerodig runs a two-stage workflow, entirely client-side:

  1. Search via search.list with your native filters. Costs 100 units per page, returns up to 50 ids.
  2. Enrich: depending on result type, one call fetches the details the search result lacks (1 unit each): videos.list (statistics + length), channels.list (subscribers, video count) or playlists.list (item count).
  3. Filter & sort locally: apply your views / likes / length filters and re-sort the enriched results (see §06).
  4. Auto-page: follow nextPageToken until it reaches your dig depth (pages per run) or stop-after target. Load more resumes from where it stopped.

The live console on the search page prints every page fetched and the running quota cost.

05

Filter reference: native (server-side)

These map directly onto search.list parameters. Video-only rows require type = video and hide automatically for channel / playlist searches.

filterparametervalues
queryq"exact phrase", a|b (OR), -exclude
exclude wordsqeach word is appended as -word
typetypevideo · channel · playlist · all
orderorderrelevance · date · rating · viewCount · title · videoCount
published afterpublishedAfterdate (RFC 3339)
published beforepublishedBeforedate (RFC 3339)
regionregionCodeISO 3166-1 alpha-2 (US, DE, JP …)
languagerelevanceLanguageISO 639-1 (en, de, ja …)
safe searchsafeSearchmoderate · none · strict
within channelchannelIda channel id (UC…)
durationvideoDurationshort (<4m) · medium (4-20m) · long (>20m)
definitionvideoDefinitionhigh (HD) · standard (SD)
dimensionvideoDimension2d · 3d
captionsvideoCaptionclosedCaption · none
licensevideoLicenseyoutube · creativeCommon
video typevideoTypemovie · episode
categoryvideoCategoryIdMusic, Gaming, Education, News …
eventeventTypelive · upcoming · completed
embeddablevideoEmbeddabletrue
syndicatedvideoSyndicatedtrue (plays outside youtube.com)
paid promotionvideoPaidProductPlacementtrue
locationlocation + locationRadiuslat,lng + e.g. 25km
per pagemaxResults1-50
06

Local filters & sort (client-side)

The API offers none of these, so zerodig applies them after fetching statistics. They act on video results; channels and playlists pass through unfiltered.

controleffect
min / max viewskeep videos within a view range
min likeskeep videos with at least N likes
min / max lengthkeep videos within a length range, in seconds
sort resultsre-order locally: views ↑ / views ↓ / likes ↓ / newest / oldest / longest / shortest
order vs. sort. order is the API's ranking; it decides which 50 results each page returns. sort results re-orders what you've already fetched (including views ascending, which the API can't do). Use both together: e.g. order by date, then sort locally by views ↑.
07

Quota & limits

Every project gets 10,000 units per day by default (resets at midnight Pacific). zerodig tracks today's usage in the status bar and footer.

callcost
search.list100 units per page
videos / channels / playlists .list1 unit per page

So one page costs ~101-103 units. A dig depth of 3 is roughly 309 units; the default budget allows about 30 such runs per day. The quota docs ↗ explain how to request more if you need it.

Running low? Lower the dig depth, narrow the query, or keep a second API key (from another project) as a reserve.
08

Privacy

zerodig has no backend. There is no account, no analytics, no cookies, and no request ever goes anywhere except directly to Google's API from your browser.

Three things live in your browser's localStorage and nowhere else: your API key, your last filter config, and today's quota counter. Clearing your browser data for this site removes all of them.

09

Notes & FAQ

The two modes: API vs YouTube URL

API search (default) uses your API key, shows results in-app, and has the full filter set plus local view/like/length filters. YouTube URL uses no key and no quota: it builds a youtube.com search link from YouTube's own filters (sort, upload date, type, duration, and features like HD, Creative Commons, 4K, Live) and opens it on YouTube. Fewer filters and no in-app results, but unlimited use. Switch with the mode toggle at the top of the builder.

Deep dig: getting past YouTube's ~500-result limit

The Search API returns at most about 500 results per query. Turn on deep dig (in fetching & depth) and zerodig splits your date range into slices and digs each one separately, so you can pull thousands of low-view videos instead of 500. Pick the number of date slices (more = deeper and pricier); the cost is slices × depth × 100 units and is shown live. Results stream in slice by slice.

Memory: never dig the same hole twice

zerodig remembers every video you open, dismiss (the × on a result), or mark these seen, in your browser. With hide seen on (default), each new dig skips what you have already seen, so you never wade through the same results twice. Use mark these seen to bury a whole page at once, the × to bury one, and reset to forget everything. It is all local to your browser.

Does zerodig save API quota?

Yes, through a cache. Every search page you fetch is stored in your browser, so repeating the same search (same query and native filters) within the cache window is served locally at 0 units. Changing a local filter (views, likes, length) also reuses the cache, since those are applied after fetching. Set the cache window in fetching & depth, watch the live cache hit (0u) line in the console, or turn the cache off for fresh live data. Deep dig and memory do not save quota by themselves; the cache is the real saver.

What is the budget guard and the "left today" number?

Every project gets 10,000 units a day. zerodig shows how many are left today next to the estimate and asks for confirmation before a dig that would exceed the remaining budget, which is handy for deep dig.

Can I use more than one API key?

Yes. Put several keys in the key field, separated by spaces. When one hits its daily quota, zerodig automatically switches to the next, multiplying your effective budget.

Why do some videos show “n/a” views?

The uploader hid the view count. zerodig shows n/a and sorts them last; they're excluded when a numeric view filter is active, since the value can't be verified.

Why did my video filters disappear?

Duration, definition, category and the other video attributes only apply to type = video. They hide when you search channels or playlists.

How do I search only Creative Commons music from 2010?

type video, category Music, license creativeCommon, published after 2010-01-01 / before 2010-12-31.

Can I find the least-viewed results?

Yes: set sort results to views ↑ (and optionally a max views cap). The API can only sort views descending; the ascending sort is done locally.

Operators in the query box

"exact phrase" matches the phrase, a|b means a OR b, and a leading - excludes a term. The exclude-words field adds - for you.

Are related-video searches supported?

No. YouTube removed the relatedToVideoId parameter in 2023, so no tool can offer it anymore.

Source on GitHub ↗ · YouTube search.list docs ↗