YouTube API: Get video comments
Gets public top-level comments on a YouTube video, found by link, video ID or title. Reply text is not included.
Unofficial. Not affiliated with or endorsed by YouTube.
Inputs
Values from the run on Oct 31, 2026, shown under Output.
- Sort optional
sort Comment order, for example newest.
top
One of
top,newest. Defaulttop.- Video, required
video Video link or title, for example https://www.youtube.com/watch?v=jNQXAC9IVRw.
https://www.youtube.com/watch?v=jNQXAC9IVRw
- Max Results optional
max_results Maximum number of top-level comments, for example 50.
500
Whole number from 1 to 500. Default
50.
Input as JSON
{ "sort": "top", "video": "https://www.youtube.com/watch?v=jNQXAC9IVRw" , "max_results": 500}Output
{ "comments": [ { "likes": 4800000, "pinned": "yes", "author_name": "@SanDiegoZoo", "posted_time": "6 years ago", "comment_link": "https://www.youtube.com/watch?v=jNQXAC9IVRw&lc=UgzuC3zzpRZkjc5Qzsd4AaABAg" , "comment_text": "We're so honored that the first ever YouTube video was filmed here!", "video_creator": "no", "number_of_replies": 986, "estimated_posted_date": "2020-10-31" }, { "likes": 12000, "pinned": "no", "author_name": "@JoaoGoofyAhh", "posted_time": "1 month ago", "comment_link": "https://www.youtube.com/watch?v=jNQXAC9IVRw&lc=Ugztdj9x7C3LKBY7ewR4AaABAg" , "comment_text": "Okay guys I'm on the 1st of September of 2026, and... Why YouTube?", "video_creator": "no", "number_of_replies": 385, "estimated_posted_date": "2026-09-30" }, { "likes": 213000, "pinned": "no", "author_name": "@TapL", "posted_time": "1 year ago", "comment_link": "https://www.youtube.com/watch?v=jNQXAC9IVRw&lc=UgwVNlctFgmvFU1PTuN4AaABAg" , "comment_text": "Seeing \"20 years ago\" on a YouTube video makes me feel a certain type of way", "video_creator": "no", "number_of_replies": 996, "estimated_posted_date": "2025-10-31" } ], "video_link": "https://www.youtube.com/watch?v=jNQXAC9IVRw" , "video_title": "Me at the zoo", "comments_turned_off": "no", "total_comment_count": 10000000}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"youtube.com/get_video_comments","input":{"sort":"top","video":"https://www.youtube.com/watch?v=jNQXAC9IVRw","max_results":500}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "youtube.com/get_video_comments" , "input": { "sort": "top", "video": "https://www.youtube.com/watch?v=jNQXAC9IVRw" , "max_results": 500 }})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "youtube.com/get_video_comments" , "input": { "sort": "top", "video": "https://www.youtube.com/watch?v=jNQXAC9IVRw" , "max_results": 500 } }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run youtube.com/get_video_comments# with {"sort":"top","video":"https://www.youtube.com/watch?v=jNQXAC9IVRw","max_results":500}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "type": "object", "required": [ "video" ], "properties": { "sort": { "enum": [ "top", "newest" ], "type": "string", "default": "top", "description": "Comment order, for example newest." }, "video": { "type": "string", "description": "Video link or title, for example https://www.youtube.com/watch?v=jNQXAC9IVRw." }, "max_results": { "type": "integer", "default": 50, "maximum": 500, "minimum": 1, "description": "Maximum number of top-level comments, for example 50." } }}Output schema
{ "type": "object", "required": [ "video_title", "video_link", "total_comment_count", "comments_turned_off", "comments" ], "properties": { "comments": { "type": "array", "items": { "type": "object", "properties": { "likes": { "type": "integer" }, "pinned": { "enum": [ "yes", "no" ], "type": "string" }, "author_name": { "type": [ "string", "null" ] }, "posted_time": { "type": "string" }, "comment_link": { "type": "string" }, "comment_text": { "type": "string" }, "video_creator": { "enum": [ "yes", "no" ], "type": "string" }, "number_of_replies": { "type": "integer" }, "estimated_posted_date": { "type": [ "string", "null" ] } } } }, "video_link": { "type": "string" }, "video_title": { "type": "string" }, "comments_turned_off": { "enum": [ "yes", "no" ], "type": "string" }, "total_comment_count": { "type": "integer" } }}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
youtube.com/get_video_comments- Returns
- video title, link, total comment count, comments with author, text, likes, posted time, replies, pinned and creator flags
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method youtube.com/get_video_comments with the inputs above.
Ask your agent
- Pull the top 30 comments on this video https://www.youtube.com/watch?v=dQw4w9WgXcQ and show who posted them and how many likes each got
- Get the newest 20 comments under the video titled "Me at the zoo"
- I need the total comment count and the first 100 comments, sorted by newest, for the YouTube video with ID 9bZkp7q19f0
- Show me the most-liked comments on my latest tutorial video, including whether the creator pinned any of them
- Fetch the top-level comments on https://www.youtube.com/watch?v=kJQP7kiw5Fk sorted by top, limit 75, with posted times
See more
All YouTube methodsGets public details and statistics for one YouTube video by link, ID or title. A title selects the top search match.
youtube.com/get_videoLists a YouTube channel's public videos, Shorts, or live uploads, newest first or most popular first, along with channel details. Counts and dates taken from displayed text may be approximate.
youtube.com/list_channel_videosLists the latest weekly YouTube Music Top Songs chart for a country or globally, with ranks, weekly views and video links.
youtube.com/list_top_songsReturns the spoken captions and timed segments of a YouTube video, given a video link or a title (top search match). Only captions the video has are returned.
youtube.com/get_video_transcriptFinds a company's verified YouTube channel by name and returns its name, link, subscriber count, description, country and official website when identifiable.
youtube.com/find_company_channelGets a public YouTube channel's profile, links and statistics from its name, @handle or link. Subscriber totals may be rounded as YouTube displays them.
youtube.com/get_channelGets a public Vimeo video's title, creator, play, like and comment counts, length, upload date, description, tags, thumbnail and link from its video link.
vimeo.com/get_videoSearches Hacker News stories or comments by words, date range and sort order. Comments include their parent story's website link when one exists; text-only stories have no website link.
news.ycombinator.com/search_stories