# How do I get YouTube video comments with an API?

YouTube. Checked October 2026.

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.

## GET /v1/youtube/posts/{videoId}/comments

```bash
curl "https://api.openhandle.dev/v1/youtube/posts/synthvid001/comments?sort=top" \
  -H "Authorization: Bearer $OPENHANDLE_API_KEY"
```

```ts
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:

```json
{
  "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](/compare/youtube-data-api-alternative).

## When this does not work

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

| Situation | Status | Code |
|---|---|---|
| The video does not exist | 404 | `POST_NOT_FOUND` |
| The ID is not a valid YouTube video ID | 400 | `INVALID_IDENTIFIER` |
| The cursor came from another video or sort | 400 | `CURSOR_MISMATCH` |

```json
{
  "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.

## Related

- [YouTube API](https://openhandle.dev/apis/youtube): Every YouTube endpoint with examples.
- [YouTube docs](https://openhandle.dev/docs/platforms/youtube): Comment replies, pagination, and response fields.
- [Comments on a TikTok video](https://openhandle.dev/questions/how-do-i-get-comments-on-a-tiktok-video): The same call shape on TikTok.
