List YouTube video comments
curl --request POST \
--url https://app.dumplingai.com/api/v1/youtube/video/comments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"continuationToken": "<string>",
"order": "top"
}
'import requests
url = "https://app.dumplingai.com/api/v1/youtube/video/comments"
payload = {
"url": "<string>",
"continuationToken": "<string>",
"order": "top"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', continuationToken: '<string>', order: 'top'})
};
fetch('https://app.dumplingai.com/api/v1/youtube/video/comments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.dumplingai.com/api/v1/youtube/video/comments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => '<string>',
'continuationToken' => '<string>',
'order' => 'top'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.dumplingai.com/api/v1/youtube/video/comments"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"continuationToken\": \"<string>\",\n \"order\": \"top\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.dumplingai.com/api/v1/youtube/video/comments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"continuationToken\": \"<string>\",\n \"order\": \"top\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.dumplingai.com/api/v1/youtube/video/comments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"continuationToken\": \"<string>\",\n \"order\": \"top\"\n}"
response = http.request(request)
puts response.read_body{
"comments": [
{
"id": "<string>",
"content": "<string>",
"publishedTimeText": "<string>",
"publishedTime": "2023-11-07T05:31:56Z",
"replyLevel": 1,
"author": {
"name": "<string>",
"channelId": "<string>",
"isVerified": true,
"isCreator": true,
"avatarUrl": "<string>",
"channelUrl": "<string>"
},
"engagement": {
"likes": 123,
"replies": 123
}
}
],
"continuationToken": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Data APIs
Get YouTube Video Comments
Retrieve public comments for a video with pagination and sorting controls.
POST
/
api
/
v1
/
youtube
/
video
/
comments
List YouTube video comments
curl --request POST \
--url https://app.dumplingai.com/api/v1/youtube/video/comments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"continuationToken": "<string>",
"order": "top"
}
'import requests
url = "https://app.dumplingai.com/api/v1/youtube/video/comments"
payload = {
"url": "<string>",
"continuationToken": "<string>",
"order": "top"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', continuationToken: '<string>', order: 'top'})
};
fetch('https://app.dumplingai.com/api/v1/youtube/video/comments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.dumplingai.com/api/v1/youtube/video/comments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => '<string>',
'continuationToken' => '<string>',
'order' => 'top'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.dumplingai.com/api/v1/youtube/video/comments"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"continuationToken\": \"<string>\",\n \"order\": \"top\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.dumplingai.com/api/v1/youtube/video/comments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"continuationToken\": \"<string>\",\n \"order\": \"top\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.dumplingai.com/api/v1/youtube/video/comments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"continuationToken\": \"<string>\",\n \"order\": \"top\"\n}"
response = http.request(request)
puts response.read_body{
"comments": [
{
"id": "<string>",
"content": "<string>",
"publishedTimeText": "<string>",
"publishedTime": "2023-11-07T05:31:56Z",
"replyLevel": 1,
"author": {
"name": "<string>",
"channelId": "<string>",
"isVerified": true,
"isCreator": true,
"avatarUrl": "<string>",
"channelUrl": "<string>"
},
"engagement": {
"likes": 123,
"replies": 123
}
}
],
"continuationToken": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Description
This endpoint retrieves comments from a YouTube video with support for pagination and different sorting orders. Includes comment content, author information, engagement metrics, and timestamps.Endpoint
POST https://app.dumplingai.com/api/v1/youtube/video/comments
Headers
- Content-Type:
application/json - Authorization: Bearer
<API_KEY>(required)
Request Body
{
"url": "string", // Required. Full YouTube video URL
"continuationToken": "string", // Optional. Token for pagination from previous response
"order": "string" // Optional. Sort order: "top" or "newest". Default: "top"
}
Accepted Values for order
| Value | Description |
|---|---|
| top | Sort by most liked comments first |
| newest | Sort by most recently posted comments |
Responses
Success (200)
Returns an array of comments from the specified video with pagination support.{
"comments": [
{
"id": "Ugz1234567890abcdefghij",
"content": "This CSS tutorial is incredibly helpful! The flexbox examples at 8:45 finally made it click for me. Thank you! 🎉",
"publishedTimeText": "2 hours ago",
"publishedTime": "2024-01-15T14:30:00.000Z",
"replyLevel": 0,
"author": {
"name": "John Doe",
"channelId": "UCuserChannelId123",
"isVerified": true,
"isCreator": false,
"avatarUrl": "https://yt3.googleusercontent.com/ytc/AIdro_avatar_url",
"channelUrl": "https://www.youtube.com/channel/UCuserChannelId123"
},
"engagement": {
"likes": 1250,
"replies": 23
}
},
{
"id": "Ugz9876543210jihgfedcba",
"content": "Quick question: would you recommend using CSS Grid for the entire layout or just specific components? Great explanation btw!",
"publishedTimeText": "1 day ago",
"publishedTime": "2024-01-14T10:15:00.000Z",
"replyLevel": 0,
"author": {
"name": "Jane Smith",
"channelId": "UCanotherUserId456",
"isVerified": false,
"isCreator": false,
"avatarUrl": "https://yt3.googleusercontent.com/ytc/AIdro_another_avatar",
"channelUrl": "https://www.youtube.com/channel/UCanotherUserId456"
},
"engagement": {
"likes": 89,
"replies": 5
}
}
],
"continuationToken": "Eg0SC1UyN..."
}
- Content-Type: application/json
- X-RateLimit-Limit: The rate limit for the user
- X-RateLimit-Remaining: The remaining number of requests for the user
Bad Request (400)
Returned if the request is invalid or missing required parameters.{
"error": "'url' parameter is required and must be a non-empty string. Please provide a YouTube video URL."
}
Bad Gateway (502)
Returned if the external service is unavailable or returns invalid data.{
"error": "Failed to retrieve YouTube video comments"
}
Internal Server Error (500)
Returned if there’s an unexpected server error.{
"error": "An unexpected server error occurred while fetching YouTube video comments"
}
Example Request
curl -X POST https://app.dumplingai.com/api/v1/youtube/video/comments \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"order": "top"
}'
Example Response
{
"comments": [
{
"id": "Ugz1234567890abcdefghij",
"content": "This CSS tutorial is incredibly helpful! The flexbox examples at 8:45 finally made it click for me. Thank you! 🎉",
"publishedTimeText": "2 hours ago",
"publishedTime": "2024-01-15T14:30:00.000Z",
"replyLevel": 0,
"author": {
"name": "John Doe",
"channelId": "UCuserChannelId123",
"isVerified": true,
"isCreator": false,
"avatarUrl": "https://yt3.googleusercontent.com/ytc/AIdro_avatar_url",
"channelUrl": "https://www.youtube.com/channel/UCuserChannelId123"
},
"engagement": {
"likes": 1250,
"replies": 23
}
}
],
"continuationToken": "Eg0SC1UyN..."
}
Notes
- The
urlparameter must be a valid YouTube video URL - Comments are returned in the specified sort order (
topornewest) - The
continuationTokenfrom the response can be used to fetch additional comments replyLevelindicates the nesting level of the comment (0 = top-level comment)- Author information includes verification status and creator badges
- Engagement metrics show like count and reply count for each comment
- Some videos may have comments disabled, resulting in an empty comments array
- This endpoint uses 10 credits per request
Rate Limiting
Rate limit headers (X-RateLimit-Limit and X-RateLimit-Remaining) are included in the response to indicate the user’s current rate limit status.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Token to fetch the next page of comments.
Available options:
top, newest Optional identifier describing where the API request originated.
Available options:
API, WEB, MAKE_DOT_COM, ZAPIER, N8N, PLAYGROUND, DEFAULT_AUTOMATION, AGENT_PREVIEW, AGENT_LIVE, AUTOPILOT, STUDIO