YouTube Comments Scraper avatar

YouTube Comments Scraper

Pricing

from $2.00 / 1,000 results

Go to Apify Store
YouTube Comments Scraper

YouTube Comments Scraper

Scrape comments from any YouTube video: text, author, likes, replies, pinned/hearted status. For social listening, sentiment analysis and audience research.

Pricing

from $2.00 / 1,000 results

Rating

0.0

(0)

Developer

Technical Dost Solutions

Technical Dost Solutions

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

18 days ago

Last modified

Security

Limited permissions

Share

Export public YouTube comments as clean, analysis-ready records. This Actor is designed for social listening, audience research, brand monitoring, sentiment analysis, creator research, and community discovery.

It uses YouTube's public watch pages and InnerTube web API. No YouTube Data API key, paid proxy, or paid third-party data source is required.

What it does

  • Scrapes top or newest comments from one or more public YouTube videos.
  • Paginates through YouTube comments up to the requested per-video limit.
  • Returns comment text, author and channel link, relative publish time, likes, replies, and pinned or creator-hearted status.
  • Supports both YouTube's current comment entity payloads and the legacy inline comment renderer.
  • Continues processing when one video fails and handles disabled comments without failing the run.

Input

{
"videoUrls": [
"https://www.youtube.com/watch?v=dQw4w9WgXcQ"
],
"maxCommentsPerVideo": 100,
"sortBy": "top"
}
FieldTypeRequiredDescription
videoUrlsarray of stringsYesPublic YouTube watch, short, live, embed, or youtu.be video URLs.
maxCommentsPerVideointegerNoComments per video, from 1 to 500. Defaults to 100.
sortBystringNotop or newest. Defaults to top.

The limit applies to top-level comments. Reply counts are included when YouTube exposes them, but replies are not emitted as separate records.

Output

Each dataset item represents one comment:

{
"videoId": "dQw4w9WgXcQ",
"videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"commentId": "UgzExampleCommentId",
"text": "Example comment text",
"author": "@ExampleAuthor",
"authorChannelUrl": "https://www.youtube.com/@ExampleAuthor",
"publishedTimeText": "2 days ago",
"likeCountText": "1.2K",
"likeCount": 1200,
"replyCount": 8,
"isPinned": false,
"isHearted": true
}

likeCount and replyCount are null when YouTube does not expose a parseable count. isHearted is false when a creator heart cannot be detected.

Cost and data source

The Actor uses only public YouTube web data and native HTTP requests. Each stored comment triggers the result pay-per-event charge when that event is configured on Apify.

How to use YouTube Comments Scraper

  1. Open YouTube Comments Scraper on Apify Store and click Try for free.
  2. Fill in the input (the form is prefilled with a working example) and click Start.
  3. Watch results appear in the Output tab, then download them as JSON, CSV, Excel or HTML, or read them through the API.
  4. Optional: save the input as a task and add a schedule to run it automatically, or connect it to your tools with integrations and webhooks.

Use YouTube Comments Scraper with AI agents (MCP)

Give Claude, ChatGPT, Cursor, VS Code or any MCP client this Actor as a tool through the hosted Apify MCP server. The agent sees the input fields with descriptions and example values, runs the Actor, and reads the results.

MCP server URL (this Actor only):

https://mcp.apify.com/?tools=technicaldost/youtube-comments-scraper

Claude Code:

$claude mcp add --transport http apify "https://mcp.apify.com/?tools=technicaldost/youtube-comments-scraper" --header "Authorization: Bearer YOUR_APIFY_TOKEN"

Cursor, VS Code, Claude Desktop and other clients (mcp.json or the client's MCP settings):

{
"mcpServers": {
"apify": {
"url": "https://mcp.apify.com/?tools=technicaldost/youtube-comments-scraper",
"headers": { "Authorization": "Bearer YOUR_APIFY_TOKEN" }
}
}
}

Clients that support sign-in (such as Claude.ai connectors) can use the URL without a token and log in to Apify instead. Get your token in Apify Console → Settings → API & Integrations, or generate a ready config for your client at mcp.apify.com. In the agent the tool is named technicaldost--youtube-comments-scraper; ask it, for example, to "run YouTube Comments Scraper with {"videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"]}".

AI agents without an Apify account can also run and pay for this Actor per request with x402 agentic payments.

Run YouTube Comments Scraper via API

Run the Actor and get its results in one call (replace YOUR_APIFY_TOKEN):

curl -X POST "https://api.apify.com/v2/acts/technicaldost~youtube-comments-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"]}'

Python (pip install apify-client):

from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("technicaldost/youtube-comments-scraper").call(run_input={"videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"]})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item)

JavaScript / TypeScript (npm install apify-client):

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('technicaldost/youtube-comments-scraper').call({"videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"]});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

Long runs: start them with POST /v2/acts/technicaldost~youtube-comments-scraper/runs and fetch the dataset when the run finishes, or receive a webhook.

Integrations

YouTube Comments Scraper works with Make, Zapier, n8n, LangChain, Google Sheets, Slack, GitHub and webhooks. Schedule runs in Apify Console and send new results straight to your apps, spreadsheets or AI pipelines.

FAQ

Can I use YouTube Comments Scraper with AI agents like Claude or ChatGPT?

Yes. Connect the Apify MCP server with ?tools=technicaldost/youtube-comments-scraper (see above) and the agent can run the Actor and read its results on its own.

Can I call YouTube Comments Scraper from my own code?

Yes. Use the REST API, or the official Python and JavaScript clients shown above. Results are available as JSON, CSV, Excel, XML or HTML.

How do I run it on a schedule?

Save your input as a task in Apify Console and add a schedule (for example, daily). Use webhooks or integrations to send each run's results onward.

It works with publicly available data. Make sure your use complies with the source website's terms and with data protection laws such as GDPR, especially for personal data.

Something doesn't work or I need a feature. What should I do?

Open an issue in the Issues tab on this Actor's page with an example input, and we'll look into it.