API · YouTube
GET /youtube/videos/{id}/comments
Comments on a YouTube video, top or newest first, paginated.
| |
|---|
| Request | GET /v1/youtube/videos/{id}/comments |
| Operation id | youtube.video.comments |
| Cost | 1 credit, refunded if the call fails |
| Auth | API key: Authorization: Bearer <key> or x-api-key. |
Comments on a YouTube video, top or newest first, paginated.
| Name | Type | Required | Description |
|---|
id | string | yes | A video or Short id, or any URL of it (watch, youtu.be, shorts, live, embed). Example: dQw4w9WgXcQ. |
| Name | Type | Required | Description |
|---|
order | "top" | "newest" | no | top (default) or newest. One of top, newest. |
textFormat | "html" | "plainText" | no | html (default) or plainText. One of html, plainText. |
after | string | no | The previous page’s nextPageToken. Tokens last 6 hours. |
| Status | Meaning | Schema |
|---|
200 | A page of comment threads. | YouTubeCommentThreadList |
400 | Invalid input. Nothing was charged. | Error |
401 | Missing or invalid API key. | Error |
402 | Not enough credits, a spend cap was reached, or payment is required. | Error |
403 | The target is private, or the account is suspended. | Error |
404 | The video, channel, playlist or post does not exist, was removed, or has nothing there. | Error |
429 | Too many requests. Wait for Retry-After seconds. | Error |
503 | YouTube is temporarily unavailable. Retryable; nothing was charged. | Error |
| Field | Type | Description |
|---|
kind | "youtube#commentThreadListResponse" | |
items | YouTubeCommentThread[] | |
nextPageToken | string | Pass as after for the next page. Absent on the last page. Lasts 6 hours. |
pageInfo | object | |
commentCount | string | All comments on the video (first page only), as a decimal string (Data API style). |
Errors use one shape everywhere; see Errors for every code and what to do.