- Cost
- 1 credit
- Cached repeats
- 0 creditssend max_age_days, results kept 30 days
- Failed requests
- 0 credits
Page with cursor.
You send one of url or id.
Part of the YouTube Scraper API: 18 YouTube endpoints on one key.
Request
Send your key in the x-api-key header.
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'1import os2import requests34params = {5 "id": "dQw4w9WgXcQ",6 "sort": "latest",7}8res = requests.get(9 "https://api.socialscrape.dev/v1/youtube/video/comments",10 headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},11 params=params,12 timeout=60,13)14body = res.json()1516if body["ok"]:17 print(body["data"])18else:19 print(body["error"]["code"], body["error"]["message"])1const url = new URL("https://api.socialscrape.dev/v1/youtube/video/comments");2url.search = new URLSearchParams({3 id: "dQw4w9WgXcQ",4 sort: "latest",5}).toString();6const res = await fetch(url, {7 headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },8});9const body = await res.json();1011if (body.ok) {12 console.log(body.data);13} else {14 console.error(body.error.code, body.error.message);15}1{2 "nodes": [3 {4 "name": "SocialScrape YouTube video comments",5 "type": "n8n-nodes-base.httpRequest",6 "typeVersion": 4.2,7 "position": [8 0,9 010 ],11 "parameters": {12 "method": "GET",13 "url": "https://api.socialscrape.dev/v1/youtube/video/comments",14 "sendQuery": true,15 "queryParameters": {16 "parameters": [17 {18 "name": "id",19 "value": "dQw4w9WgXcQ"20 },21 {22 "name": "sort",23 "value": "latest"24 }25 ]26 },27 "sendHeaders": true,28 "headerParameters": {29 "parameters": [30 {31 "name": "x-api-key",32 "value": "={{ $env.SOCIALSCRAPE_API_KEY }}"33 }34 ]35 }36 }37 }38 ],39 "connections": {}40}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 examples, not your data.
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...",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": "Eg0SC2RRdzR3OVdnWGNRGAYyuAEKfGdldF9uZXdlc3RfZmlyc3QtLUNnZ0lnQVFWRjdmUk9CSUZDS2dnR0FBU0JRaUhJQmdBRWdVSWlTQVlBQklGQ0owZ0dBRVNCUWlJSUJnQUVnVUluaUFZQUJJRkNNZ2dHQ...",78 "has_more": true,79 "parent": null80 },81 "cursor": "Eg0SC2RRdzR3OVdnWGNRGAYyuAEKfGdldF9uZXdlc3RfZmlyc3QtLUNnZ0lnQVFWRjdmUk9CSUZDS2dnR0FBU0JRaUhJQmdBRWdVSWlTQVlBQklGQ0owZ0dBRVNCUWlJSUJnQUVnVUluaUFZQUJJRkNNZ2dHQ...",82 "has_more": true83}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 Python client has client.youtube.video_comments(...) and the TypeScript client client.youtube.videoComments(). Both return the same envelope as the HTTP API. Install them from PyPI (socialscrape-sdk) or npm (socialscrape); plain HTTP works in any language.
Can an AI agent call it?
Yes. The MCP server, which you run on your own machine, reaches every built endpoint, with the same prices.