# YouTube search API: find videos and channels by keyword

Run a YouTube search from your agent and get the results as data: titles, video ids, channels, publish dates and thumbnails, with the filters the site itself offers. 5 providers do this through one treg.to key. Google's own API is free on your account and the single most quota-expensive call it has, which is why the others are here.

## What's the best way to ask ChatGPT?

Setup line (paste into any agent): `set up treg — https://treg.to/llms.txt`

Then ask: "Using treg, search YouTube for videos about home espresso uploaded in the last month, sorted by view count. Show me the price first, then give me the top 20 with links."

- **Say what to search for** A keyword, the way you would type it into the site's own box.
- **Name the filters** Upload date, duration, type and sort order are parameters on every provider.
- **Ask for videos or channels** The same query returns either. Say which, or you get a mix.
- **Ask for stats separately** Search results carry no view counts. The agent fetches those next.

## Why go through treg.to

- **One key, not 9 accounts** treg.to holds the provider keys. Neither you nor the agent sees them.
- **Price before the call** The provider's own rate, $0.000 markup, from a prepaid balance.
- **No subscription, no seats** Charged per call. $1.00 free per new team, no card to start.
- **Your own keys are free** Already pay Hunter? Register it and those calls are never metered.
- **Switch by changing a word** Another provider is a different word in the prompt, not a new integration.
- **Nothing to integrate** No SDK, no OAuth dance per vendor, no seats.

## Behind the scenes: what ChatGPT sees before it calls

treg.to does not choose for you. It hands ChatGPT this comparison and it picks, or you tell it how.

### Which YouTube search API is cheapest?

- Cheapest per found: TikHub at $0.001 (`tikhub.x.youtube-web-search-video`)
- Cheapest per call: ScrapeCreators at $0.00188 (`scrapecreators.x.v1-youtube-search`)

Those units are not interchangeable: one call can return many results, so compare on the unit you will actually be billed in.

### Which one is the most reliable?

- YouTube: 100% over 8 calls, 261ms median
- TikHub: 100% over 270 calls, 1.3s median
- ScrapeCreators: 100% over 340 calls, 3.7s median

Measured on treg.to traffic; not a controlled benchmark.

### How do the providers compare?

| Provider | Price | Accepts | Verified |
|---|---|---|---|
| TikHub | $0.001 per found | search_query, language_code, order_by, country_code, continuation_token, time_zone | 2026-07-28 |
| ScrapeCreators | $0.00188 per call | query, uploadDate, sortBy, type, duration, region | unverified |
| Just One API | $0.0148 per found | keyword, continuationToken, uploadDate, type, duration, features | 2026-07-28 |
| SerpApi | $0.015 per found | engine, search_query, gl, hl, sp | 2026-07-28 |
| YouTube | own account, free | part, q, type, order, publishedAfter, regionCode | 2026-07-28 |

Endpoints:

- `justoneapi.x.youtube-search-v1`: treg call justoneapi.x.youtube-search-v1 --query keyword=coffee
- `scrapecreators.x.v1-youtube-search`: treg call scrapecreators.x.v1-youtube-search --query sortBy=relevance
- `serpapi.youtube.search.videos`: treg call serpapi.youtube.search.videos --query engine=youtube --query search_query=coffee
- `tikhub.x.youtube-web-search-video`: treg call tikhub.x.youtube-web-search-video --query search_query=Minecraft
- `tikhub.x.youtube-web-v2-get-general-search`: treg call tikhub.x.youtube-web-v2-get-general-search --query search_query=Python编程
- `tikhub.youtube.search.videos`: treg call tikhub.youtube.search.videos --query keyword=coffee --query type=video
- `youtube.youtube.search.videos`: treg call youtube.youtube.search.videos --query part=snippet --query q=design tutorial --query type=video --query maxResults=2
- `tikhub.x.youtube-web-search-channel`: treg call tikhub.x.youtube-web-search-channel --query channel_id=UCXuqSBlHAE6Xw-yeJA0Tunw --query search_query=AMD
- `tikhub.x.youtube-web-v2-search-channels`: treg call tikhub.x.youtube-web-v2-search-channels --query keyword=Rick Astley

## What people actually struggle with

This is the job where the free route runs out first, and the people who have hit it are unusually precise about why. From ~180 Reddit and X posts in August 2026, with the vendor clusters excluded.

**One number decides this whole page**

