scraper
Back to API docs

Overview

  • Overview

Discovery

  • POSTSearch
  • POSTHashtag

Content

  • POSTVideo
  • POSTChannel
  • POSTChannel Videos
  • POSTPlaylist

Details

  • POSTTranscript
  • POSTComments

YouTube Comments

1 credit

Get comments for a YouTube video.

POST/api/v1/tools/youtube/comments

Parameters

urlstringrequired

YouTube video URL or video ID.

maxCommentsnumber

Maximum number of comments to return. Defaults to 20.

fieldsstring[]

Fields to include per comment. Omit for defaults: commentId, text, authorName, likeCount, replyCount, publishedTime. Use ["*"] for all fields. Available fields: commentId, text, authorName, likeCount, replyCount, publishedTime, authorChannelId, authorAvatarUrl, isVerified, isCreator, isHearted.

Response Schema

dataobject

YouTube comments result

videoobject | null

Video metadata wrapper (always returned)

commentsobject[]

Array of comment objects.

countnumber

Number of comments returned

totalCommentsnumber | null

Total comment count for the video

truncatedboolean

True if results were cut short. Only present when truncation occurred.

metaobject

Request metadata

toolstring

Tool name (youtube-comments)

creditsUsednumber

Credits consumed (1)

requestIdstring

Unique request ID

Request

curl -X POST https://scraper.run/api/v1/tools/youtube/comments \
-H "Authorization: Bearer sc_live_..." \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"maxComments": 15
}'

Response Example

{
"data": {
"video": {
"videoId": "dQw4w9WgXcQ",
"title": "Rick Astley - Never Gonna Give You Up"
},
"comments": [
{
"commentId": "UgxbG1234abc",
"text": "This song is timeless.",
"authorName": "Music Lover",
"likeCount": 42000,
"replyCount": 312,
"publishedTime": "2 years ago"
}
],
"count": 1,
"totalComments": 2800000
},
"meta": {
"tool": "youtube-comments",
"creditsUsed": 1,
"requestId": "req_abc123"
}
}