# YouTube Comments Scraper (TTech API)

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.

Page: https://ttechapi.com/youtube-comments-scraper
Apify Actor: https://apify.com/ttechx/youtube-comments-scraper (id `ttechx/youtube-comments-scraper`)

## What 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.

## Key facts

- 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.

## Apify Actor

Run it with an Apify API token. Synchronous run that returns the dataset items:

```bash
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"}'
```

Input (JSON):

- `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.

Example input:

```json
{
  "links": [
    "https://www.youtube.com/watch?v=arj7oStGLkU"
  ],
  "maxComments": 500,
  "maxRepliesPerComment": 5,
  "sortBy": "newest"
}
```

Output: One row per comment or reply:

- `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

```json
{
  "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 as an MCP server

- Apify MCP: `https://mcp.apify.com/?tools=ttechx/youtube-comments-scraper` (OAuth sign-in, or header `Authorization: Bearer YOUR_APIFY_TOKEN`).

## Limits

- 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.

## Notes for the assistant

- Never put a real key in code you show; read it from an environment variable.
- Failed items are not charged; check each item's status or error field.
- Only public YouTube data. Not affiliated with YouTube or Google.
- Support: support@ttechapi.com, Telegram @ttech_support_official.
