---
title: "How to scrape YouTube comments (with replies) in 2026"
description: "Download every comment and reply of a YouTube video as JSON with one API call per page. Python, JavaScript and curl code, costs and pitfalls."
url: https://scrapecrate.com/blog/how-to-scrape-youtube-comments
markdown: https://scrapecrate.com/blog/how-to-scrape-youtube-comments.md
---

# How to scrape YouTube comments, replies included

Download every comment and reply of a YouTube video as JSON with one API call per page. Python, JavaScript and curl code, costs and pitfalls.

Published November 22, 2026 · 6 min read

YouTube comments are one of the most honest data sets on the internet. People tell creators what they liked, what confused them and what they want next, in their own words, thousands of times per video. Product teams mine them for feature requests, marketers for the language their audience uses, researchers for sentiment around a topic, and AI teams for training and evaluation data.

The official way to read them is the YouTube Data API: a Google Cloud project, an API key, a quota of 10,000 units per day and a `commentThreads.list` call that returns at most 100 threads at a time. It works, but the quota runs out quickly on a real project, and you still have to stitch threads, replies and pagination together yourself.

This guide shows a simpler route: one HTTP call per page that returns clean JSON, replies included, with no Google project. We will cover the request, the response fields, pagination, replies, cost, and the mistakes that make comment scrapers break.

## What you get for each comment

