Skip to content
youtubeapi.io
All endpoints

Fetch Paginated YouTube Video Comments (Top or Newest)

GET/v1/youtube/comments

Retrieves top or newest comments for a YouTube video, including author handle, channel ID, like count, reply count, pinned/hearted badges, and nextCursor pagination token. Cost: 1 Credit per comment returned (minimum 10 Credits per non-empty call).

Query Parameters

  • video_idstringrequired

    11-character YouTube video ID (dQw4w9WgXcQ) or full YouTube URL.

  • sort_bystring

    Sort order: top (most relevant/liked) or newest.

  • limitinteger

    Number of comments to return per page (1–100).

  • cursorstring

    Continuation token from data.nextCursor (meta.next_cursor).

Example Request (cURL / Python / JavaScript)

curl "https://api.youtubeapi.io/v1/youtube/comments?video_id=dQw4w9WgXcQ" \
  -H "x-api-key: yt_live_your_api_key"

Live Response Preview

{
  "code": 0,
  "provider": "https://youtubeapi.io",
  "status": "ok",
  "msg": "success",
  "data": {
    "videoId": "dQw4w9WgXcQ",
    "totalCommentsCount": 2410000,
    "sortBy": "top",
    "nextCursor": null,
    "continuation": null,
    "hasMore": false,
    "items": [
      {
        "commentId": "UgzX_dQw4w9WgXcQ_1",
        "videoId": "dQw4w9WgXcQ",
        "parentId": null,
        "author": "@YouTube",
        "authorChannelId": "UCBR8-60-B28hp2BmDPdntcQ",
        "authorAvatar": null,
        "authorIsOwner": false,
        "authorIsVerified": true,
        "text": "Can confirm: he never gave us up.",
        "likeCount": 942000,
        "replyCount": 512,
        "isHearted": true,
        "isPinned": true,
        "publishedTimeText": "3 years ago",
        "publishedAt": "2023-01-15T12:00:00.000Z"
      }
    ]
  },
  "meta": {
    "request_id": "2b3c4d5e-2222-3333-4444-555566667777",
    "endpoint": "/v1/youtube/comments",
    "cached": true,
    "source": "pg",
    "items_count": 2,
    "credits_charged": 10,
    "has_more": false,
    "next_cursor": null,
    "latency_ms": 7
  }
}

Response Fields

Successful comments response

FieldTypeSample / Notes
codeinteger
providerstring
statusstring
msgstring
dataobject
videoIdstring
totalCommentsCountinteger
sortBystring
nextCursorstringnull
continuationstringnull
hasMoreboolean
itemsarray of CommentData
commentIdstringUnique YouTube comment ID.
videoIdstring11-character YouTube video ID.
parentIdstringnullParent comment ID if reply.
authorstringAuthor handle or display name.
authorChannelIdstringnullAuthor's YouTube channel ID.
authorAvatarstringnullAuthor profile image URL.
authorIsOwnerbooleanTrue if comment is by the video creator.
authorIsVerifiedboolean
textstringComment text content.
likeCountintegerNumber of likes on the comment.
replyCountintegerNumber of replies to the comment.
isHeartedbooleanTrue if hearted by the creator.
isPinnedbooleanTrue if pinned to top of comments.
publishedTimeTextstringnullRelative publish time (e.g. 2 days ago).
publishedAtstringnullISO 8601 timestamp when available.
metaResponseMeta
request_idstringUnique UUID for tracing and support.
endpointstringCanonical endpoint path.
cachedbooleanTrue if served from L1 Redis or L2 PostgreSQL 16 asset sink.
sourcestringData source tier (redis, pg, upstream_primary, upstream_fallback, oembed).
items_countintegerNumber of records returned in data.
credits_chargedintegerCredits deducted for this request ($1 = 10,000 Credits).
has_morebooleanWhether additional pages are available via next_cursor.
next_cursorstringnullContinuation cursor for the next page.
latency_msintegerEnd-to-end gateway latency in milliseconds.

Status Codes

200
Successful comments response