YouTube comments and replies, ready for analysis
Collect the comments and replies of YouTube videos and Shorts, the newest videos of whole channels, and playlists: text, author, likes, reply count, date, and whether the creator pinned or hearted it. No YouTube API key, no quota, no proxies to set up.
What you get
Replies in order
Ask for replies and each one comes right after the comment it answers.
Creator signals
isPinned, isHearted and isFromCreator show what the creator noticed.
Top or newest
Comments as YouTube ranks them, pinned first, or the newest first.
Channels and playlists
Read the comments of a channel's or playlist's newest videos in one run.
Dates you can sort
YouTube's text ("2 days ago") and the date it means.
Comments off is free
Videos with comments turned off are skipped at no charge.
Who it is for
Sentiment and audience research
See what viewers say about a video, a product or a brand.
AI and LLM apps
Summarize, classify and find topics in comments with your model.
Creators and marketers
Find questions, feedback and ideas; track reactions to launches.
Competitor research
Compare how audiences react across channels.
How to use it
- Open the Actor on Apify and sign in.
- Paste YouTube links: videos, Shorts, channels, @handles or playlists.
- Set comments per video, replies per comment and the order.
- Click Start and download one row per comment as JSON, CSV or Excel.
Call it from code
curl -X POST "https://api.apify.com/v2/acts/ttechx~youtube-comments-scraper/run-sync-get-dataset-items" \
-H "Authorization: Bearer YOUR_APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"links": ["https://www.youtube.com/watch?v=arj7oStGLkU"], "maxComments": 500, "maxRepliesPerComment": 5, "sortBy": "newest"}'from apify_client import ApifyClient # pip install apify-client
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("ttechx/youtube-comments-scraper").call(run_input={
"links": [
"https://www.youtube.com/watch?v=arj7oStGLkU"
],
"maxComments": 500,
"maxRepliesPerComment": 5,
"sortBy": "newest"
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item)Get your token in Apify Console > Settings > API & Integrations. In n8n, Make or Zapier, use the Apify app and pick this Actor.
Input
| Field | Type | What it does | |
|---|---|---|---|
links | array of strings | Required | Videos, Shorts, channels or playlists, one per line. |
maxComments | integer, 1-100,000 | The most comments per video, replies included. Default 100. | |
maxRepliesPerComment | integer, 0-10,000 | Replies of each comment, right after it. Default 0 (no replies). | |
sortBy | top | newest | Top comments (pinned first) or the newest first. Default top. | |
maxVideos | integer, 1-10,000 | Videos to read from each channel (newest first) or playlist. Default 10. |
{
"links": [
"https://www.youtube.com/watch?v=arj7oStGLkU"
],
"maxComments": 500,
"maxRepliesPerComment": 5,
"sortBy": "newest"
}Output
One row per comment or reply:
| Field | What it is |
|---|---|
text | The comment |
type, parentId | comment, or reply with the id of the comment it answers |
author, authorChannelId, authorThumbnail | Who wrote it |
likes, likesText | Exact likes when YouTube shows them (under 1,000), and YouTube's text (3K) |
replyCount | How many replies the comment has |
isPinned, isHearted | Pinned or hearted by the creator |
isFromCreator, isVerified | Written by the video's channel; a verified author |
publishedTimeText, publishedDate | YouTube's text and the date it means |
commentId, commentUrl | The comment and a link that opens the video at it |
videoId, videoUrl, videoTitle, videoChannelTitle | The video |
{
"commentId": "UgzRh8Bx6IGwA_5EqER4AaABAg",
"type": "comment",
"parentId": null,
"text": "Enjoying this talk? You'll love the brand new TED Radio Hour series ...",
"author": "@nprpodcasts",
"publishedTimeText": "3 years ago (edited)",
"publishedDate": "2023-11-26",
"likes": null,
"likesText": "3K",
"replyCount": 42,
"isPinned": true,
"isHearted": false,
"isFromCreator": false,
"isVerified": true,
"commentUrl": "https://www.youtube.com/watch?v=arj7oStGLkU&lc=UgzRh8Bx6IGwA_5EqER4AaABAg",
"videoId": "arj7oStGLkU",
"videoTitle": "Inside the Mind of a Master Procrastinator | Tim Urban | TED",
"videoChannelTitle": "TED"
}Use it with AI agents
Through Apify the Actor is one tool, ttechx/youtube-comments-scraper. Pick your assistant:
Run this, then type /mcp in Claude Code and sign in to Apify.
claude mcp add --transport http ttech-comments "https://mcp.apify.com/?tools=ttechx/youtube-comments-scraper"No browser sign-in? Add --header "Authorization: Bearer YOUR_APIFY_TOKEN".
- Open Settings > Connectors in claude.ai or Claude Desktop.
- Choose Add custom connector, name it, and paste this URL:
https://mcp.apify.com/?tools=ttechx/youtube-comments-scraper- Connect and sign in with your Apify account.
Add to ~/.cursor/mcp.json (or .cursor/mcp.json in a project), then sign in when Cursor asks.
{
"mcpServers": {
"ttech-comments": {
"url": "https://mcp.apify.com/?tools=ttechx/youtube-comments-scraper"
}
}
}Add to ~/.codex/config.toml and set APIFY_TOKEN in your environment.
[mcp_servers.ttech_comments]
url = "https://mcp.apify.com/?tools=ttechx/youtube-comments-scraper"
bearer_token_env_var = "APIFY_TOKEN"- In ChatGPT on the web, open Plugins, select + and Add custom MCP server (available on plans that allow custom MCP servers).
- Paste this URL and choose OAuth:
https://mcp.apify.com/?tools=ttechx/youtube-comments-scraper- Sign in with your Apify account and review the tools.
Add to .vscode/mcp.json, then start the server and sign in.
{
"servers": {
"ttech-comments": {
"type": "http",
"url": "https://mcp.apify.com/?tools=ttechx/youtube-comments-scraper"
}
}
}Brief for any LLM
Endpoints, inputs, outputs, examples and MCP setup in one Markdown text. Paste it into ChatGPT, Claude or Gemini and ask for the code you need. Also at /youtube-comments-scraper.md.
Good to know
- Up to 100,000 comments per video.
- publishedDate is approximate for older comments, since YouTube shows "3 years ago".
- Private, deleted and comments-off videos are skipped, free.
FAQ
Are replies included?
Only when you ask: set replies per comment above 0. They count towards the comments per video.
Why are likes sometimes empty?
YouTube shows exact likes only under 1,000. Above that, likesText has YouTube's rounded text.
Is there a REST endpoint instead of an Actor?
Yes: the YouTube Data API has GET /comments, 20 comments a page.