The [YouTube API](https://scrapecrate.com/youtube-api.md) of ScrapeCrate exposes comments at one endpoint:

```text
GET https://api.scrapecrate.com/v1/youtube/videos/{video_id}/comments
```

Every item of `data` is a top-level comment with these fields:

| Field | What it is |
| --- | --- |
| `comment_id` | YouTube's ID of the comment |
| `text` | The comment as written, emoji and line breaks kept |
| `author` | The commenter's handle, for example `@musicfan` |
| `like_count` | Likes on the comment |
| `reply_count` | How many replies it has |
| `published_at` | When it was posted (ISO 8601, UTC) |
| `is_pinned` | True for the comment the creator pinned |

With `include_replies=true` each comment also gets a `replies` list whose items have `comment_id`, `parent_id`, `text`, `author`, `like_count` and `published_at`. The response also carries `pagination` (`next_cursor`, `has_more`) and `meta` (`credits_used`, `credits_remaining`, `request_id`), like every endpoint.

## Your first request

Create a free account, copy your API key from the dashboard and pass it in the `X-API-Key` header. The video ID is the 11 characters after `v=` in the video URL (`dQw4w9WgXcQ` in `https://www.youtube.com/watch?v=dQw4w9WgXcQ`).

```bash
curl "https://api.scrapecrate.com/v1/youtube/videos/dQw4w9WgXcQ/comments?sort=new&limit=100" \
  -H "X-API-Key: YOUR_API_KEY"
```

```python
# pip install scrapecrate
from scrapecrate import ScrapeCrate

client = ScrapeCrate(api_key="YOUR_API_KEY")
page = client.youtube.video_comments(video_id="dQw4w9WgXcQ", sort="new", limit=100)
for comment in page.data:
    print(comment["like_count"], comment["author"], comment["text"][:80])
print(page.credits_used, page.has_more)
```

```javascript
// npm install scrapecrate
import { ScrapeCrate } from 'scrapecrate';

const client = new ScrapeCrate({ apiKey: 'YOUR_API_KEY' });
const page = await client.youtube.videoComments({ video_id: 'dQw4w9WgXcQ', sort: 'new', limit: 100 });
for (const comment of page.data) console.log(comment.like_count, comment.author, comment.text);
console.log(page.creditsUsed, page.hasMore);
```

`sort` is `top` (the default, YouTube's "Top comments") or `new` (newest first). `limit` goes from 1 to 500 and defaults to 50.

Which order should you pick? `top` is what a visitor sees first and is the right choice for "what do people think of this video". `new` is the right choice for monitoring: run it every day and stop as soon as you reach a comment you already stored.

## Reading every comment: pagination

A popular video has tens of thousands of comments, more than one call returns. When there is more, the response says `"has_more": true` and gives a `next_cursor`. Pass it back as the `cursor` parameter, with the same other parameters, and repeat until `has_more` is false. Every page is a separate call.

The SDKs do the loop for you:

```python
import csv

from scrapecrate import ScrapeCrate

client = ScrapeCrate(api_key="YOUR_API_KEY")

with open("comments.csv", "w", newline="", encoding="utf-8") as f:
    writer = csv.writer(f)
    writer.writerow(["comment_id", "published_at", "author", "like_count", "reply_count", "text"])
    for c in client.youtube.iterate("video_comments", video_id="dQw4w9WgXcQ", sort="new", limit=500):
        writer.writerow([c["comment_id"], c["published_at"], c["author"], c["like_count"], c["reply_count"], c["text"]])
```

```javascript
import { ScrapeCrate } from 'scrapecrate';

const client = new ScrapeCrate({ apiKey: process.env.SCRAPECRATE_API_KEY });
const rows = [];
for await (const c of client.youtube.iterate('videoComments', { video_id: 'dQw4w9WgXcQ', sort: 'new', limit: 500 })) {
  rows.push({ id: c.comment_id, at: c.published_at, likes: c.like_count, text: c.text });
}
console.log(`${rows.length} comments`);
```

Cursors are short-lived. If you pause a long export for too long you get a `410 cursor_expired` error: start again from the first page (with `sort=new`, skip what you already have).

## Getting the replies too

Replies often hold the real discussion: the creator answering a question, people correcting each other, the follow-up that explains a complaint. Ask for them with `include_replies=true`, and cap how many you want per comment with `replies_per_comment` (1 to 100, default 10):

```bash
curl "https://api.scrapecrate.com/v1/youtube/videos/dQw4w9WgXcQ/comments?limit=100&include_replies=true&replies_per_comment=20" \
  -H "X-API-Key: YOUR_API_KEY"
```

```python
page = client.youtube.video_comments(
    video_id="dQw4w9WgXcQ", limit=100, include_replies=True, replies_per_comment=20
)
for comment in page.data:
    print(comment["text"][:60])
    for reply in comment.get("replies", []):
        print("   ->", reply["author"], reply["text"][:60])
```

```javascript
const page = await client.youtube.videoComments({
  video_id: 'dQw4w9WgXcQ', limit: 100, include_replies: true, replies_per_comment: 20,
});
for (const comment of page.data) {
  console.log(comment.text);
  for (const reply of comment.replies ?? []) console.log('   ->', reply.author, reply.text);
}
```

Compare `reply_count` with the length of `replies` to know whether a thread was cut by your `replies_per_comment` cap.

## What it costs

Comments are priced by volume, not per request: **1 credit per 100 comments returned, replies included**, with a minimum of 1 credit per call. A page of 500 comments costs 5 credits; 10,000 comments cost 100 credits, about $0.10 at the list price of $0.001 per credit. The free monthly allowance of 100 credits is enough to download 10,000 comments every month without paying anything.

Two details worth knowing:

- With replies on, a call reserves `limit x (1 + replies_per_comment)` items from your balance before it runs, then charges only what came back. Keep `limit` and `replies_per_comment` realistic when your balance is low, or the call answers `402 insufficient_credits` even though the real cost would have been small.
- Failed calls are never billed: a video that does not exist answers 404 and costs nothing.

The full price list of every API is on the [pricing page](https://scrapecrate.com/pricing.md).

## Turning comments into insight

A CSV of comments is a starting point, not an answer. A few patterns that work well:

1. **Questions as content ideas.** Keep the comments that contain a question mark and sort them by `like_count`: the most liked questions are what your audience wants explained next.
2. **Sentiment over time.** Export with `sort=new`, bucket `published_at` by day and run a sentiment model on each bucket. A drop right after an upload or a sponsor segment is easy to spot.
3. **Topic clusters for an LLM.** Send the top 500 comments to a language model with "group these comments into themes and quote two examples per theme". It is a fast way to summarise a video's reception, and the comment IDs let you go back to the source. Our guide on [web scraping for LLM and RAG pipelines](https://scrapecrate.com/blog/web-scraping-for-llm-rag.md) shows how to combine comments with the video transcript.
4. **Compare channels.** List a competitor's latest uploads with the channel videos endpoint, then pull the top comments of each one: you will see which formats get the most engaged audience, not only the most views.

## Common mistakes

- **Scraping the HTML page yourself.** YouTube loads comments with internal API calls after the page renders, changes their format often and rate-limits datacenter IPs. A homemade scraper works for a week, then returns nothing. If you build one anyway, monitor the number of comments per run: zero is a bug, not a quiet video.
- **Forgetting that comment counts move.** `comment_count` of the video metadata endpoint includes replies and comments YouTube holds for review, so your total will rarely match it exactly.
- **Treating authors as anonymous.** Handles are personal data. Store them only if you need them, hash them if you only need to count unique commenters, and never publish them next to the text.
- **Ignoring `is_pinned`.** The pinned comment is written or chosen by the creator; exclude it from audience sentiment.

## Beyond YouTube

The same account and the same credits work for the other sources people talk on: [TikTok comments and transcripts](https://scrapecrate.com/blog/tiktok-transcript-api.md), [Reddit threads](https://scrapecrate.com/blog/how-to-scrape-reddit) and reviews from Trustpilot, the app stores and Google Maps. If you are collecting opinions about a product, the reviews usually say what the comments only hint at.

Ready to try it? [Create a free account](https://scrapecrate.com/auth/sign-up), copy your key and run the first request above, or read the full parameter list in the [YouTube API reference](https://scrapecrate.com/docs/api/youtube.md).

## Frequently asked questions

**Do I need a YouTube Data API key to scrape comments?**

No. The comments come from the public video page, so there is no Google Cloud project, OAuth consent screen or daily quota of 10,000 units to manage. You only need a ScrapeCrate API key, and the first 100 credits of every month are free.

**How many comments can I get from one video?**

All the top-level comments YouTube shows publicly. One call returns up to 500 of them; follow pagination.next_cursor until has_more is false to read the rest. Videos with comments turned off return an empty list.

**Can I get the replies to each comment?**

Yes. Add include_replies=true and every comment carries a replies list, up to replies_per_comment (default 10, max 100). Replies are billed like comments.

**How much does it cost to download 10,000 comments?**

Comments are billed by volume, 1 credit per 100 comments returned (replies included), so 10,000 comments cost 100 credits, about 10 cents at the list price. Failed calls are never billed.

**Is it legal to scrape YouTube comments?**

Comments are public, but they are personal data in many jurisdictions. Collect only what you need, aggregate when you can, do not republish usernames next to the text, and read our guide on the legal side of scraping before you build a product on it.

## Try it with free credits every month

One API key for every source in this guide. No card needed, and only successful calls are billed.

[Create a free account](https://scrapecrate.com/auth/sign-up) [Read the docs](https://scrapecrate.com/docs.md)

## Related guides

- [Web scraping for LLMs, from web pages to a RAG index Turn web pages into clean Markdown and YouTube videos into timestamped chunks, then embed them for retrieval. A full RAG ingestion pipeline in Python.](https://scrapecrate.com/blog/web-scraping-for-llm-rag.md)
- [TikTok transcript API, captions and comments in one call Get the transcript of any public TikTok video as text, JSON segments, SRT or VTT, plus its stats and comments. Code in curl, Python and JavaScript.](https://scrapecrate.com/blog/tiktok-transcript-api.md)

[← All guides](https://scrapecrate.com/blog.md)
