YouTube Scraper API for Audience Sentiment and Content Intelligence
The SurfSense YouTube API pulls videos, channel stats, comments, and transcripts at scale, without YouTube Data API quotas. Feed your AI agents every comment and transcript that matters to your market, so you know what people actually think about your product and your competitors' content.
$
youtube.comments({ urls: ["youtube.com/watch?v=launch"],
max_comments: 500, sort_by: "TOP_COMMENTS" })- "Finally an API that does not throttle my agent"@devbuilds · 214 likes · creator heartedpositive
- "How does pricing compare to the incumbent?"@growthlee · 96 likes · 12 repliesbuying intent
- "Does it handle transcripts too or just metadata?"@ml_ana · 71 likes · 8 repliesfeature ask
500 comments · 78% positive · surfaced in 3.4s
What you can extract from YouTube
Give the API video URLs, channel or playlist URLs, or search queries. It returns structured video items; a separate comments call returns full comment and reply trees for any video.
Video metadata
Title, view count, likes, duration, publish date, hashtags, and description.
Channel stats
Subscriber count, total views, total videos, join date, and verified status.
Comments and replies
Author, comment text, vote counts, reply counts, and creator-heart flags.
Transcripts
Subtitle tracks per video in the language you request, ready as agent context.
Content types
Standard videos, Shorts, and live streams, capped independently per source.
Engagement
Likes, comment counts, and monetization or members-only flags per video.
What teams do with the YouTube API
Comment sentiment at scale
Read every comment on your launch video or a competitor's ad, not a sample. Score product feedback and ad reaction so your team knows what actually resonated with the audience.
Competitor channel analysis
Pull a rival channel's full catalog with views, likes, and cadence to see which content wins in your niche, then brief an agent to spot the patterns you should copy.
Influencer vetting
Before you sponsor a creator, scrape their real view counts, comment sentiment, and posting history so you pay for genuine reach instead of a vanity subscriber number.
Transcripts as agent context
Download transcripts to feed RAG pipelines and research agents. Turn hours of video into searchable, citable context your agents can reason over in seconds.
Call it from your code or your agent
One typed endpoint, one API key. Or add the SurfSense MCP server and let your agent call youtube.scrape as a native tool.
curl -X POST "$SURFSENSE_API_URL/workspaces/$WORKSPACE_ID/scrapers/youtube/scrape" \
-H "Authorization: Bearer $SURFSENSE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"search_queries": [
"your topic"
],
"max_results": 50,
"download_subtitles": true,
"subtitles_language": "en"
}'YouTube API request and response schema
The exact contract behind POST /workspaces/{workspace_id}/scrapers/youtube/scrape. The same fields power the youtube.scrape MCP tool.
Request parameters
Provide at least one source: urls or search_queries. Up to 20 of each per call.
| Field | Type | Description |
|---|---|---|
urls | string[]default [] | YouTube URLs to scrape: a video, channel (/@handle or /channel/UC...), playlist (?list=...), shorts, or hashtag page. Max 20. |
search_queries | string[]default [] | Search terms to run on YouTube. Each returns up to max_results videos. Max 20. |
max_results | integerdefault 10 | Max items per source and per content type, 1 to 1,000. For a channel, videos, shorts, and streams are capped independently. |
download_subtitles | booleandefault false | Also fetch each video's subtitle track. Slower. |
subtitles_language | stringdefault "en" | Subtitle language code, e.g. 'en', 'fr'. Used when download_subtitles is true. |
Response fields
The response is { items: [...] } with one item per video, short, or stream. One returned item is one billable unit.
| Field | Type | Description |
|---|---|---|
title / id / url | string | Video title, YouTube ID, and watch URL. |
type | string | What this item is: video, short, or stream. |
viewCount / likes / commentsCount | integer | Engagement metrics for ranking what resonates. |
date / duration | string | Publish date and video length. |
text / descriptionLinks / hashtags | string / object[] / string[] | Full description, the links it contains, and its hashtags. |
subtitles | object[] | Full transcript tracks with SRT content when download_subtitles is true. The raw material for content analysis. |
thumbnailUrl | string | The video's thumbnail image. |
channelName / channelUrl / channelId | string | The publishing channel's name, URL, and ID. |
numberOfSubscribers / isChannelVerified | integer / boolean | Channel reach and verification status. |
input / fromYTUrl / order | string / integer | Provenance: which source produced this item and its position. |
A YouTube Data API alternative without the quota
The official YouTube Data API gives you 10,000 units a day, and reading comments burns through it fast. Here is how SurfSense compares.
| Feature | YouTube Data API | SurfSense |
|---|---|---|
| Quota | 10,000 units per day; comment reads drain it fast | No daily unit quota; pay per item returned |
| Comments | Paginated and quota-heavy at depth | Up to 100,000 comments and replies per video |
| Transcripts | Not available through the official API | Subtitle tracks included, in the language you pick |
| Setup | Google Cloud project, OAuth, and API key | One API key, or add the MCP server to your agent |
| Agent-ready | No; you build the harness yourself | MCP server exposes youtube.scrape as a native tool |
YouTube API: frequently asked questions
Point your agents at YouTube
The YouTube connector is one of many in the SurfSense competitive intelligence platform. Start free, no credit card required.
SurfSense