# YouTube: List a video's comments

`youtube/comments/list` · version 1.0.0 · pilot · 1 credits a call

One page of a YouTube video's comments, 20 at a time, top or newest first, each with its author, likes, replies and date; or the replies to one comment.

Categories: Social media

## When to use

You need what viewers say under a YouTube video, from its id or any of its links: its comments in YouTube's own order (top, the creator's pinned one first) or newest first, each with its text and links, its author (channel, handle, whether it is the video's creator), its likes, its number of replies, whether the creator hearted or answered it, and when it was written. Pass a comment's id (or its link) as `comment` for its replies. Follow `next` for the following page. For the video itself, use youtube/videos/get; what is said in it, youtube/transcripts/get.

## Call

```bash
curl https://api.lobstr.io/v2/run \
  -H "Authorization: Bearer $LOBSTR_API_KEY" \
  -H "content-type: application/json" \
  -d '{"source": "youtube", "operation": "comments/list", "options": {"video": "e3OV3LnrS7o"}}'
```

It answers:

```json
{"object": "run", "status": "succeeded", "count": 20, "has_more": true, "next": {"source": "youtube", "operation": "comments/list", "options": {...}},
 "cost": {"credits": 1}, "balance": {"credits": 9990}, "results": [...]}
```

`cost` and `balance` are objects: a call's credits are `cost.credits`. `results` holds the records (below). `next` is the whole call for the following page: send it as it is; `null` on the last page.

Beside `options`, the call takes:

| Parameter | Type | Description |
|---|---|---|
| `fields` | array of string | The record fields to keep, by path: inside an object with a dot (`ids.comment_id`), in each item of a list with `[]` (`links[].type`, or with a dot: `links.type`); `object`, `id` and `position` always come. Left out: every field. |
| `limit` | integer | Only the first N records of this call (1 to 1000), in the call's order; the call costs the same, and `next` keeps the limit. Left out: every record. |

## Options

| Option | Type | Required | Default | Description |
|---|---|---|---|---|
| `video` | string | yes |  | The video: its id (11 letters, digits, - or _) or any of its links (youtube.com/watch?v=..., youtu.be/..., /shorts/..., /live/..., /embed/...). |
| `comment` | string |  |  | A comment of the video, to list its replies (10 a page, oldest first) instead of the video's comments: its id (`id` of a record, Ug...) or its link (watch?v=...&lc=Ug...). A reply's id lists its thread's replies. |
| `sort` | `top`, `newest` |  | `"top"` | The order of the video's comments, as its sort menu: top, YouTube's own order of the most relevant (the creator's pinned comment first); newest, the latest first (a pinned comment stays first). Replies come oldest first. |
| `cursor` | string |  |  | Where to go on, from `next` in an answer, as it is: opaque, and only for the video, sort and comment it was given with (otherwise `invalid_cursor`). |

## Record

Each item of `results`. Every field is always present, `null` when the site gives nothing.

| Field | Type | Description |
|---|---|---|
| `object` | `"comment"` |  |
| `id` | string | The comment's id on YouTube (a reply's is its thread's, a dot, its own). |
| `ids` | object |  |
| `ids.comment_id` | string |  |
| `ids.video_id` | string |  |
| `ids.parent_id` | string | null | A reply's thread: the comment it answers; null for a comment. |
| `ids.author_channel_id` | string | null |  |
| `url` | string | The comment on its video's page (its link, `lc`). |
| `position` | integer | Its place in the list, across pages. |
| `is_reply` | boolean |  |
| `text` | string | null | The comment, as written, its lines apart (emojis as characters). |
| `links` | array | The links of the comment, in order: a web page (`link`, its address itself, not YouTube's redirect), a moment of the video (`timestamp`, with its `seconds`), another video, a playlist, a hashtag or a channel (an @mention). |
| `links[].type` | `link`, `timestamp`, `video`, `playlist`, `hashtag`, `channel` |  |
| `links[].text` | string | null |  |
| `links[].url` | string | null |  |
| `links[].seconds` | integer | null |  |
| `published_text` | string | null | When it was written, as YouTube tells a visitor (4 months ago). |
| `is_edited` | boolean | Edited by its author. |
| `likes` | integer | Its likes, as YouTube shows them: exact below a thousand, rounded above (1.2K is 1200). |
| `reply_count` | integer | Its replies, as YouTube counts them (a reply has none). |
| `is_pinned` | boolean | Pinned by the video's creator, first of the top comments. |
| `is_hearted` | boolean | Hearted by the video's creator. |
| `has_creator_reply` | boolean | The video's creator is among its replies. |
| `author` | object |  |
| `author.channel_id` | string | null | The author's channel (UC...). |
| `author.name` | string | null | As the comment shows it: its @handle, or its name. |
| `author.handle` | string | null |  |
| `author.url` | string | null | Its channel's page. |
| `author.thumbnails` | array | Its avatar. |
| `author.thumbnails[].url` | string |  |
| `author.thumbnails[].width` | integer | null |  |
| `author.thumbnails[].height` | integer | null |  |
| `author.is_verified` | boolean |  |
| `author.is_artist` | boolean | An official artist channel's badge. |
| `author.is_creator` | boolean | The video's own creator. |
| `source_url` | string | The video's page on youtube.com (with the comment, for its replies). |
| `observed_at` | string (date-time) |  |

Example:

```json
{
  "object": "comment",
  "id": "UgzXk2mQp8vRt4LwNc94AaABAg",
  "ids": {
    "comment_id": "UgzXk2mQp8vRt4LwNc94AaABAg",
    "video_id": "k7Rt2mVxQ4s",
    "parent_id": null,
    "author_channel_id": "UCa1B2c3D4e5F6g7H8i9J0kL"
  },
  "url": "https://www.youtube.com/watch?v=k7Rt2mVxQ4s&lc=UgzXk2mQp8vRt4LwNc94AaABAg",
  "position": 1,
  "is_reply": false,
  "text": "The full recipe with grams: https://acmekitchen.com/sourdough",
  "links": [
    {
      "type": "link",
      "text": "https://acmekitchen.com/sourdough",
      "url": "https://acmekitchen.com/sourdough",
      "seconds": null
    }
  ],
  "published_text": "1 month ago",
  "is_edited": false,
  "likes": 48,
  "reply_count": 3,
  "is_pinned": true,
  "is_hearted": true,
  "has_creator_reply": false,
  "author": {
    "channel_id": "UCa1B2c3D4e5F6g7H8i9J0kL",
    "name": "@acmekitchen",
    "handle": "@acmekitchen",
    "url": "https://www.youtube.com/@acmekitchen",
    "thumbnails": [
      {
        "url": "https://yt3.ggpht.com/acme-kitchen=s88-c-k-c0x00ffffff-no-rj",
        "width": 88,
        "height": 88
      }
    ],
    "is_verified": true,
    "is_artist": false,
    "is_creator": true
  },
  "source_url": "https://www.youtube.com/watch?v=k7Rt2mVxQ4s",
  "observed_at": "2026-12-03T12:00:00Z"
}
```

## Price

1 credit a call, one page of 20 comments or 10 replies. Newest first costs no more than top. An empty page, a video whose comments are turned off or that does not exist, and a failed call are free.

## Errors

| Code | Status | Retry | Message |
|---|---|---|---|
| `ip_blocked` | 503 | yes | YouTube slowed down the IPs the call tried (429). Retry in a minute; failed calls are free. |
| `invalid_video` | 422 | no | `video` is a YouTube video: its id (dQw4w9WgXcQ) or one of its links (https://www.youtube.com/watch?v=dQw4w9WgXcQ, https://youtu.be/dQw4w9WgXcQ, a /shorts/ link). |
| `invalid_comment` | 422 | no | `comment` is a comment of the video: its id (UgxAql95_2yQOWVUsad4AaABAg, a record's `id`) or its link (https://www.youtube.com/watch?v=e3OV3LnrS7o&lc=UgxAql95_2yQOWVUsad4AaABAg). |
| `video_unavailable` | 404 | no | YouTube has no such video (removed, private, or never one). Not charged. |
| `comments_turned_off` | 404 | no | The video's comments are turned off (videos made for kids, or by its creator's choice). Not charged. |
| `site_unavailable` | 503 | yes | YouTube did not answer properly; retry later (not charged). |
| `unexpected_answer` | 424 | no | YouTube answered in a shape we do not read yet; we are told and fix it (not charged). |
| `missing_api_key` | 401 | no | No API key: send it as `Authorization: Bearer <key>`. |
| `invalid_api_key` | 401 | no | The key is not valid, or not anymore. |
| `insufficient_credits` | 402 | no | The call costs more credits than are left. |
| `unknown_operation` | 404 | no | No such source and operation in the catalog. |
| `timeout` | 408 | yes | The call did not finish within its deadline (not charged). |
| `invalid_body` | 422 | no | The body is not a call: source, operation, options. |
| `invalid_options` | 422 | no | An option is missing or out of its contract; `param` names it. |
| `invalid_idempotency_key` | 400 | no | The Idempotency-Key header is not printable ASCII, or too long. |
| `concurrency_limit` | 429 | yes | The plan's calls at a time are all in progress (Free 1, Starter 2, Pro 10, Team 50); retry when one has finished (not charged, never queued). |
| `service_busy` | 503 | yes | Too many calls at once on the account; retry in a few seconds. |
| `balance_unavailable` | 503 | yes | The balance could not be read; retry in a few seconds. |

## Changelog

- **1.0.0** (2026-12-03): First version: a video's comments by its id or any of its links, signed out, 20 a page, top or newest first, or a comment's replies; each with its text and links, author, likes, replies, date, and whether the creator pinned, hearted or answered it.

Schema: https://api.lobstr.io/v2/catalog/youtube/comments/list · All operations: https://api.lobstr.io/v2/catalog.md
