YouTube video comments
Beta 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
- Status: Beta. Built and tested against recorded responses; the shape may still gain fields.
- Cache: Results are kept up to 30 days; send
max_age_daysto reuse them for free. - Timeout: A request still running after about 25 seconds answers
202with a job to poll (Batch and jobs).
Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
url | URL | one of | Video or Short URL (watch, youtu.be, shorts, live, embed). Accepted hosts: youtube.com, youtu.be. |
id | string | one of | 11-character video id. Also accepted as videoId, video_id. |
sort | string | no | Order 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:truefor a smaller response withoutnullfields andextra.raw:trueto also get the platform's original object asraw.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).
curl -G "https://api.socialscrape.io/v1/youtube/video/comments" \
-H "x-api-key: $SOCIALSCRAPE_API_KEY" \
--data-urlencode "id=dQw4w9WgXcQ" \
--data-urlencode "sort=latest"import os
import requests
params = {
"id": "dQw4w9WgXcQ",
"sort": "latest",
}
res = requests.get(
"https://api.socialscrape.io/v1/youtube/video/comments",
headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},
params=params,
)
body = res.json()
if body["ok"]:
print(body["data"])
else:
print(body["error"]["code"], body["error"]["message"])const url = new URL("https://api.socialscrape.io/v1/youtube/video/comments");
url.search = new URLSearchParams({
"id": "dQw4w9WgXcQ",
"sort": "latest"
}).toString();
const res = await fetch(url, {
headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },
});
const body = await res.json();
if (body.ok) {
console.log(body.data);
} else {
console.error(body.error.code, body.error.message);
}{
"nodes": [
{
"name": "SocialScrape YouTube video comments",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
0,
0
],
"parameters": {
"method": "GET",
"url": "https://api.socialscrape.io/v1/youtube/video/comments",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "id",
"value": "dQw4w9WgXcQ"
},
{
"name": "sort",
"value": "latest"
}
]
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "x-api-key",
"value": "={{ $env.SOCIALSCRAPE_API_KEY }}"
}
]
}
}
}
],
"connections": {}
}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.
{
"ok": true,
"credits_charged": 1,
"credits_remaining": 4999,
"cached": false,
"cached_at": null,
"request_id": "req_d5366d88cd9d3f43e3076f5d",
"data": {
"object": "list",
"items": [
{
"object": "comment",
"platform": "youtube",
"id": "UgzHlseKEhh-IqOwYux4AaABAg",
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ&lc=UgzHlseKEhh-IqOwYux4AaABAg",
"post_id": "dQw4w9WgXcQ",
"parent_id": null,
"author": {
"id": "1000000001",
"handle": "sample_user",
"name": "Sample User",
"url": null,
"avatar_url": null,
"verified": false
},
"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...",
"published_at": "2026-10-30T01:54:00Z",
"stats": {
"likes": null,
"replies": 0,
"dislikes": null
},
"is_pinned": null,
"is_by_creator": false,
"extra": {
"is_artist": false,
"is_edited": false,
"likes_approximate": true,
"likes_text": " ",
"published_at_approximate": true,
"published_text": "25 minutes ago"
}
},
{
"object": "comment",
"platform": "youtube",
"id": "UgzLCcwkcTYULOyoWnp4AaABAg",
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ&lc=UgzLCcwkcTYULOyoWnp4AaABAg",
"post_id": "dQw4w9WgXcQ",
"parent_id": null,
"author": {
"id": "1000000001",
"handle": "sample_user",
"name": "Sample User",
"url": null,
"avatar_url": null,
"verified": false
},
"text": "Never gonna give you up, Never Gonna let you down",
"published_at": "2026-10-30T01:53:00Z",
"stats": {
"likes": 1,
"replies": 0,
"dislikes": null
},
"is_pinned": null,
"is_by_creator": false,
"extra": {
"is_artist": false,
"is_edited": true,
"likes_text": "1",
"published_at_approximate": true,
"published_text": "26 minutes ago (edited)"
}
}
],
"cursor": "Eg0SC2RRdzR3OVdnWGNRGAYyuAEKfGdldF9uZXdlc3RfZmlyc3QtLUNnZ0lnQVFWRjdmUk9CSUZDS2dnR0FBU0JRaUhJQmdBRWdVSWlTQVlBQklGQ0owZ0dBRVNCUWlJSUJnQUVnVUluaUFZQUJJRkNNZ2dHQUFpRGdvTUNQejZqdGNHRVBDUXEtOEJVQUJZQVEiESILZFF3NHc5V2dYY1EwAXgBKBQwAUIhZW5nYWdlbWVu...",
"has_more": true,
"parent": null
},
"cursor": "Eg0SC2RRdzR3OVdnWGNRGAYyuAEKfGdldF9uZXdlc3RfZmlyc3QtLUNnZ0lnQVFWRjdmUk9CSUZDS2dnR0FBU0JRaUhJQmdBRWdVSWlTQVlBQklGQ0owZ0dBRVNCUWlJSUJnQUVnVUluaUFZQUJJRkNNZ2dHQUFpRGdvTUNQejZqdGNHRVBDUXEtOEJVQUJZQVEiESILZFF3NHc5V2dYY1EwAXgBKBQwAUIhZW5nYWdlbWVu...",
"has_more": true
}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.
| Code | HTTP | Retry | Meaning |
|---|---|---|---|
invalid_params | 400 | no | A parameter is missing, unknown or has the wrong type. |
unsupported_url | 400 | no | The URL is not one this endpoint accepts (wrong platform or form). |
not_found | 404 | no | The 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:
{
"ok": false,
"error": {
"code": "invalid_params",
"message": "A parameter is missing, unknown or has the wrong type.",
"retryable": false
},
"credits_charged": 0,
"request_id": "req_4f3f2a91f37e9f71f9c6473f"
}Related endpoints#
- YouTube channel details (
GET /v1/youtube/channel) - YouTube channel videos (
GET /v1/youtube/channel/videos) - Search inside a YouTube channel (
GET /v1/youtube/channel/search) - YouTube channel playlists (
GET /v1/youtube/channel/playlists) - YouTube channel Shorts (
GET /v1/youtube/channel/shorts) - YouTube channel live streams (
GET /v1/youtube/channel/lives) - YouTube channel community posts (
GET /v1/youtube/channel/community-posts) - YouTube video or Short details (
GET /v1/youtube/video)