YouTube Comment Scraper avatar

YouTube Comment Scraper

Pricing

from $1.70 / 1,000 comments

Go to Apify Store
YouTube Comment Scraper

YouTube Comment Scraper

Scrape comments from YouTube videos and playlists. Supports multiple video or playlist URLs, comment sorting, and a global comment limit.

Pricing

from $1.70 / 1,000 comments

Rating

0.0

(0)

Developer

Farhan Ali

Farhan Ali

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

2 days ago

Last modified

Share

YouTube Comment Scraper creates a structured dataset of comments collected from public YouTube videos and playlists. Each dataset item represents one comment and can include the comment text, author, likes, reply status, publish timestamp, and the source video's title, URL, view count, and channel. Query the source by video or playlist URL, control the result limit with maxItems, and retrieve records through the Apify Dataset API or export them as JSON, CSV, or Excel.

Dataset at a glance

PropertyValue
Sourceyoutube.com (public videos and playlists)
Record unitOne comment (or reply)
Input methodsVideo or playlist URLs (videoUrls)
Main identifierscommentId, videoId
DeliveryApify Dataset and API
Export formatsJSON, CSV, Excel
Update modelFresh records per Actor run
Pricing$2.50 per 1,000 comments

Coverage and available records

The Actor collects comments from one or more YouTube videos or playlists.

  • Video input: videoUrls accepts individual video URLs. Playlist URLs are expanded into their videos automatically; a video URL carrying both v= and list= parameters is treated as a single video.
  • Sort order: commentSort selects new (newest first) or top (top comments).
  • Result limit: maxItems caps the total number of comments collected across all videos (0 = unlimited).
  • Parallelism: maxConcurrency controls how many videos are processed at once (1–10).
  • Replies: Replies are collected as individual records and carry isReply and parentCommentId.

Known exclusions: comments are limited to what YouTube returns for the chosen sort order; each run captures comment state at run time (no historical snapshots); the Actor does not retrieve the full nested reply tree beyond returned replies.

Data dictionary

Field names below match dataset record JSON properties exactly.

FieldTypeNullableDescriptionExample
commentIdstringNoYouTube comment identifier; best stable deduplication keyUgzuC3zzpRZkjc5Qzsd4AaABAg
textstringNoComment text contentWe're so honored...
authorstringYesDisplay name of the comment author@SanDiegoZoo
authorChannelIdstringYesChannel ID of the comment authorUCC5NfQ6Mf0dq_eEwv4P_hWA
likeCountintegerYesNumber of likes on the comment4600000
isFavoritedbooleanYesWhether the video creator hearted the commenttrue
isReplybooleanYesWhether the comment is a reply to another commentfalse
parentCommentIdstringYesParent comment ID when isReply is trueUgzuC3zzpRZkjc5Qzsd4AaABAg
publishedAtstringYesISO 8601 timestamp of the comment2020-07-09T00:00:00+00:00
videoIdstringYesYouTube video ID of the source videojNQXAC9IVRw
videoUrlstringYesCanonical URL of the source videohttps://www.youtube.com/watch?v=jNQXAC9IVRw
videoTitlestringYesTitle of the source videoMe at the zoo
channelNamestringYesName of the channel that published the videojawed
channelIdstringYesChannel ID of the video publisherUC4QobU6STFB0P71PMvOGN5A
videoPublishedAtstringYesPublication date of the source video2005-04-24
videoViewCountintegerYesView count of the source video at scrape time398675009
videoCommentCountintegerYesTotal comment count reported for the source video10

Example dataset record

A representative record produced from the video https://www.youtube.com/watch?v=jNQXAC9IVRw:

{
"commentId": "UgzuC3zzpRZkjc5Qzsd4AaABAg",
"text": "We're so honored that the first ever YouTube video was filmed here!",
"author": "@SanDiegoZoo",
"authorChannelId": "UCC5NfQ6Mf0dq_eEwv4P_hWA",
"likeCount": 4600000,
"isFavorited": true,
"isReply": false,
"parentCommentId": null,
"publishedAt": "2020-07-09T00:00:00+00:00",
"videoId": "jNQXAC9IVRw",
"videoUrl": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
"videoTitle": "Me at the zoo",
"channelName": "jawed",
"channelId": "UC4QobU6STFB0P71PMvOGN5A",
"videoPublishedAt": "2005-04-24",
"videoViewCount": 398675009,
"videoCommentCount": 10
}

Query and input reference

