API Reference

YouTube Comments

Get comments from a YouTube video including author, text, like count, reply count, and timestamps.

Use this to read the comments on a video with author, text, like and reply counts, and timestamps. Useful for audience research and sentiment analysis.

5 credits per request.

Quick example

curl -G "https://api.webscraperapi.ai/v1/youtube_comments" \
  -H "Authorization: Bearer $WEBSCRAPERAPI_API_KEY" \
  --data-urlencode "video_id=hHQlcnubuFI" \
  --data-urlencode "max_results=1" \
  --data-urlencode "output=json"

video_id takes a video ID or a full YouTube URL. max_results defaults to 20 and goes up to 100.

Full API reference

GET
/v1/youtube_comments

Query Parameters

video_id*string

YouTube video ID or URL.

Length1 <= length
max_results?integer

Maximum comments to return (max 100).

Default20
Range1 <= value <= 100
output?|

Output format. Defaults to json.

timeout_ms?|

Request timeout in milliseconds.

Response Body

application/json

application/json

curl -X GET "https://api.webscraperapi.ai/v1/youtube_comments?video_id=string"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  }
}