Blog/Social data
5 min read

YouTube Scraper API: Search, Channels and Comments in Code

Search YouTube, list a channel's videos and pull stats and comments with one key, billed per call. We ran every endpoint live on 2026-10-16.

YouTube Scraper API: Search, Channels and Comments in Code

Search YouTube for a topic and get views, duration and channel for every video in one prompt. Paste this into your agent:

Set up https://monid.ai/SKILL.md, and then use Monid to search YouTube for "crawl4ai tutorial", keep only full videos and drop shorts and playlists, sort by views, and give me a table with title, channel, views, duration and link.

One prompt turns a search into a table. 1 min setup · 12-24 hrs saved.

You want what YouTube shows you, but as rows: the videos for a topic, every video of a channel, the stats and comments of one video. This guide shows the quickest way to get them into your agent or your spreadsheet, what each record contains (we ran the endpoints live on 2026-10-16), and the traps in the output, from a search timestamp that is not a date to a channel listing with no subscriber count. It runs through Monid, the OpenRouter for agent tools: one key, one balance, every tool priced per call.

What is the easiest way to scrape YouTube search results through an API?

Monid. Install it once, add a key, and your agent calls a YouTube search endpoint with a keyword and gets ranked videos back as typed JSON, with no scraper to host and no vendor account to set up.

  • Pay per call. A search page of 20 results is billed on its own, at $0.002 (Verified 2026-10-16 on the YouTube tools page). Buy calls as you need them: no monthly plan and no minimum top-up. Discovery and inspection are free; only a run bills.
  • One install, every API. The same key and the same balance call YouTube search, channel listings, video stats and comments, and every other tool on Monid. Wiring a different provider for each of those yourself is the 12 to 24 hours this page claims to save.
  • Lives inside your agent. Install the CLI, add your key, run the prompt above, and the tools are there whenever your agent needs them, on demand, with nothing to keep running. Your agent reads SKILL.md and learns the rest, so setup is about a minute.

At that price, 100 search pages, 2,000 results, cost about $0.20 (Verified 2026-10-16).

📖 See also Social media scraping APIs compared

How do you scrape the videos of a whole topic or channel?

Search for a topic with one endpoint, and list a channel with another: two shapes, both billed per call. A scraper that does both in one actor exists as well, and the table shows where it fits.

RouteWhat you getCost shapeFits
Browser extensionOne page of results, by handFree or subscriptionLooking at a few videos
Build your own scraperWhatever your parser coversYour hoursA fixed job you will maintain
Marketplace actorSearch, channels and playlists in one runPer result plus a flat feeBulk runs with many filters
Monid search and channel endpointsRanked videos for a keyword, or one channel's list, as typed JSONPay per call, buy flexiblyTopics, channel audits, agents

Monid fits because each call returns a whole page and you pay for the pages you pull and nothing between runs.

For agents

Grab an API key at app.monid.ai, then paste this to your agent and hand it the key:

set up https://monid.ai/SKILL.md

It learns the whole discover, inspect, run workflow itself. More in the agent quickstart.

For humans

npm install -g @monid-ai/cli
monid keys add -k <your-api-key> -l main

Find the endpoint that matches the job

monid discover -q "youtube channel videos"
monid inspect -p apify -e /streamers/youtube-scraper

Both are free. Discovery lists the providers that cover YouTube with their billing shape, and inspect prints the full input schema and the price notes before you spend anything.

Search a topic

monid run -p dataforseo -e /serp/youtube-organic -w -i '{
  "keyword": "crawl4ai tutorial",
  "location_code": 2840,
  "language_code": "en",
  "block_depth": 20
}'

location_code 2840 is the United States. One call returns one page of 20 blocks; the page we pulled held 19 items. Raise block_depth only when you want more pages, because each further page of 20 is billed again.

List a channel's videos

monid inspect -p tikhub -e /api/v1/youtube/web_v2/get_channel_videos
monid run -p tikhub -e /api/v1/youtube/web_v2/get_channel_videos -w \
  --query '{"channel_id": "UCJHBJ7F-nAIlMGolm0Hu4vg", "language_code": "en-US"}'

The input is a UC... channel ID, not an @handle. The first page returned 30 videos and a continuation_token; send the token back as continuation_token for the next page (exporting a channel's videos to CSV loops it to the end). A 600-video channel at 30 a page is 20 calls, about $0.02 (Verified 2026-10-16).

Filter in the search, not afterwards

The marketplace actor takes filters for date, length and sort order, and it accepts a transcript option. This is its search call, inspected but not run, so the output is not described here:

monid run -p apify -e /streamers/youtube-scraper -w -i '{
  "searchQueries": ["crawl4ai tutorial"],
  "maxResults": 2,
  "videoType": "video",
  "sortingOrder": "relevance",
  "transcriptionAndSubtitle": "NONE"
}'

Its listed price is $0.0024 per result plus a flat fee of $0.0006 (Verified 2026-10-16), and the per-result price applies per query in the input. Pass one query at a time until you know what a run returns.

