Post Comments
A video's comments, top or newest first, about 20 a page.
GET
apiKeyheader
AuthorizationBearer <token>An API key from the dashboard: Authorization: Bearer sapi_….
url?stringThe video's link.
id?stringThe video's id, instead of url.
sort?stringtop (the default) or newest.
cursor?stringnextCursor of the previous page.
maxAge?integerHow old a cached answer may be, in seconds; 0 always fetches. Default and most: the endpoint's cache lifetime.
Format
int64Range
0 <= valueThe answer.
application/json- response
A page of a list, as every list endpoint answers: { "data": [...], "pagination": … }.
data*array<>pagination*import { SocialAPI } from "@socialapihq/sdk";const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });const { data, pagination } = await client.youtube.postComments({ url: "https://www.youtube.com/watch?v=Ip5EiqbuBpE", sort: "top" });Example Response
{ "data": [ { "id": "UgxIbl6u30EvRnvZ8W54AaABAg", "postId": "Ip5EiqbuBpE", "parentId": null, "text": "Buy the brand new Tech Sling and earphone pouch and get a $30 LTT Gift card!\n\nUS: https://www.lttstore.com/products/tech-sling-earphone-pouch-free-30-gift-card-bundle\nGlobal: https://global.lttstore.com/products/tech-sling-earphone-pouch-30-gift-card-bundle", "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": null, "avatarUrl": "https://yt3.ggpht.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s88-c-k-c0x00ffffff-no-rj", "verified": true, "url": "https://www.youtube.com/@LinusTechTips" }, "likes": 41, "replies": 1, "ext": { "publishedText": "1 day ago", "edited": false, "pinned": true, "byCreator": true, "repliesToken": "Eg0SC0lwNUVpcWJ1QnBFGAYygwEaUBIaVWd4SWJsNnUzMEV2Um52WjhXNTRBYUFCQWciAggAKhhVQ1h1cVNCbEhBRTZYdy15ZUpBMFR1bncyC0lwNUVpcWJ1QnBFQAFICoIBAggBQi9jb21tZW50LXJlcGxpZXMtaXRlbS1VZ3hJYmw2dTMwRXZSbnZaOFc1NEFhQUJBZw%3D%3D" } }, { "id": "UgxihacXvVekVWlT82V4AaABAg", "postId": "Ip5EiqbuBpE", "parentId": null, "text": "\"claude, add SteamOS to mac. make no mistakes\"", "createdAt": null, "author": { "id": "UCOAorxe7DJuiwVLll6zVtsA", "username": "Packolotl", "displayName": null, "avatarUrl": "https://yt3.ggpht.com/iLmno1yTVmN34ROM7E_X4E1tCo07DiM6C4YWi2D91Tl-QMJA8skQHmL31OFhCAV7OqGrKPZ1-5g=s88-c-k-c0x00ffffff-no-rj", "verified": false, "url": "https://www.youtube.com/@Packolotl" }, "likes": 6300, "replies": 42, "ext": { "publishedText": "1 day ago", "edited": false, "pinned": false, "byCreator": false, "repliesToken": "Eg0SC0lwNUVpcWJ1QnBFGAYygwEaUBIaVWd4aWhhY1h2VmVrVldsVDgyVjRBYUFCQWciAggAKhhVQ1h1cVNCbEhBRTZYdy15ZUpBMFR1bncyC0lwNUVpcWJ1QnBFQAFICoIBAggBQi9jb21tZW50LXJlcGxpZXMtaXRlbS1VZ3hpaGFjWHZWZWtWV2xUODJWNEFhQUJBZw%3D%3D" } } ], "pagination": { "nextCursor": "Eg0SC0lwNUVpcWJ1QnBFGAYygAMK1gJnZXRfcmFua2VkX3N0cmVhbXMtLUNxVUJDSUFFRlJlMzBUZ2FtZ0VLbFFFSTJGOFFnQVFZQnlLS0FadUtBdmtybkNaR1VNc2Iwcy1XS0lPYWtVQ25OTW1IYUk5NWdMMkZPS19WcmQzYzhHckhBcXc1RmlNakpVQTZWSXJnLVFKQ3RYcjlqcUJQeWxHeVVDcVRiVElxQWZvWTJ1UTkxQnR6Wkg0R0NlS2o1NVNDWU5nc3hSUXZKOWwyZXp6MXZnMWRJWXZmSGszdGpPaC1FX2VTZ0M2WE11SlE0bUxjUW1QTFd1MTRmLVB1VjBfMDdwT0MtQkFVRWdjSWhDQVFGQmdCRWdVSXdDQVlBQklGQ0lrZ0dBQVNC…", "hasMore": true }}