Call it
curl https://api.peume.com/v1/call/list-comments-on-a-youtube-video-by-video-id \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"part": "snippet,replies",
"videoId": "dQw4w9WgXcQ",
"order": "relevance",
"maxResults": 20,
"textFormat": "plainText"
}
}'const res = await fetch("https://api.peume.com/v1/call/list-comments-on-a-youtube-video-by-video-id", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"part": "snippet,replies",
"videoId": "dQw4w9WgXcQ",
"order": "relevance",
"maxResults": 20,
"textFormat": "plainText"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/list-comments-on-a-youtube-video-by-video-id",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"part": "snippet,replies",
"videoId": "dQw4w9WgXcQ",
"order": "relevance",
"maxResults": 20,
"textFormat": "plainText"
}
},
)
print(res.json()["output"])Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: list-comments-on-a-youtube-video-by-video-id.
Parameters
partRequiredstringExample: snippet,replies
videoIdRequiredstringExample: dQw4w9WgXcQ
orderstringtime (default) | relevance
Example: relevance
maxResultsinteger1–100, default 20
Example: 20
pageTokenstringtextFormatstringhtml (default) | plainText
Example: plainText
Other ways to do it
Same job, other sources, cheapest first.
List a video's commentsBest sourceList a video's comments. Checks the cheapest source first and moves to the next one until it finds an answer.Comments of a YouTube videoList the top-level comments of one public YouTube video, in top-comments order, with text, author, likes and reply count.YouTube video comments by video idComments on a YouTube videoYouTube video comments by URL — replies, likes, authorsFetches comments and replies from a YouTube video, including each comment's text, author details, like count, reply count, and publish date.YouTube video comments by video idRetrieve first-level comments for a YouTube video with sorting, locale options, and cursor pagination.
