YTAPI.devDocs

Get video comments

GET
https://api.ytapi.dev/v1/videos/{id}/comments
1 Credit

Returns a video's top-level comments, about 20 per page, top or newest first. Each comment has its author, like count, reply count and, when it has replies, a replies_cursor for /comments/replies. 1 credit per page.

Credits

Each successful page deducts 1 credit. A video with comments turned off returns 404 comments_disabled and costs nothing, and so does an empty page or an unavailable video.

API Key

All requests require a valid API key from the developer dashboard.

Headers: Authorization: Bearer YOUR_API_KEYorX-API-Key: YOUR_API_KEY

See Authentication for headers and rate limits.

Path Parameters

ParameterTypeRequiredDescription
idpath
stringYes

11-character YouTube video ID or video URL.

Query Parameters

ParameterTypeRequiredDescription
sortquery
stringNo

top (default) or newest.

cursorquery
stringNo

next_cursor from the previous page. Cursors last 2 hours.

Response (HTTP 200)

{
  "video_id": string,
  "sort": "top" | "newest",
  "comment_count": number,         // Video total, first page only; YouTube rounds it
  "comment_count_text": string,    // As shown, e.g. "3.3K"
  "has_more": boolean,
  "next_cursor": string | null,    // Pass as cursor for the next page
  "comments": [
    {
      "id": string,
      "text": string,
      "author": {
        "name": string,            // e.g. "@handle"
        "channel_id": string,
        "avatar_url": string,
        "is_channel_owner": boolean,
        "is_verified": boolean
      },
      "like_count": number,        // YouTube's rounded figure ("12K" is 12000)
      "like_count_text": string,
      "reply_count": number,
      "published_text": string,    // Relative, e.g. "3 years ago"
      "is_edited": boolean,
      "is_pinned": boolean,
      "is_hearted": boolean,       // Hearted by the creator
      "replies_cursor": string     // Present when the comment has replies
    }
  ]
}

YouTube shows only relative times and rounded like counts, so those are what the API returns.

Replies

GET /v1/videos/{id}/comments/replies?cursor=REPLIES_CURSOR returns a comment's replies in the same shape, without sort and comment_count. Pass a comment's replies_cursor, then the page's next_cursor for more. Same price: 1 credit per page.