InputTypeRequiredDefaultAccepted valuesDescription
videoUrlsarray[string]YesYouTube video or playlist URLsSource videos; playlists are expanded automatically
maxItemsintegerNo1000 or a positive integerMaximum comments across all videos; 0 = unlimited
commentSortstringNonewnew, topNewest first, or top comments
maxConcurrencyintegerNo3110Number of videos processed in parallel
proxyConfigurationobjectNoApify residential proxyApify proxy groups or custom proxiesResidential proxies are recommended

Minimal request:

{ "videoUrls": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"] }

Advanced request:

{
"videoUrls": ["https://www.youtube.com/playlist?list=..."],
"maxItems": 1000,
"commentSort": "top",
"maxConcurrency": 3,
"proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}

Retrieve the data through the API

  1. Start the Actor with a JSON input (console or API).
  2. Wait for the run to finish, or use a synchronous endpoint for an inline response.
  3. Retrieve items from the run's default dataset.
  4. Paginate or export the dataset.

Python example:

from apify_client import ApifyClient
client = ApifyClient("YOUR-APIFY-TOKEN")
run = client.actor("datascrapers/youtube-comment-scraper").call(run_input={
"videoUrls": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"],
"maxItems": 1000,
"commentSort": "new",
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item["commentId"], item["author"], item["likeCount"])

Apify generates ready-to-run Python, JavaScript, and cURL examples on the Actor's API tab. Do not put a real API token in shared code or URLs.

Data quality and record handling

  • Conditional fields: Reply records carry isReply and parentCommentId; top-level comments have parentCommentId null. Fields YouTube does not expose are returned as null.
  • Source changes: YouTube page structure and values can change; unreadable fields are returned as null rather than fabricated.
  • Deduplication: Each run appends fresh records; the Actor does not deduplicate across runs. Use commentId as the stable key and filter repeated runs against previously stored IDs.
  • Rate limits: YouTube rate-limits automated traffic. Residential proxies (enabled by default) and bounded concurrency are used to maintain coverage.
  • Normalization: publishedAt is normalized to ISO 8601; view and like counts are read as integers.

Export and pipeline examples

DestinationRecommended methodTypical use
PostgreSQL / SupabaseDataset API poll or webhook consumerStore comments for sentiment pipelines
Google SheetsApify Google Sheets integrationShare comment threads with community teams
S3 / cloud storageScheduled export via Apify schedulerArchival of comment snapshots
BI toolsCSV / JSON exportAudience and sentiment analysis

Pricing and cost examples

The Actor uses pay-per-event pricing, billed per comment record:

EventTriggerRate
CommentEvery comment pushed to the dataset$2.50 per 1,000 comments

A one-time Actor start event of $0.00005 applies to each run (effectively $0).

CommentsEstimated base cost
1,000$2.50
10,000$25.00
100,000$250.00

Compute units consumed by the run are billed by your Apify plan. Estimates depend on the verified pricing model and the options selected for the run.

Limitations and responsible data use

  • The Actor collects publicly accessible comment data from YouTube only.
  • Field availability depends on what YouTube returns at run time; some values can be null or missing, and site changes can alter fields.
  • The Actor does not provide historical snapshots unless you store them yourself.
  • Large runs require residential proxies; without them, coverage may degrade due to rate limiting.
  • You are responsible for compliance with YouTube's terms of service, applicable privacy law, and any contractual obligations before using the data.

Dataset questions

What does one dataset item represent?

One comment or reply. Replies are separate records linked to their parent via parentCommentId.

Which field should I use as a unique identifier?

commentId is the stable YouTube comment identifier and the recommended deduplication key.

Are fields nullable or conditional?

Yes. Reply records carry isReply and parentCommentId; top-level comments have parentCommentId null. Fields YouTube does not expose for a given comment are returned as null.

Can I retrieve the records as CSV or JSON?

Yes. The dataset can be exported as JSON, CSV, or Excel from the Apify Console, and queried through the Dataset API.

Does the Actor return historical data?

No. Each run captures the state of the comments at run time. To track changes, schedule repeated runs and store the outputs yourself.

What counts as a billable result?

Each comment pushed to the dataset is one billable result, charged at $2.50 per 1,000 comments. Use maxItems to control cost per run.

Data Scrapers support

Need an additional field, record type, or export workflow? Contact Data Scrapers at stardustspotlight@gmail.com. Include a sample source URL, required fields, expected record volume, and preferred delivery format.