# Collect YouTube comments for sentiment analysis

**Use case:** 

Build a text dataset for sentiment research or topic analysis. Collect newest comments and reply relationships with local language labels, likes and source URLs. Apply your own sentiment model after export; the task does not calculate sentiment scores.

## Input

```json
{
  "startUrls": [
    "https://www.youtube.com/watch?v=aircAruvnKk"
  ],
  "searchQueries": [],
  "maxVideosPerChannel": 10,
  "maxVideosPerSearch": 10,
  "maxCommentsPerVideo": 100,
  "sortBy": "newest",
  "includeReplies": true,
  "maxRepliesPerComment": 10,
  "detectLanguage": true,
  "keywords": [],
  "minLikes": 0,
  "creatorInteractionOnly": false,
  "monitorMode": false,
  "monitorStoreName": "youtube-comments-scraper-monitor",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

## Output

```json
{
  "type": {
    "label": "Record type",
    "format": "string"
  },
  "videoTitle": {
    "label": "Video title",
    "format": "string"
  },
  "authorHandle": {
    "label": "Author handle",
    "format": "string"
  },
  "text": {
    "label": "Comment text",
    "format": "string"
  },
  "likeCount": {
    "label": "Likes",
    "format": "number"
  },
  "replyCount": {
    "label": "Reported replies",
    "format": "number"
  },
  "publishedAt": {
    "label": "Published at (UTC)",
    "format": "string"
  },
  "isPinned": {
    "label": "Pinned by creator",
    "format": "boolean"
  },
  "isHeartedByCreator": {
    "label": "Creator heart",
    "format": "boolean"
  },
  "isReply": {
    "label": "Reply",
    "format": "boolean"
  },
  "language": {
    "label": "Language",
    "format": "string"
  },
  "isNew": {
    "label": "Unseen in monitor",
    "format": "boolean"
  },
  "error": {
    "label": "Diagnostic message",
    "format": "string"
  },
  "commentUrl": {
    "label": "Comment URL",
    "format": "string"
  }
}
```

## How it works

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

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

### 2. Start the "Collect YouTube comments for sentiment analysis" task

The YouTube Comments Scraper — Replies, Shorts & Creator Hearts Actor will start running based on the input automatically. You can also change all the input fields, like videos, shorts or channels, video search queries, and more, to match your specific use case.

### 3. Receive the "Collect YouTube comments for sentiment analysis" 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 record type, video title, author handle, 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 "Collect YouTube comments for sentiment analysis" task via API](https://apify.com/valev-lab/youtube-comments-scraper.md).

## FAQ

### Does this task score sentiment?

No. It collects public text and metadata for your own sentiment or NLP pipeline. It does not return positive, negative or neutral scores.

### Can I identify languages?

Yes. Local language detection adds ISO 639-3 labels such as eng and bul. Short or ambiguous text can be und, and related languages can be confused.

## About this Actor

This example demonstrates how to use [YouTube Comments Scraper — Replies, Shorts & Creator Hearts](https://apify.com/valev-lab/youtube-comments-scraper.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/valev-lab/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/valev-lab/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`).
