Platforms/YouTube/Video comments

YouTube Comments API

GET ยท 1 credit

Send a video's id or link, and get its comments, 20 a page, top or newest first, the pinned one always first.

GET /v1/youtube/videos/comments

What people use it for

  • Sentiment analysis: score what viewers say about a product review or a launch video.
  • Audience research: find the questions and requests that come up under a creator's videos.
  • Moderation: read the newest comments on your own videos with sort=newest.

How it works with other endpoints

Video ids come from Video, Channel videos or Search. Each comment's id goes to Comment replies.

Limits

  • 20 comments a page.
  • Likes are rounded by YouTube (4.7K).
  • A video with comments turned off answers 404 NOT_FOUND.

Example request

const url = `${process.env.API_URL}/v1/youtube/videos/comments?video_id=rfscVS0vtbw`;

const response = await fetch(url, {
  headers: { "x-api-key": process.env.API_KEY },
});

const { data } = await response.json();
console.log(data);

Parameters

ParameterRequiredDescription
video_idNoA video's id: the 11 characters after watch?v= or /shorts/ in its link. Give video_id or url.
urlNoA video's link: watch?v=<id>, youtu.be/<id>, or a /shorts/, /live/, /embed/ or /v/ link, on youtube.com, www., m. or music. Give video_id or url.
sortNoThe order: top (YouTube's default) or newest first.
cursorNoFor the next page: page.next_cursor from the page before. Send the other parameters again with it.

Example response

{
  "data": [
    {
      "id": "Ugxqcek3RUzxWv-4VqB4AaABAg",
      "text": "This course got me my first developer job. Thank you!",
      "author_handle": "codewithsam",
      "author_channel_id": "UC0000000000000000000001",
      "author_picture": "https://yt3.googleusercontent.com/commenter.jpg",
      "author_verified": false,
      "author_is_creator": false,
      "likes": 4700,
      "reply_count": 36,
      "published": "5 years ago",
      "pinned": false
    }
  ],
  "page": {
    "next_cursor": "eyJ0b2tlbiI6IkVnWlEifQ",
    "has_more": true
  },
  "meta": {
    "platform": "youtube",
    "endpoint": "video_comments",
    "params": {
      "video_id": "rfscVS0vtbw",
      "sort": "top"
    },
    "request_id": "sp_req_1f8c2d3e4a5b6c7d",
    "api_version": "v1",
    "fetched_at": "2026-11-30T09:30:00Z",
    "cached": false
  }
}

An illustrative answer: live answers have the same shape, with the page's current data.

Every field, with its type, is in the API reference, and every error code in Errors.

Price

Each call costs 1 credit, a not-found answer too. Cached answers and other errors cost nothing, and credits never expire. New accounts start with 100 free credits. See pricing for the packs.

FAQ

Which orders can I pick?

top (YouTube's default) or newest. The pinned comment always comes first.

What if comments are turned off?

The video answers 404 NOT_FOUND.

How do I get the replies?

Send a comment's id and the video's id or link to Comment replies. reply_count says which comments have any.

Are likes exact?

No. YouTube rounds them, such as 4.7K, and likes carries that number.

Works with

On other platforms

YouTube guides

Start free

Your first 100 credits are on us

Sign up, create a key and make your first call in a few minutes.

No credit card required