All questionsYouTube

How do I get YouTube video comments with an API?

Call GET /v1/youtube/posts/{videoId}/comments. Each request returns one page of top-level comments with the author, text, like count, reply count, and a cursor for the next page. Sort with sort=top or sort=newest. The total comment count is in meta.comments.

A comment with replies carries a repliesToken. Pass it as token to GET /v1/youtube/posts/{videoId}/comments/{commentId}/replies for the first page of replies, then use the cursor for the rest.

Checked October 2026 · request and response run against the API · no affiliate links

GET /v1/youtube/posts/{videoId}/comments
curl "https://api.openhandle.dev/v1/youtube/posts/synthvid001/comments?sort=top" \
  -H "Authorization: Bearer $OPENHANDLE_API_KEY"
TypeScript SDK
import { OpenHandle } from '@openhandle/sdk';

const openhandle = new OpenHandle({ apiKey: process.env.OPENHANDLE_API_KEY! });
let page = await openhandle.youtube.post('synthvid001').comments.list({ sort: 'top' });

while (true) {
    for (const comment of page.data) console.log(comment.author?.handle, comment.text);
    const next = await page.next();
    if (!next) break;
    page = next;
}
200 OK
{
  "platform": "youtube",
  "resource": "comment",
  "capturedAt": "2026-10-26T18:33:17Z",
  "source": "live",
  "data": [
    {
      "id": "Ugsynthcomment001",
      "text": "Synthetic comment 1",
      "postId": "synthvid001",
      "author": { "id": "UCpapersignalyttest00002", "handle": "paper_signal_yt_test" },
      "isByPostAuthor": false,
      "approximateCreatedAt": "2026-10-25",
      "createdAtLabel": "1 days ago",
      "metrics": { "likes": 1100, "replies": 12, "isApproximate": true },
      "repliesToken": "synthetic-replies-Ugsynthcomment001"
    }
  ],
  "meta": { "comments": 12, "cursors": { "next": "b3BhcXVlLWN1cnNvcg" } }
}

Trimmed to one comment and the fields this question needs. The video is in the Test dataset, so you can run it on a free Test key.

What you get per comment

  • —Author. Channel ID and handle of the commenter, and whether the video’s creator wrote it.
  • —Likes and replies. YouTube shows comment likes rounded, like "1.1K". We keep that number and set isApproximate to true.
  • —Date. YouTube shows "1 day ago". You get that label and an estimated day in approximateCreatedAt.
  • —Contact details. Emails, phone numbers, links, and handles found in the text are in extracted.

With the YouTube Data API

commentThreads.list returns up to 100 comment threads a page for 1 quota unit. That is cheap. It shares the 10,000 units a day with most other calls, and it returns 403 commentsDisabled when a video has comments turned off. If the Data API covers your volume, use it. If you also need search, transcripts, or other platforms, see the YouTube Data API alternative.

When this does not work

These answers are definitive. Store them, do not retry them.

SituationStatusCode
The video does not exist404POST_NOT_FOUND
The ID is not a valid YouTube video ID400INVALID_IDENTIFIER
The cursor came from another video or sort400CURSOR_MISMATCH
404 Not Found
{
  "error": {
    "code": "POST_NOT_FOUND",
    "message": "This post was not found.",
    "requestId": "req_01m5…",
    "retryable": false
  }
}

Every new workspace starts with 100 free live requests, no card needed.

Read next

More YouTube questions

Send your agent ahead.

Paste the prompt into your agent and it sets everything up. Or come yourself, it takes five minutes.

For agents

100 free requests. No card needed.