Better Fetch

YouTube Scraper

Search public YouTube, inspect channels, videos, Shorts, trending Shorts, live streams, playlists, community posts, sponsors, comments, and comment replies.

Socialv0.9.3~1 credit/runSource on GitHub

Workspace

Configure

Inputs stay here while results become exportable artifacts.

Start from an example

Operation to run. If omitted, the tool infers it from query, channel_url, or video_url.

YouTube search query. Use either query or channel_url.

Hashtag with or without the leading #. Used by hashtag_search mode.

Public youtube.com/post URL or community post id. Used by community_post mode.

Public YouTube watch, Shorts, youtu.be, or embed URL used by video, video_comments, comment_replies, and video_sponsors modes.

Public parent YouTube comment id required by comment_replies mode. video_comments returns this as each comment's id.

Public YouTube channel URL used by channel modes.

Maximum video cards to return

Public YouTube playlist id or playlist URL. Used by playlist mode.

Return all visible hashtag content or only Shorts.

Sign in and run
~1 base credit/run10 runs/minute

Results

Preview, inspect, copy, or export the complete output.

Your result will become an artifact

Run the tool to inspect structured rows, raw JSON, execution details, and downloadable JSON, CSV, and Markdown files.

countpostssourcevideoschannelcommentsplaylistplaylists

Overview

YouTube Scraper gives agents a focused way to collect public YouTube data without using a private account. It renders public YouTube surfaces through Better Fetch, parses page and network data, deduplicates results, and returns normalized fields that are easy to save, compare, or pass into an LLM workflow.

Last validated: Aug 9, 2026

Input

mode"search" | "channel" | "channel_videos" | "channel_shorts" | "channel_lives" | "channel_playlists" | "channel_posts" | "hashtag_search" | "playlist" | "community_post" | "video_comments" | "comment_replies" | "video_sponsors" | "trending_shorts" | "video"

Operation to run. If omitted, the tool infers it from query, channel_url, or video_url.

querystring

YouTube search query. Use either query or channel_url.

hashtagstring

Hashtag with or without the leading #. Used by hashtag_search mode.

post_urlstring

Public youtube.com/post URL or community post id. Used by community_post mode.

video_urlstring (uri)

Public YouTube watch, Shorts, youtu.be, or embed URL used by video, video_comments, comment_replies, and video_sponsors modes.

comment_idstring

Public parent YouTube comment id required by comment_replies mode. video_comments returns this as each comment's id.

channel_urlstring (uri)

Public YouTube channel URL used by channel modes.

max_resultsintegerdefault: 10

Maximum video cards to return

playlist_idstring

Public YouTube playlist id or playlist URL. Used by playlist mode.

content_type"all" | "shorts"default: "all"

Return all visible hashtag content or only Shorts.

Output

countintegerrequired

Number of primary records returned for the selected mode

postsobject[]

Public channel community posts or one community post detail

sourcestringrequired

Search query, channel URL, video URL, playlist id, hashtag, or post id used

videosobject[]required

Public YouTube video cards

channelobject

Public channel metadata when channel mode is used

channel.urlstring
channel.titlestring
channel.avatarstring
channel.rss_urlstring
channel.channel_idstring
channel.handle_urlstring
channel.descriptionstring
channel.is_family_safeboolean
commentsobject[]

Logged-out public comments or replies returned by video_comments and comment_replies modes

playlistobject

Public playlist metadata when playlist mode is used

playlist.urlstring
playlist.ownerstring
playlist.titlestring
playlist.updatedstring
playlist.owner_urlstring
playlist.thumbnailstring
playlist.views_textstring
playlist.descriptionstring
playlist.playlist_idstring
playlist.total_videosinteger
playlist.owner_channel_idstring
playlistsobject[]

Public channel playlists when channel_playlists mode is used

source_urlstringrequired

Fetched YouTube URL

total_countinteger

Total public comment count displayed by YouTube when video_comments mode is used

sponsor_videoobject

Video and paid-promotion context for video_sponsors mode

sponsor_video.idstring
sponsor_video.urlstring
sponsor_video.titlestring
sponsor_video.channelstring
sponsor_video.channel_idstring
sponsor_video.channel_urlstring
sponsor_video.is_paid_promotionboolean
sponsor_segmentsobject[]

Public community sponsor/self-promotion timing segments from SponsorBlock

parent_comment_idstring

Parent comment id expanded by comment_replies mode

