videoIdstringआवश्यक
The unique identifier for a YouTube video.
https://api.sandbase.ai/v1/api/youtube/video-commentGet first-level comments for a YouTube video with sorting, locale options, and cursor pagination. Use it to review audience discussion or continue through additional comment pages.
आपका आउटपुट यहाँ दिखाई देगा
इनपुट पूरा करें, फिर Run पर क्लिक करें।
This API returns first-level comments for a YouTube video. It needs a videoId and returns one page of comments plus a token for the next page.
curl -X POST "https://api.sandbase.ai/v1/api/youtube/video-comment" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"videoId": "dQw4w9WgXcQ"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
videoId | string | Yes | The unique identifier for a YouTube video. |
countryCode | string | No | Region code for response data. |
cursor | string | No | Pagination cursor returned by the previous response. |
languageCode | string | No | Language preference for response data. |
sortBy | string | No | Sort order for the comment list. |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"comments": [
{
"author": {
"avatar_thumbnails": null,
"avatar_url": "https://yt3.ggpht.com/-E_1_UKaW4IjUqAmk6N7s3qr_8PbKnu9qRPFXo6z2ifCAllcNGgSges4D6…",
"channel_id": "UC5KHEnpHIDdKl6ALNpA9dNQ",
"channel_url": "https://www.youtube.com/@bitkoinaz",
"display_name": "@bitkoinaz",
"is_artist": false,
"is_creator": false,
"is_verified": false
},
"comment_id": "Ugw9M0L8J6DB47hdd9h4AaABAg",
"content": "о боже какая песня. ее нашел для меня ИИ бот когда я попросил его скачать какую …",
"creator_thumbnail_url": null,
"like_count": "0",
"like_count_a11y": "0 次赞",
"published_time": "22分钟前",
"reply_count": "0",
"reply_count_a11y": "0 条回复",
"reply_level": 0
}
],
"continuation_token": "Eg0SC2RR…"
}
| Field | Meaning |
|---|---|
comments[] | List of first-level comments on the requested page. |
comments[].comment_id | Unique ID of the comment. |
comments[].content | Text of the comment. |
comments[].author.display_name / comments[].author.channel_url | Handle and channel link of the commenter. |
comments[].author.channel_id | YouTube channel ID of the commenter. |
comments[].author.is_verified / comments[].author.is_creator / comments[].author.is_artist | Boolean flags for the commenter. They show whether the author is verified, is the video creator, or is an artist. |
comments[].like_count / comments[].reply_count | Number of likes and replies on the comment. Both values are strings. |
comments[].published_time | Relative publish time as display text, for example 22分钟前. It is not a timestamp. |
comments[].reply_continuation_token | Token that appears only on comments that have replies. Use it to load the reply thread. |
continuation_token | Token for the next page of comments. Send it as cursor in the next request. |
videoId is the value after v= in a YouTube watch URL, for example dQw4w9WgXcQ.continuation_token from the response as cursor. Keep the same sortBy value (top or newest).published_time and like_count_a11y follows the language settings, and the sample shows Chinese strings. Use languageCode and countryCode to change them.reply_continuation_token.$0.014286 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
बिल्डिंग शुरू करें
एकीकृत authentication और usage tracking के साथ Platform API endpoint.
curl -X POST "https://api.sandbase.ai/v1/api/youtube/video-comment" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sortBy": "newest",
"videoId": "dQw4w9WgXcQ",
"countryCode": "US",
"languageCode": "zh-CN"
}'अपने SandBase API key को अपने सर्वर environment में सेट करें। Requests Bearer authentication का उपयोग करती हैं।
export SANDBASE_API_KEY="YOUR_API_KEY"अपना key सर्वर पर रखें। इसे browser code में expose न करें।
videoIdstringआवश्यकThe unique identifier for a YouTube video.
cursorstringPagination cursor returned by the previous response.
languageCodestringLanguage preference for response data.
डिफ़ॉल्ट: "zh-CN"
countryCodestringRegion code for response data.
डिफ़ॉल्ट: "US"
sortBystringSort order for the comment list.
डिफ़ॉल्ट: "newest"
संभावित मान: top, newest
इस API के लिए सेव किया गया example response; इसे देखते समय कोई live request नहीं की जाती।
कोई सेव response प्रकाशित नहीं किया गया है। इसका response देखने के लिए Playground में API चलाएँ।
और जानें
| API | कीमत | प्रतिक्रिया |
|---|---|---|
YouTube | $0.014286 प्रति कॉल | JSON |
YouTube | $0.00045 प्रति कॉल से | JSON |
YouTube | $0.0012 प्रति कॉल से | JSON |
YouTube | $0.0012 प्रति कॉल से | JSON |
YouTube | $0.0012 प्रति कॉल से | JSON |
YouTube | $0.014286 प्रति कॉल | JSON |
प्रश्न
https://api.sandbase.ai/v1/api/youtube/video-comment पर Authorization header (Bearer) में अपनी SandBase API key और parameters को JSON body के रूप में भेजें। आप इस पेज के Playground में बिना code लिखे भी इसे आज़मा सकते हैं।
$0.014286 प्रति call, आपकी SandBase balance से बिल किया जाएगा। आपसे केवल आपके किए गए calls के लिए शुल्क लिया जाता है; कोई subscription नहीं है।
आवश्यक: videoId (string)। वैकल्पिक: cursor (string), languageCode (string), countryCode (string) और sortBy (top, newest में से एक)। Parameters table और इस पेज का Playground हर field सूचीबद्ध करते हैं।
एक JSON response जो उसी HTTP request में लौटाया जाता है (synchronous)। इस पेज का README एक sample response शामिल करता है।
नहीं। YouTube Video Comment List SandBase के माध्यम से चलता है, इसलिए एक SandBase API key इस endpoint और catalog के हर अन्य API और model को कवर करती है। आपको अलग से YouTube API access के लिए आवेदन करने की आवश्यकता नहीं है।