Or hand the whole job to an agent

Give this to your agent

$Set up https://monid.ai/SKILL.md, and then use Monid to search youtube for the ten most viewed videos about crawl4ai, drop shorts and playlists, and give me title, views, channel and duration as a table.

Can you scrape YouTube yourself with Python?

Yes, people do it with yt-dlp, Playwright or plain HTTP requests, and it works until the page changes. A scraper you write is yours to keep alive: when YouTube changes its markup or starts blocking your IP, your job breaks, and the data is only as fresh as your last successful run.

There is a rules side too: rules differ by country and by use, so read the platform's terms and check the rules that apply to you before you build anything.

Doing it in Python means a proxy or browser setup, parsing code, consent-page handling, retries and paging logic, and a repair every time the page shifts. That is hours before the first useful row. A search page costs $0.002 (Verified 2026-10-16). Set against hours of your own time, the choice is easy: pick Monid for anything you will run more than once. The collection is maintained for you and the output is typed JSON instead of HTML you parse. Keep your Python for the analysis and call the endpoint from it like any HTTP API.

What does YouTube data look like, and what can you build with it?

Four kinds of record: the search row, the channel listing, the video detail and the comments. We ran all four on 2026-10-16 for the query "crawl4ai tutorial" and for one well-known gaming channel, so the fields below are what came back, not what a spec promises.

The search row

A search returns a mixed list. Ours held 19 items: 16 videos, of which 2 were shorts, and 3 playlists. A video row, trimmed:

{ "type": "youtube_video",
  "rank_group": 1, "rank_absolute": 1,
  "title": "Crawl4AI Official Tutorial, Full 1hr with Quickstart Examples",
  "video_id": "xo3qK6Hg9AA",
  "channel_id": "UCpnV0jtSvh4uifO7C6fSnVg",
  "channel_name": "Unclecode",
  "views_count": 62970,
  "publication_date": "1 year ago",
  "duration_time": "1:02:39",
  "duration_time_seconds": 3759,
  "is_shorts": false,
  "is_live": false }

Beyond these it carries url, thumbnail_url, channel_url, channel_logo, a cut-off description, highlighted terms, badges and is_movie. views_count is an integer, and duration_time_seconds saves you parsing the clock string. Playlist items carry playlist_id, videos_count and preview_videos instead.

The channel listing

The channel endpoint returns a channel object once, on the first page: name, description, handle_url, url, rss_url, keywords, is_verified and an avatar. Then 30 videos, each with video_id, title, duration, view_count, published_time, thumbnails and url. A continuation_token points at the next page.

The video detail

One call by video_id returns the numbers a search row lacks: for the top tutorial, likes_count 853, comments_count 93, the full description including its 15 chapter lines, a category, and channel_subscribers_count with a count of 2,500 next to the displayed "2.5K subscribers". It also lists the subtitle languages available, 18 of them, every one auto-generated. That list names the languages; it does not contain the text.

The comments

The comments call returns one page of 20 for that video, with author_name, author_url, text, publication_date, likes_count and reply_count. The response also states comments_count 93, so you know how many pages a full pull is before you start: five.

What you can build with it

  • A topic watch. Run the same search each week and diff the video_id lists to see which tutorials appeared. Channel stats and video metadata from one endpoint shows the same pattern for a single channel.
  • A creator shortlist. Group search rows by channel_id, then fetch the video detail for the top video of each channel to get subscribers and likes next to views.
  • A comment read. Pull the comments for the videos that matter and group them by what people ask. An agent can do the grouping for you.

What goes wrong when you pull YouTube data at scale?

Five things hide until you pull more than one page.

Is the timestamp in a search row a date?

No. It is derived from the relative text. The top tutorial showed publication_date "1 year ago" and a timestamp of 2025-10-17, which is the run date minus a year; the video detail for the same video says Apr 5, 2025. The same happened across rows: every "1 year ago" row got the same timestamp.

Treat search dates as a bucket, and take the real date from the video detail when it matters:

const exact = detail.items[0].publication_date;  // "Apr 5, 2025"

Because a YouTube results page mixes them. Our 19 items held 3 playlists and 2 shorts, flagged by type and is_shorts, so filtering is one line:

const videos = items.filter(i => i.type === "youtube_video" && !i.is_shorts);

Does a channel listing include subscribers and likes?

No. The channel object has no subscriber count and the video rows have no likes, and every description in the 30 rows was an empty string. Subscribers and likes come from the video detail call, 1 call per video. Fetch the detail only for the videos you will rank, not for every row.

Are counts exact?

Not always. The channel listing gives view_count as text, "954K views", and the detail gives the subscriber count as 2,500 beside "2.5K subscribers". The search row said 62,970 views while the detail, seconds later, said 62,971. Use the integers from the search or the detail, and parse the text only as a last resort.

How many calls is a full pull?

