YouTube video comments API
  1. Docs
  2. YouTube
  3. YouTube video comments API

YouTube video comments API

Comments (about 1,000 top or 7,000 newest at most).

GET /v1/youtube/video/comments

GET /v1/youtube/video/comments

Comments (about 1,000 top or 7,000 newest at most). Page with cursor.

  • Cost: 1 credit
  • Cache: Results are kept up to 30 days; send max_age_days to reuse them for free.
  • Timeout: A request still running after about 25 seconds answers 202 with a job to poll (Batch and jobs).

Parameters#

NameTypeRequiredDescription
urlURLone ofVideo or Short URL (watch, youtu.be, shorts, live, embed). Accepted hosts: youtube.com, youtu.be.
idstringone of11-character video id. Also accepted as videoId, video_id.
sortstringnoOrder of results. Changing it restarts the cursor chain. One of top, latest. Default top. Also accepted as sort_by, sortBy, order. Also accepted values: newest for latest.

Send at least one of url, id. If you send several, the first listed is used and the rest are ignored.

Every request also accepts:

  • cursor: the cursor from the previous page (Pagination).
  • trim: true for a smaller response without null fields and extra.
  • raw: true to also get the platform's original object as raw.
  • max_age_days: accept a cached result up to this many days old, for 0 credits (Caching).

Example request#

Set your key in the environment first (see Authentication).

1curl -G "https://api.socialscrape.dev/v1/youtube/video/comments" \2  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3  --data-urlencode "id=dQw4w9WgXcQ" \4  --data-urlencode "sort=latest"

Example response#

This is a sample from a recorded response, lists and long text are shortened, other people's names and handles are replaced. Status 200.

200 OKSample response
1{2  "ok": true,3  "credits_charged": 1,4  "credits_remaining": 4999,5  "cached": false,6  "cached_at": null,7  "request_id": "req_d5366d88cd9d3f43e3076f5d",8  "data": {9    "object": "list",10    "items": [11      {12        "object": "comment",13        "platform": "youtube",14        "id": "UgzHlseKEhh-IqOwYux4AaABAg",15        "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ&lc=UgzHlseKEhh-IqOwYux4AaABAg",16        "post_id": "dQw4w9WgXcQ",17        "parent_id": null,18        "author": {19          "id": "1000000001",20          "handle": "sample_user",21          "name": "Sample User",22          "url": null,23          "avatar_url": null,24          "verified": false25        },26        "text": "So I just found that Rick Astley is still alive but Rick Astley if you see this, I saw this video by this channel named twisted translations and she did this song and I thought now Rick Astley has to sing this if he’s still alive which he i...",27        "published_at": "2026-10-30T01:54:00Z",28        "stats": {29          "likes": null,30          "replies": 0,31          "dislikes": null32        },33        "is_pinned": null,34        "is_by_creator": false,35        "extra": {36          "is_artist": false,37          "is_edited": false,38          "likes_approximate": true,39          "likes_text": " ",40          "published_at_approximate": true,41          "published_text": "25 minutes ago"42        }43      },44      {45        "object": "comment",46        "platform": "youtube",47        "id": "UgzLCcwkcTYULOyoWnp4AaABAg",48        "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ&lc=UgzLCcwkcTYULOyoWnp4AaABAg",49        "post_id": "dQw4w9WgXcQ",50        "parent_id": null,51        "author": {52          "id": "1000000001",53          "handle": "sample_user",54          "name": "Sample User",55          "url": null,56          "avatar_url": null,57          "verified": false58        },59        "text": "Never gonna give you up, Never Gonna let you down",60        "published_at": "2026-10-30T01:53:00Z",61        "stats": {62          "likes": 1,63          "replies": 0,64          "dislikes": null65        },66        "is_pinned": null,67        "is_by_creator": false,68        "extra": {69          "is_artist": false,70          "is_edited": true,71          "likes_text": "1",72          "published_at_approximate": true,73          "published_text": "26 minutes ago (edited)"74        }75      }76    ],77    "cursor": "Eg0SC2RRdzR3OVdnWGNRGAYyuAEKfGdldF9uZXdlc3RfZmlyc3QtLUNnZ0lnQVFWRjdmUk9CSUZDS2dnR0FBU0JRaUhJQmdBRWdVSWlTQVlBQklGQ0owZ0dBRVNCUWlJSUJnQUVnVUluaUFZQUJJRkNNZ2dHQUFpRGdvTUNQejZqdGNHRVBDUXEtOEJVQUJZQVEiESILZFF3NHc5V2dYY1EwAXgBKBQwAUIhZW5nYWdlbWVu...",78    "has_more": true,79    "parent": null80  },81  "cursor": "Eg0SC2RRdzR3OVdnWGNRGAYyuAEKfGdldF9uZXdlc3RfZmlyc3QtLUNnZ0lnQVFWRjdmUk9CSUZDS2dnR0FBU0JRaUhJQmdBRWdVSWlTQVlBQklGQ0owZ0dBRVNCUWlJSUJnQUVnVUluaUFZQUJJRkNNZ2dHQUFpRGdvTUNQejZqdGNHRVBDUXEtOEJVQUJZQVEiESILZFF3NHc5V2dYY1EwAXgBKBQwAUIhZW5nYWdlbWVu...",82  "has_more": true83}

Response#

A list of Comment objects in data.items, with data.cursor and data.has_more.

See Data models for every field. The envelope around data is described in Responses.

Errors#

Failures are free: credits_charged is 0. Branch on error.code, never on the message.

CodeHTTPRetryMeaning
invalid_params400noA parameter is missing, unknown or has the wrong type.
unsupported_url400noThe URL is not one this endpoint accepts (wrong platform or form).
not_found404noThe platform says this profile, post or item does not exist.

Every request can also fail with the account and platform errors listed on the Errors page.

Example error:

1{2  "ok": false,3  "error": {4    "code": "invalid_params",5    "message": "A parameter is missing, unknown or has the wrong type.",6    "retryable": false7  },8  "credits_charged": 0,9  "request_id": "req_4f3f2a91f37e9f71f9c6473f"10}