YouTube Comments API
YouTube comments API — fetch top-level comments and replies with author info, likes, and timestamps. Sentiment analysis and engagement research from $0.01/call.
Get comments for any YouTube video including author info, like counts, reply counts, and pagination. Sort by top comments or newest first.
Try it live
Fill in the fields and hit Run to see a real response.
{
"ok": true,
"data": {
"commentsCount": "2430953",
"data": [
{
"authorText": "@YouTube",
"textDisplay": "can confirm: he never gave us up",
"likesCount": "213K",
"replyCount": "960",
"publishedTimeText": "11 months ago"
}
]
}
}Features
Each comment in the response carries authorText (e.g. @YouTube), textDisplay, and publishedTimeText, so you get who said what and when for any video ID.
Every comment includes likesCount and replyCount (e.g. 213K likes, 960 replies), letting you rank by engagement or surface the most-discussed threads.
Pass sort=top for YouTube's most-liked comments or sort=new for a chronological feed — the same toggle YouTube itself offers.
Walk past the first batch with the continuation token to collect thousands of comments from high-traffic videos for full-corpus analysis.
The response includes commentsCount (e.g. 2,430,953) so you know the full volume of discussion before deciding how deep to paginate.
Use cases
Sentiment Analysis
Analyze viewer sentiment and feedback by processing comments on your videos or competitors' content.
Community Engagement
Monitor comments across multiple videos to identify questions, complaints, and opportunities.
Content Ideas
Mine comments for frequently asked questions and topic suggestions for future content.
Moderation Tools
Build automated comment monitoring and flagging systems for your YouTube channels.
Research & Analysis
Collect and analyze public discourse around specific videos or topics for academic or market research.
Quick start
Copy this snippet and start making calls.
const res = await fetch('https://api.yepapi.com/v1/youtube/comments', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"id": "dQw4w9WgXcQ",
"sort": "top"
}),
});
const data = await res.json();
console.log(data);The YouTube Comments API for engagement and sentiment data
The YepAPI YouTube Comments API pulls the public comment thread for any video ID. Send id and sort to /v1/youtube/comments and get back commentsCount plus an array where each entry has authorText, textDisplay, likesCount, replyCount, and publishedTimeText. It's purpose-built for sentiment analysis, community research, and feeding viewer feedback into your own tools.
At $0.01 per call you can paginate through entire comment sections — even videos with millions of comments — without touching the official Data API's quota system. Sort by top to grab the highest-signal comments first, or by newest to monitor a video's live discussion.
What is a YouTube Comments API?
A YouTube Comments API returns the public comment thread of a video as structured JSON instead of scraped HTML. For a given video ID you get a total commentsCount and an array of comments, each with the author handle (authorText), the comment text (textDisplay), how many likes and replies it has (likesCount, replyCount), and when it was posted (publishedTimeText). A sort parameter lets you choose YouTube's top-rated ordering or strict newest-first. It's the data source for anyone running sentiment analysis, moderation tooling, or audience research on YouTube discussions.
Build your own comment sentiment tool
Paginate the full thread for a video, run each textDisplay through a sentiment model, and weight the scores by likesCount to find the opinions the audience actually endorses. Mine top comments across a competitor's catalog for recurring questions and complaints — instant content ideas. Or build a moderation watcher that pulls sort=new on your own videos every few minutes and flags comments matching your rules. Pair it with the Video Details endpoint to correlate comment sentiment against view and like counts.
YouTube Comments API pricing — $0.01/call
Each page of comments costs $0.01, and each call returns the comment batch plus a continuation token for the next page. There is no daily quota: the official Data API meters comment reads against your 10,000 units, but here you pay per call and paginate as deep as you need. A 2-million-comment video is simply a question of how many $0.01 pages you choose to pull.
Video comments vs. community post comments
This endpoint reads comments on videos. YouTube creators also post to their community tab, and those threads have their own discussion — for that, use the Post Comments endpoint, which takes a post ID instead of a video ID but returns the same author/text/like shape. Running both lets a single tool cover a creator's entire public conversation surface, video and community alike, on one API key.
Try the YouTube Comments API free
Sign up for $5 in free credit, no card required — that's 500 comment pages to test top vs. newest sorting and pagination on any video before you build your analysis pipeline.
Start making API calls in 30 seconds
$5 free credit on signup. No credit card required. Pay per call.
What developers say
“Switched from SerpAPI and cut our SERP costs by 80%. Same data quality, way simpler billing.”
“One API key for AI models, SERP data, and web scraping. Saved us from managing 4 separate providers.”
“The $5 free credit let us prototype our entire rank tracking feature before committing. No other API does that.”
Frequently asked questions
Get comments for any YouTube video including author info, like counts, reply counts, and pagination. Sort by top comments or newest first.
Each API call costs $0.01. No monthly minimums or subscriptions — you only pay for what you use.
Sign up for a free API key, then send a POST request to /v1/youtube/comments. Check the code example above for a ready-to-use snippet in JavaScript, cURL, or Python.
YepAPI bundles SEO, AI, and web scraping APIs under one key with no monthly minimums. You get lower per-call pricing, a unified dashboard, and one billing account instead of managing multiple providers.
Ready to integrate?
Get your API key and start making calls in 30 seconds. $5 free credit on signup — no credit card required.
More youtube api endpoints
Search
$0.01YouTube search API — find videos, channels, and playlists with filters for date, duration, and type. Structured JSON results from $0.01/call.
Video Details
$0.02Full YouTube video metadata — title, views, likes, description, keywords, thumbnails, and available formats. Video intelligence from $0.02/call.
Related Videos
$0.01YouTube related videos API — discover recommended videos for any video ID. Content suggestion and competitor video research from $0.01/call.