YouTube video comments API
Comments (about 1,000 top or 7,000 newest at most).
- Cost
- 1 credit
- Cached repeats
- 0 creditssend max_age_days, results kept 30 days
- Failed requests
- 0 credits
- Status
- Betashape may still gain fields
Page with cursor.
You send one of url or id.
Request
Send your key in the x-api-key header.
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,
timeout=60,
)
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": {}
}Parameters
| Name | Type | Required | Description |
|---|---|---|---|
url | url | one of | Video or Short URL (watch, youtu.be, shorts, live, embed). |
id | string | one of | 11-character video id. Also accepted as videoId, video_id. |
sort | string | Order of results. Changing it restarts the cursor chain. Also accepted as sort_by, sortBy, order. | |
cursor | string | Opaque cursor from the previous page; pass it back unchanged. Also accepted as continuationToken, continuation_token, next_max_id, max_id, max_cursor, min_time, after, page_token, pageToken, paginationToken, next_page_id, page. |
Every request also accepts trim, raw and max_age_days.
Response
Sample from a recorded response, shortened. Values are public data, not yours.
{
"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...",
"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": "Eg0SC2RRdzR3OVdnWGNRGAYyuAEKfGdldF9uZXdlc3RfZmlyc3QtLUNnZ0lnQVFWRjdmUk9CSUZDS2dnR0FBU0JRaUhJQmdBRWdVSWlTQVlBQklGQ0owZ0dBRVNCUWlJSUJnQUVnVUluaUFZQUJJRkNNZ2dHQ...",
"has_more": true,
"parent": null
},
"cursor": "Eg0SC2RRdzR3OVdnWGNRGAYyuAEKfGdldF9uZXdlc3RfZmlyc3QtLUNnZ0lnQVFWRjdmUk9CSUZDS2dnR0FBU0JRaUhJQmdBRWdVSWlTQVlBQklGQ0owZ0dBRVNCUWlJSUJnQUVnVUluaUFZQUJJRkNNZ2dHQ...",
"has_more": true
}Fields
A page of results. Each entry in items is a Comment. cursor and has_more page through the rest.
A field the platform does not give is null, never made up. Extra platform details are in extra.
| Field | Type | Always | Notes |
|---|---|---|---|
object | "comment" | ||
platform | Platform | yes | |
id | string | yes | |
url | string or null | ||
post_id | string or null | ||
parent_id | string or null | set on replies | |
author | Author or null | ||
text | string or null | ||
published_at | string (ISO 8601 date-time) or null | ||
stats | CommentStats | ||
is_pinned | boolean or null | ||
is_by_creator | boolean or null | ||
extra | object or null |
Full field list in the reference for this endpoint and the data models. Errors are listed under Errors.
Questions
Which errors can it return?
invalid_params (do not retry), unsupported_url (do not retry), not_found (do not retry). Account and platform errors from the errors list can also happen. A failure always costs 0 credits.
How do I get more than one page?
Send the same request with cursor set to the cursor you received, until has_more is false. Each page costs its own price. See pagination.
Is there an SDK call for it?
The preview Python client has client.youtube.video_comments(...) and the TypeScript client client.youtube.videoComments(). Both return the same envelope as the HTTP API. The packages are not published yet; plain HTTP works today in any language.
Can an AI agent call it?
Yes. The MCP server reaches every built endpoint, with the same prices.