> "The official Data API v3 search.list costs 100 units/call against a 10k/day quota, which dies almost immediately once you're polling multiple keyword combos" (r/webscraping, 7 points: https://www.reddit.com/r/webscraping/comments/1uaq3lk/keywordsearching_youtube_at_scale_official_api_vs/)

What this page can do about it: Exactly right, and worth stating as arithmetic: 100 units a search against a 10,000 unit day is about 100 searches for the entire project, before you spend anything hydrating the results with view counts. Every other call on this page costs 1 unit. That gap is the reason the paid rows on this page exist.

**Trading a hard cap for an unknown one**

> "Roughly what request rate gets you rate-limited / soft-banned on the InnerTube route?" (r/webscraping, 7 points: https://www.reddit.com/r/webscraping/comments/1uaq3lk/keywordsearching_youtube_at_scale_official_api_vs/)

What this page can do about it: Nobody in the research knew, including the person who asked, and we do not either. What we can say is that the request leaves the provider's infrastructure rather than yours, and that the measured success rates shown here are live traffic rather than a claim. That is the honest version of an answer to this question.

**Search results are not what a person sees**

> "I want an API or scraper which helps me replicate the same results when I do a search on mobile. Is there a way?" (r/n8n, 1 point: https://www.reddit.com/r/n8n/comments/1rkmsj4/youtube_scraper/)

What this page can do about it: No, not exactly, from anyone. On the site the ranking is personalised, regional and signed in; these calls are none of those. Pass a region and language to get nearer a market. No comparison table can tell you whose ordering matches your users, so run your own query through two providers for a cent and diff the two lists.

**An agent will write the expensive version by default**

> "The problem is my playlist contains 1.2k songs but I can only transfer around 60 songs and after that its an error" (r/learnpython: https://www.reddit.com/r/learnpython/comments/1hk199a/help_needed_exceeded_youtube_api_quota_while/)

What this page can do about it: ChatGPT wrote them a loop that runs one search per track, which at 100 units each is a dead project at song 100. This is the failure this page is really about: the code is fine and the quota model is what nobody read. Tell your agent the price first and it can tell you the run is unaffordable before it starts.

**The actual job is a sweep, not a search**

> "So I built a Python script to scrape YouTube Shorts from a specific niche (AI kids bedtime stories), pull stats, transcripts" (r/shortsAlgorithm, 78 points: https://www.reddit.com/r/shortsAlgorithm/comments/1rh2bek/i_scraped_53_youtube_shorts_from_a_single_niche/)

What this page can do about it: Search, then details, then transcripts, over a niche, on a schedule. That is three jobs on this menu chained, and it is what almost everyone doing this actually wants. Per call pricing makes the sweep something you can size in advance instead of a quota you discover the edge of.


## What actually differs

- Search results carry no statistics anywhere. To rank what you found by views you take the video ids and call the video details job, which on Google's own API costs 1 quota unit for 50 ids. Budget for two steps, not one.
- Google's search method costs 100 quota units against a default 10,000 a day, so about 100 searches exhausts a day for the whole project. Every other call on this page costs 1. That single number is why paid search providers exist at all.
- SerpApi's parameter is search_query, not q. Sending q to its YouTube engine returns nothing rather than an error, which is the kind of failure that looks like an empty result set.

## What does a YouTube search API return?

A page of search results as structured records: video id, title, description snippet, channel name and id, publish date and thumbnails, plus a token to fetch the next page. It is the site's own ranking, not a fresh index, so results move as YouTube's does and two calls minutes apart can legitimately differ.

## Questions

**Why does YouTube search cost so much quota?** Google prices the search method at 100 units against a 10,000 unit daily default, roughly 100 searches a day for an entire project. Reading a video, a channel or a comment thread costs 1. A quota increase means an application and a review.

**Can I search a single channel's videos?** Yes. Google's search takes a channelId, and one TikHub endpoint searches within a channel by id. The comparison above names which endpoint does which.

**Do search results include view counts?** No, on any provider. That is a second call to the video details job, which is cheap and batches, so ask your agent for both and it will chain them.

**Is this the same ranking a user sees?** Close, but not guaranteed. Results are personalised and regional on the site, and these calls are not signed in as you. Pass a region and language to get nearer a given market.

HTML version: https://treg.to/use-cases/youtube-video/search-videos-and-channels-by-keyword