# Export comments and replies from a YouTube video

**Use case:** 

Exports the top comments of a YouTube video together with their replies. Each reply is its own row placed right after its parent, with parent comment ID, so thread structure stays intact. Every row has the text, likes, author, publish time and pinned or hearted flags. Export to CSV, Excel or JSON.

## Input

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "searchQueries": [
    "iphone 17 review",
    "best budget espresso machine"
  ],
  "maxVideosPerSource": 10,
  "channelContentTypes": [
    "videos",
    "shorts",
    "streams"
  ],
  "searchSort": "relevance",
  "maxCommentsPerVideo": 30,
  "sortBy": "top",
  "includeReplies": true,
  "maxRepliesPerThread": 5,
  "keywords": [
    "price",
    "battery"
  ],
  "skipPinnedComment": false,
  "includeErrorItems": true,
  "maxComments": 0,
  "maxConcurrency": 8,
  "maxRetries": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "residentialFallback": true
}
```

## Output

```json
{
  "commentId": {
    "label": "Comment ID",
    "format": "string"
  },
  "parentCommentId": {
    "label": "Parent",
    "format": "string"
  },
  "isReply": {
    "label": "Reply",
    "format": "boolean"
  },
  "authorName": {
    "label": "Author",
    "format": "string"
  },
  "authorIsChannelOwner": {
    "label": "By creator",
    "format": "boolean"
  },
  "text": {
    "label": "Comment",
    "format": "string"
  },
  "likeCount": {
    "label": "Likes",
    "format": "integer"
  },
  "publishedAt": {
    "label": "Date (est.)",
    "format": "string"
  },
  "isEdited": {
    "label": "Edited",
    "format": "boolean"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The YouTube Comments Scraper: Replies, Shorts, Channels Actor is ready to run with the inputs already set for "Export comments and replies from a YouTube video". [Sign up or log in](https://console.apify.com/create-task-from-example/TC8avEwrcfeYVfB0K) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Export comments and replies from a YouTube video" task

The YouTube Comments Scraper: Replies, Shorts, Channels Actor will start running based on the input automatically. You can also change all the input fields, like youtube urls or ids, search queries, and more, to match your specific use case.

### 3. Receive the "Export comments and replies from a YouTube video" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as comment id, parent, reply, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Export comments and replies from a YouTube video" task via API](https://apify.com/zhtech/youtube-comments-scraper.md).

## FAQ

### What does the YouTube video comments and replies task return?

The YouTube video comments and replies task returns one row per comment or reply with text, likes, author, publish time, reply flag and parent comment ID, so you can rebuild every thread.

### How do I get every comment of a video?

Set Max comments per video and Max replies per comment to 0 in the YouTube video comments and replies task to get all of them, and paste your own video, Shorts or live URL.

### Can I run the YouTube video comments and replies task on a schedule or through the API?

Save the YouTube video comments and replies task to your Apify account, then add it to an Apify Schedule (for example daily) or start it from the Apify API, webhooks, Zapier, Make, n8n or the Apify MCP server for AI agents.

### How much does the YouTube video comments and replies task cost?

The YouTube video comments and replies task is pay per event: a small start fee per run plus a fee per comment or reply saved. Error rows for videos with comments off are free. Prices are on the Pricing tab.

## About this Actor

This example demonstrates how to use [YouTube Comments Scraper: Replies, Shorts, Channels](https://apify.com/zhtech/youtube-comments-scraper.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/zhtech/youtube-comments-scraper.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/zhtech/youtube-comments-scraper.md

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).
