What is YouTube Comments API?
YouTube Comments API reads the comment section of a YouTube video and returns it as data. Give it a video link, say how many comments you want, and you get each one with its text, the commenter's handle, the post date, the like count and the number of replies it drew, plus the video's total comment count.
It reads public comments only, so you do not need to own the channel or sign in with Google. That makes it useful for your own videos and for anyone else's.
You ask
Get the top 20 comments on Sir Ken Robinson's TED talk ‘Do schools kill creativity?’ with likes and replies.
It runs
From your AI assistant over MCP or from your code over REST
You get
- Comment
- Engagement
- Commenter
- Video
- Find the questions viewers askCollect questions under a tutorial and answer them in the next video or the help center.
- Hear product feedbackRead what viewers say about your product under reviews, unboxings and comparisons by other creators.
- Measure reaction to a launchPull the newest comments after a trailer or announcement and see which themes come up most.
- Check a creator's audienceSee whether comments are real conversation or copy-paste before you pay for a sponsorship.
- Let your agent do the sortingClaude or ChatGPT reads the comments, groups them and pulls out quotes in the same chat.
What the YouTube comments API returns
Each comment is one record, and the video's details come with the batch. These are the fields our test run returned.
Comment
- Comment text
- Position in YouTube's order
- Post date as YouTube shows it
- Estimated post date
- Edited marker
Engagement
- Like count
- Reply count
Commenter
- Display handle
- Link to the commenter's channel
- Avatar image
Video
- Video ID and link
- Video title
- Total comment count
A video with comments turned off returns nothing. For what the speaker said use YouTube Transcript API, and for views, likes and channel stats use YouTube Scraper API.
Sample comments from a real request
The table at the top of this page is a real run from 16 November 2026: the first page of comments on “Do schools kill creativity?” by Sir Ken Robinson on TED's YouTube channel. The video reports 13,052 comments and the request returned the top 20. Commenter handles are masked on this page.
One result in full
One comment in full
- Position
- 2 of 20
- Commenter
- @sa••• (channel link and avatar returned, hidden here)
- Comment
- It's incredibly upsetting how old is this and how everything is still the same.
- Posted, as shown
- 7 years ago
- Estimated date
- November 2019
- Likes
- 5,200
- Replies
- 55
What this sample tells you
Comments arrive in YouTube's top-comment order, not sorted by likes. The first comment has 54 likes, while the most liked one, with 9,700, comes twentieth.
14of 20
14 of 20 are six or more years old and 6 were posted in the last two years. On an older video, top comments lean old, so ask for newest first when you track current reactions.
16of 20
16 of 20 comments drew replies, 615 in total. The record carries the reply count, which tells you where the discussion is, but not the reply text.
4of 20
Grouped by theme, 4 of 20 say schools have not changed since the talk and 2 quote the same line from it. That is the kind of grouping your assistant can do in the same chat.
How to export YouTube comments with your AI assistant
Connect AI/ML API
Click Try it now, pick your client and add the MCP server. You sign in with your AI/ML API account once.
Paste the video
Give the video link and how many comments you want, top or newest first.
Get the comments
Your assistant returns each comment with its likes, reply count and date.
Ask your real question
Have it group the questions, count the complaints or draft answers that you post yourself.
Prompts to start with
Use the AI/ML API MCP YouTube Comments API tool. Get the top 20 comments on https://www.youtube.com/watch?v=iG9CE55wbtY and group them by what viewers are saying.
Use the AI/ML API MCP YouTube Comments API tool. Pull the newest 100 comments on [your video URL] and list every question viewers ask, with the like count of each.
Use the AI/ML API MCP YouTube Comments API tool. Collect 50 comments from each of these three review videos and compare what people say about battery life: [URLs]
Use the AI/ML API MCP YouTube Comments API tool. Find comments on [video URL] that report a bug or a broken link and put them in a table with the date.
Settings for a comment pull
In a chat you only paste the link and say what you need. In code you pass these settings yourself.
| Setting | What it controls | Tip |
|---|---|---|
| Video | A video link or its ID | Comments must be open on the video |
| Number of comments | How many comments to collect | Start with 20 to read the tone, then raise it |
| Sort order | Top comments or newest first | Newest for launch-week feedback, top for the lasting view |
| Posted after | Only comments from a date, or the last few days | Use it to watch reactions after an update |
| Region and language | Country and interface language for the request | Keep the default unless you study one market |
On a big video, top comments and newest comments tell different stories. The top list on our test video was mostly years old; the newest list shows what people think this week. Pull both when the difference matters.
Ways teams use YouTube comment data
Follow-up content
Collect the questions under a tutorial and turn the most liked ones into the next video or an FAQ page.
TextLikes
Product feedback
Read comment sections under reviews of your product and log complaints and feature requests by theme.
TextDateLikes
Launch reaction tracking
Pull the newest comments after a trailer or announcement every day for a week and watch the themes shift.
TextDate
Creator due diligence
Check reply threads, repeated phrases and like spread before a sponsorship to see whether the audience engages.
TextLikesReplies
Moderation shortlist
Find comments that report broken links, spam or abuse, then act on them in YouTube Studio.
TextPositionDate
Research datasets
Build a dataset of public reactions to a talk, a trailer or a policy video for text analysis.
TextLikesEstimated date
YouTube comments API for your code
In your code
REST · your AI/ML API key, JSON records back
The same tool runs over REST with your AI/ML API key. Send a video ID and a comment count and get JSON with one object per comment: text, commenter handle and channel link, the date as YouTube shows it, an estimated date, likes and replies, plus the video's total comment count.
Use MCP when someone reads and sorts comments in a chat, and REST when your backend checks new comments on your videos every morning. Both use one AI/ML API account and one balance, with no Google Cloud project, OAuth screen or quota to manage. Start with the Toolbox REST quickstart.
YouTube Comments API vs the YouTube Data API and other options
Most developers first look at the official YouTube Data API, which has endpoints for comment threads and replies. It is the right tool when you own the channel: with the owner's sign-in it can also post replies and moderate. It needs a Google Cloud project, an API key or OAuth, and every call counts against a daily quota.
YouTube Comments API on AI/ML API reads public comments on any video without that setup and works inside an AI chat. It does not post or moderate.
| Read and copy by hand | YouTube Data API comment threads | Your own scraper | ||
|---|---|---|---|---|
| Setup | Connect once with your AI/ML API account | None | Google Cloud project, API key or OAuth, daily quota, your own code | Browser automation and parsing to maintain |
| Inside an AI chat | Yes. Over MCP | No. No | Only if you build it | Only if you build it |
| Best for | Reading and analysing public comments on any video | A handful of comments | Channel owners who also reply and moderate | Teams with engineers to keep it running |
Pricing
Pay as you goBilled per run from your AI/ML API balance
- No subscription
- No seat fee
- One balance for every tool
Each request is billed per run from your AI/ML API balance, with no subscription or seat fee. Our 20-comment test cost less than one cent. Pulling hundreds of comments takes more pages and costs more, so check the current price in your dashboard before a large batch.
FAQ
Is it legal to scrape YouTube comments?
Reading public comments for research and feedback is common. Comments come from private people, so privacy laws such as GDPR apply when you store or publish them; mask or aggregate names in anything you share. YouTube's terms apply to the service. Ask a lawyer about your specific case.
How many comments can I get from one video?
Ask for the number you need. Our test returned the first 20 of 13,052 comments. Larger pulls take more pages and cost more, so start with a few hundred top or newest comments and widen if the answer is unclear.
Does it return replies to comments?
Each comment comes with its reply count, so you can see which ones started a discussion. Our test returned top-level comments only, without the text of the replies.
How is this different from the YouTube Data API comments endpoint?
The official API is Google's product: it needs a Google Cloud project and an API key or OAuth, and it uses a daily quota. With the owner's sign-in it can also reply and moderate. YouTube Comments API reads public comments with only your AI/ML API account and works inside AI assistants over MCP.
Can I reply to or delete comments with it?
No. It only reads. Replying, hiding and deleting need the channel owner's access in YouTube Studio or through the official API.
Why does a video return no comments?
The channel may have turned comments off, or the video has none yet. In our tests, two recent NASA videos returned no comments at all, while a TED talk returned a full page.
How accurate are the comment dates?
YouTube shows dates as “7 years ago” or “3 weeks ago”. The result keeps that text and adds a date estimated from it, which is right to the year or week, not the exact day.
Can I use it from Claude, ChatGPT or Cursor?
Yes. Add the AI/ML API MCP server once and ask in plain English. Hermes, OpenClaw and other MCP clients work the same way.
Can I export comments to CSV or Google Sheets?
Ask your assistant to return the comments as a CSV, or write the JSON from the REST response to a file or a sheet in your code.
Read your first comment section
Connect once, paste a video link and ask what viewers are saying.