sponsor_detectionobject

Detection status, methods, and epistemic caveat

sponsor_detection.notestring
sponsor_detection.statusstring
sponsor_detection.methodsstring
continuation_tokenstring

Public continuation token when YouTube exposes another page of channel posts

suspected_sponsorsobject[]

Brands inferred from explicit public description evidence

comments_continuation_tokenstring

Evidence token exposed by YouTube for another public comment or reply page; pagination is not yet executed by this tool

Examples

video-details

{
  "mode": "video",
  "video_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
}

search-openai

{
  "mode": "search",
  "query": "openai",
  "max_results": 3
}

channel-details

{
  "mode": "channel",
  "channel_url": "https://www.youtube.com/@OpenAI"
}

channel-videos

{
  "mode": "channel_videos",
  "channel_url": "https://www.youtube.com/@OpenAI",
  "max_results": 3
}

channel-shorts

{
  "mode": "channel_shorts",
  "channel_url": "https://www.youtube.com/@OpenAI",
  "max_results": 3
}

channel-lives

{
  "mode": "channel_lives",
  "channel_url": "https://www.youtube.com/@OpenAI",
  "max_results": 3
}

channel-playlists

{
  "mode": "channel_playlists",
  "channel_url": "https://www.youtube.com/@OpenAI",
  "max_results": 3
}

hashtag-search

{
  "mode": "hashtag_search",
  "hashtag": "funny",
  "max_results": 3,
  "content_type": "all"
}

playlist-details

{
  "mode": "playlist",
  "max_results": 3,
  "playlist_id": "PLP32wGpgzmIlInfgKVFfCwVsxgGqZNIiS"
}

video-sponsors

{
  "mode": "video_sponsors",
  "video_url": "https://www.youtube.com/watch?v=AVO0ifle-OU"
}

video-comments

{
  "mode": "video_comments",
  "video_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "max_results": 10
}

comment-replies

{
  "mode": "comment_replies",
  "video_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "comment_id": "Ugzge340dBgB75hWBm54AaABAg",
  "max_results": 10
}

trending-shorts

{
  "mode": "trending_shorts",
  "max_results": 10
}

channel-posts

{
  "mode": "channel_posts",
  "channel_url": "https://www.youtube.com/@MrBeast",
  "max_results": 3
}

community-post

{
  "mode": "community_post",
  "post_url": "https://www.youtube.com/post/UgkxyRcQsbZeMdE9xN9WUohTnrQtxquVCbaE"
}

Use cases

Video research

Search YouTube for a topic and return structured video cards for market research, content planning, or source discovery.

Channel monitoring

Inspect a public channel videos tab and capture recent titles, URLs, view counts, durations, thumbnails, and publish-time labels.

Agent briefs

Let an agent gather public YouTube results and summarize visible metadata before deciding which videos need deeper review.

Comment research

Collect public comments or expand a targeted parent thread into normalized replies with author, like, permalink, and continuation evidence.

Trending Shorts discovery

Collect YouTube's current logged-out Shorts sequence with public engagement, channel, publish, duration, keyword, and thumbnail metadata.

FAQ

Does YouTube Scraper download video files?

No. It returns public metadata from YouTube pages and does not download video media, captions, private analytics, or account-only data.

Can it scrape private or age-gated videos?

No. The tool is designed for public YouTube pages visible to the Better Fetch browser session without user-specific authentication.

Why are view counts returned as text and numbers?

YouTube often renders compact labels such as 1.2M views. The tool preserves the visible text and also returns a best-effort integer when it can parse one.

Does comment collection require a YouTube login?

No. video_comments and comment_replies use the public logged-out watch page and return only discussion data YouTube exposes to that browser session.

Use it anywhere

MCP (Claude, ChatGPT, Codex)

# After connecting https://betterfetch.co/api/mcp, ask your AI to:
1. Call search_tools for "YouTube Scraper"
2. Call run_tool with:
   name: "youtube_scraper"
   input: {"mode":"video","video_url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ"}

REST

curl -sS -X POST "https://betterfetch.co/api/tools/youtube_scraper/run" \
  -H "Authorization: Bearer bf_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"input": {"mode":"video","video_url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ"}}'

Run locally

git clone https://github.com/better-fetch/tools/tree/main/tools/youtube-scraper && cd youtube-scraper && npm i
BETTER_FETCH_API_KEY=bf_your_key_here npx bf-tool run --input '{"mode":"video","video_url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ"}'