Count before you loop. One video with 93 comments is 5 comment pages, $0.01 at $0.002 a page (Verified 2026-10-16). A channel of 600 videos is 20 listing pages. 100 videos with a detail call each is 100 calls at $0.006, $0.60 (Verified 2026-10-16). Narrow with a stricter query first, and take the first page when the first page answers the question.

Which endpoint should I use for which job?

EndpointWhat it doesInputReturnsBilling
dataforseo/serp/youtube-organicSearch results for a keywordkeyword, location_code, language_code, block_depthVideos, shorts and playlists with channel, views and durationPer page of 20
tikhub/.../get_channel_videosOne channel's video listchannel_id, continuation_tokenChannel object, 30 videos a page, next tokenPer call
dataforseo/serp/youtube-video-infoOne video's detailvideo_idLikes, comments count, subscribers, full description, subtitle languagesPer call
dataforseo/serp/youtube-commentsOne video's commentsvideo_id, depthAuthor, text, likes, reply countPer page of 20
apify/streamers/youtube-scraperSearch, channels and playlists with filtersQueries or URLs plus filtersNot runPer result plus a flat fee

Billing shapes are above and the prices are inspected figures, Verified 2026-10-16: search $0.002 a page, channel list $0.001 a call, video detail $0.006 a call, comments $0.002 a page, and the marketplace actor $0.0024 a result plus a flat fee. The first four rows were run that day; the last was inspected only. Current figures are on monid.ai/tools.

The search and video-detail endpoints answer different questions. Search tells you what ranks for a phrase, in order; the detail tells you what one video is worth. A shortlist is search first, detail second, and keeping the two in separate steps keeps the call count where you expect it.

When is another route a better fit?

Your job is small and you want a free route. A few videos a day for your own channel is a job for the platform's own tools, not for a paid call.

You need contractual stability. If a changed field is a production incident with a customer on the other end, an unofficial source is the wrong dependency, whoever sells it.

You need every comment on a large set of videos. The comments endpoint returns 20 a page, so a big pull is many calls. Count the pages first, and set a cap per video before the first run.

You need the text of subtitles. The video detail lists the subtitle languages, not the text. Use a transcript endpoint for that, and check what it returns on one video before you run a batch.

You need a specialist. If YouTube is the whole of your product and you need very deep coverage of one surface, a vendor who does only that will out-cover a general catalog. A catalog is built for the opposite: many platforms, unpredictable volume, no contract per vendor.

And the disclosure: we resell these endpoints. The most useful thing in this post is that you should take dates and counts from the detail call and filter shorts yourself, which costs nothing and is a one-line fix whoever you buy the data from.

Conclusion

The quickest way to get YouTube search results, channel lists, stats and comments is one call per page through Monid: $0.002 for a search page of 20 (Verified 2026-10-16), one key for YouTube and everything else, about a minute to set up and ready inside your agent whenever you need it. Scraping it yourself works until the page changes, and costs hours of setup; Monid keeps the collection maintained.

Two traps cost us time. The timestamp in a search row is computed from "1 year ago", not read from the video, so take real dates from the detail call. And a channel listing carries neither subscribers nor likes, so decide which videos deserve a detail call before you loop.

How we estimated the time saved: building and running your own YouTube collection is roughly 4 to 8 hours each for search with consent and blocking handling, channel paging, and per-video details with comments, including the first month of upkeep. That is 12 to 24 hours. The 1 minute is the install, key and first call once you already have a Monid key.

Free next step: run monid discover -q "youtube channel videos" and monid inspect the top two results, then make one search call and print type, is_shorts and views_count next to the rank. Start at monid.ai.

FAQ

How do you scrape YouTube comments?

Take the video_id and call the comments endpoint, which returns 20 comments a page with author, text, likes and reply count. The response states the total, 93 for the video we tried, so you know the number of pages up front: five, about $0.01 at $0.002 a page (Verified 2026-10-16). Set depth to the number you want and cap it per video.

How do you scrape YouTube transcripts?

The video detail call lists which subtitle languages a video has, 18 for the tutorial we tried, all auto-generated, but not their text. The text comes from a transcript endpoint, and the marketplace actor above also takes a transcriptionAndSubtitle option. Treat transcripts as their own job with their own budget, and read what the endpoint returns for one video before you run a list. Every YouTube transcript, ready for your LLM covers the retrieval side.

How do you scrape YouTube channel emails?

Some creators publish a business email on their channel's about page, and an endpoint can collect the ones that are public, but a channel that did not publish an address has none to return, so a run over a hundred channels will not return a hundred emails. Rules on contacting people differ by country, so check the ones that apply to you before you send anything.

Is there a free YouTube scraper?

Free scrapers exist as extensions and open-source libraries, and they cost you maintenance instead of money. Through Monid discovery and inspection are free, and a run bills per call with no monthly plan and no minimum: a search page is $0.002 (Verified 2026-10-16).

Published August 2026.

youtube scraperyoutube scraper apiyoutube channel scraperyoutube comment scrapersocial data