YouTube Comments Scraper API
Pricing
from $0.99 / 1,000 results
YouTube Comments Scraper API
Scrape YouTube comments at scale. Get comment text, replies, author details, timestamps & engagement metrics from any video. Perfect for sentiment analysis, brand monitoring, content research, engagement tracking & AI training. Structured, export-ready data.
Pricing
from $0.99 / 1,000 results
Rating
5.0
(2)
Developer
Shahid Irfan
Maintained by CommunityActor stats
1
Bookmarked
6
Total users
4
Monthly active users
8 days ago
Last modified
Categories
Share
What does YouTube Comments Scraper do?
YouTube Comments Scraper collects public comments and replies from one or more YouTube videos and saves each item as a structured dataset record. Add direct video URLs or video IDs, choose Top comments or Newest first, and receive comment text, author information, engagement values, reply relationships, and video metadata for analysis.
The Actor is useful for audience research, sentiment analysis, creator monitoring, content planning, competitor research, and building datasets for reporting or AI workflows. It works with regular videos, Shorts, embeds, and live video URLs when public comments are available.
Why use YouTube Comments Scraper?
- Collect comments and replies together - Keep threaded conversations connected with
cid,type, andreplyToCid. - Control the run size - Set one run-wide limit for comments and replies so large videos do not create unexpected datasets.
- Choose the conversation view - Use Top comments for high-engagement feedback or Newest first for recent reactions.
- Capture useful context - Include video title, video ID, comment counts, author channels, likes, reply counts, pinned status, and creator hearts when publicly available.
- Process multiple videos - Submit several video URLs in one run and receive one consistent dataset.
- Simple configuration - Start with public video URLs and the collection settings that match your workflow.
- Automate your workflow - Schedule recurring runs, connect webhooks, use the Apify API, or export the dataset for analysis.
What data can you extract from YouTube?
| Field | Description |
|---|---|
videoId | ID of the YouTube video that contains the comment. |
title | Video title when publicly available. |
comment | Full text of the comment or reply. |
cid | Unique YouTube comment ID. |
author | Public display name of the comment author. |
authorId | Author's YouTube channel ID when available. |
voteCount | Public like count for the comment. |
replyCount | Number of replies shown for the parent comment. |
type | comment for a top-level comment or reply for a reply. |
replyToCid | Parent comment ID for a reply, or null for a top-level comment. |
publishedAt | Normalized publication time when it can be determined. |
isPinned | Whether YouTube marks the comment as pinned. |
hasCreatorHeart | Whether the creator heart signal is present. |
How to use YouTube Comments Scraper
- Open the Actor in Apify Console.
- Add one or more public YouTube video URLs in
startUrls. A video ID can also be entered as a string. - Set
maxCommentsand choose the sorting order. - Optionally set
oldestCommentDatewhen you need a date boundary. - Run the Actor and open the default dataset.
- Download the results or connect the run to an integration.
The result limit applies across the complete run, including replies and all submitted videos. This makes the maximum dataset size predictable when processing a video list.
Input Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
startUrls | Array | Yes | [] | One or more public YouTube video URLs, Shorts URLs, embed URLs, live URLs, or video IDs. Entries may be strings or request objects with a url property. |
maxComments | Integer | No | 20 | Maximum number of comments and replies to save across the entire run. Minimum value is 1. |
commentsSortBy | String | No | "1" | YouTube comment order. Use "1" for Top comments or "0" for Newest first. |
oldestCommentDate | String | No | "" | Optional absolute date or relative age such as 2026-08-01 or 7 days. Older comments are not saved, and the Actor uses Newest first for this filter. |
For compatibility with older configurations, the runtime also accepts resultsWanted, results_wanted, maxResults, maxItems, and maxReviews as alternate result-limit names when maxComments is not provided.
Output Data
Each dataset item represents one top-level comment or reply. Values that are not publicly available are returned as null.
| Field | Type | Description |
|---|---|---|
url | String | Normalized source video URL. |
pageUrl | String | YouTube video URL associated with the record. |
videoId | String | YouTube video ID. |
title | String or null | Video title when available. |
comment | String | Comment or reply text. |
cid | String | Unique comment identifier. |
author | String or null | Author display name. |
authorId | String or null | Author channel ID. |
authorUrl | String or null | Public author channel URL. |
authorThumbnail | String or null | Public author thumbnail URL. |
publishedTimeText | String or null | Relative time text shown by YouTube. |
publishedAt | String or null | Estimated ISO timestamp when it can be normalized. |
voteCount | Number or null | Public like count. |
replyCount | Number or null | Reply count associated with the parent comment. |
commentsCount | Number or null | Total video comment count when available. |
authorIsChannelOwner | Boolean | Whether the author is the video owner. |
hasCreatorHeart | Boolean | Whether the creator heart signal is present. |
isPinned | Boolean | Whether the comment is pinned. |
type | String | comment or reply. |
replyToCid | String or null | Parent comment ID for replies. |
scrapedAt | String | ISO timestamp when the record was saved. |
Usage Examples
Basic top comments
Collect the first 100 top comments and replies from one public video:
{"startUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],"maxComments": 100,"commentsSortBy": "1"}
Newest comments for monitoring
Collect recent audience reactions by requesting Newest first:
{"startUrls": [{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"}],"maxComments": 500,"commentsSortBy": "0"}
Multiple videos with a date boundary
Collect up to 250 items across several videos and stop when comments are older than the selected date:
{"startUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ","https://www.youtube.com/shorts/aqz-KE-bpKQ"],"maxComments": 250,"oldestCommentDate": "30 days"}
Sample Output
The following example shows the shape of one top-level comment record. Actual author, engagement, and timestamp values depend on what YouTube publishes for each video.
{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ","pageUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ","videoId": "dQw4w9WgXcQ","title": "Rick Astley - Never Gonna Give You Up","comment": "This song still makes people smile.","cid": "UgxExampleCommentId","author": "Example Viewer","authorId": "UCExampleAuthorId","authorUrl": "https://www.youtube.com/channel/UCExampleAuthorId","authorThumbnail": "https://yt3.ggpht.com/example","publishedTimeText": "2 days ago","publishedAt": "2026-08-25T00:00:00.000Z","voteCount": 1420,"replyCount": 5,"commentsCount": 842910,"authorIsChannelOwner": false,"hasCreatorHeart": true,"isPinned": false,"type": "comment","replyToCid": null,"scrapedAt": "2026-08-27T12:00:00.000Z"}
Tips for Best Results
- Start small - Test one public video with
maxCommentsset to20or100before requesting a larger dataset. - Use the right order - Choose Top comments for representative engagement and Newest first for feedback monitoring.
- Remember the run-wide limit - A reply counts as one saved item, so a run with
maxComments: 100can contain any mix of comments and replies up to 100 records. - Use a date boundary for monitoring -
oldestCommentDateaccepts an absolute date or values such as7 days,30 days, or2 months. - Use public URLs - Private, deleted, members-only, age-restricted, or login-only videos may return no comments.
- Submit focused URL lists - The Actor processes multiple videos with bounded concurrency, logs failed videos, and continues with the remaining inputs.
- Expect source limitations - YouTube may not publish author thumbnails, exact dates, counts, or creator signals for every item.
Integrations and Export Formats
- Apify API - Read datasets and run the Actor programmatically from your own application.
- Google Sheets - Send comment datasets to a spreadsheet for review and tagging.
- Webhooks - Trigger downstream processing when a run finishes.
- Make or Zapier - Connect comment collection to no-code workflows.
- JSON - Use structured records in data pipelines and AI applications.
- CSV and Excel - Analyze comments in spreadsheet tools.
- XML - Pass results to systems that require XML exports.
Frequently Asked Questions
Can I collect replies as well as top-level comments?
Yes. The Actor collects available reply threads and links each reply to its parent with replyToCid. Replies count toward maxComments.
Can I collect comments from multiple videos?
Yes. Add multiple public video URLs or IDs to startUrls. The Actor processes them with bounded concurrency and applies one result limit across the complete run.
What does commentsSortBy mean?
Use "1" for YouTube Top comments and "0" for Newest first. If oldestCommentDate is set, Newest first is selected automatically so the date boundary can be applied while pages are collected.
Do I need a YouTube API key?
No. The Actor is designed for publicly available comments and does not require users to provide a YouTube API key or sign in.
Why are some fields null or missing?
YouTube does not publish every field for every comment. Author details, exact dates, counts, thumbnails, and creator signals may be unavailable, and the Actor preserves those unavailable values as null.
Can I run this Actor on a schedule?
Yes. Create an Apify schedule to collect new feedback hourly, daily, weekly, or at another interval that suits your monitoring workflow.
Is collecting YouTube comments legal?
Public data collection may be subject to YouTube's terms, applicable laws, privacy requirements, and the intended use of the data. You are responsible for using this Actor lawfully and respecting the rights of creators and commenters.
Related Actors
- Udemy Course Reviews Scraper - Collect structured course reviews, ratings, written feedback, and reviewer details for education research and sentiment analysis.
- Pinterest Search Scraper - Collect public social content and engagement data for audience research, trend analysis, and content planning.
Support
For issues, feature requests, or unexpected results, use the Issues tab on the Actor page. Include the input shape, the affected public video URL, the run ID, and a short description of the returned data when possible.
Legal Notice
This Actor is intended for legitimate collection of publicly available YouTube comments. Users are responsible for complying with YouTube's terms of service, applicable laws, privacy obligations, and any restrictions that apply to their use of collected data.