Hacker News API: Get discussion
Gets a Hacker News story and its comments in the order shown on the site. The story can be given as a discussion link or as words from its title. Deleted and flagged comments are left out.
Unofficial. Not affiliated with or endorsed by Hacker News.
Inputs
Values from the run on Oct 23, 2026, shown under Output.
- Story, required
story Hacker News discussion link or words from the story title, for example https://news.ycombinator.com/item?id=8863 or Ask HN: What are you working on?
https://news.ycombinator.com/item?id=8863
- Max Comments optional
max_comments Maximum comments to return, for example 100 (at most 500).
10
Whole number from 0 to 500. Default
100.
Input as JSON
{ "story": "https://news.ycombinator.com/item?id=8863" , "max_comments": 10}Output
{ "title": "My YC app: Dropbox - Throw away your USB drive", "author": "dhouston", "points": 104, "item_id": 8863, "comments": [ { "link": "https://news.ycombinator.com/item?id=9224" , "text": "I have a few qualms with this app:\n1. For a Linux user, you can already build such a system yourself quite trivially by getting an FTP account, mounting it locally with curlftpfs, and then using SVN or CVS on the mounted filesystem. From Windows or Mac, this FTP account could be accessed through bui…", "depth": 0, "author": "BrandonM", "item_id": 9224, "parent_id": 8863, "posted_at": "2007-04-05T15:16:54Z", "direct_replies": 1 }, { "link": "https://news.ycombinator.com/item?id=9272" , "text": "1. re: the first part, many people want something plug and play. and even if they were plug and play, the problem is that the user experience (on windows at least) with online drives generally sucks, and you don't have disconnected access.\nwindows for sure doesn't hide latency well (CIFS is bad, web…", "depth": 1, "author": "dhouston", "item_id": 9272, "parent_id": 9224, "posted_at": "2007-04-05T16:47:01Z", "direct_replies": 1 }, { "link": "https://news.ycombinator.com/item?id=9479" , "text": "You are correct that this presents a very good, easy-to-install piece of functionality for Windows users. The Windows shortcomings that you point out are certainly problems, and I think that your software does a good job of overcoming that.\nThe part about efficient background sync is a good point, t…", "depth": 2, "author": "BrandonM", "item_id": 9479, "parent_id": 9272, "posted_at": "2007-04-06T01:39:04Z", "direct_replies": 0 } ], "posted_at": "2007-04-04T19:16:40Z", "story_text": null, "website_link": "http://www.getdropbox.com/u/2/screencast.html" , "comment_count": 71, "discussion_link": "https://news.ycombinator.com/item?id=8863" }Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"news.ycombinator.com/get_discussion","input":{"story":"https://news.ycombinator.com/item?id=8863","max_comments":10}}' # 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": "news.ycombinator.com/get_discussion" , "input": { "story": "https://news.ycombinator.com/item?id=8863" , "max_comments": 10 }})# 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": "news.ycombinator.com/get_discussion" , "input": { "story": "https://news.ycombinator.com/item?id=8863" , "max_comments": 10 } }), 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 news.ycombinator.com/get_discussion# with {"story":"https://news.ycombinator.com/item?id=8863","max_comments":10}"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": [ "story" ], "properties": { "story": { "type": "string", "minLength": 1, "description": "Hacker News discussion link or words from the story title, for example https://news.ycombinator.com/item?id=8863 or Ask HN: What are you working on?" }, "max_comments": { "type": "integer", "default": 100, "maximum": 500, "minimum": 0, "description": "Maximum comments to return, for example 100 (at most 500)." } }}Output schema
{ "type": "object", "required": [ "title", "website_link", "author", "points", "comment_count", "posted_at", "story_text", "discussion_link", "item_id", "comments" ], "properties": { "title": { "type": "string" }, "author": { "type": [ "string", "null" ] }, "points": { "type": [ "integer", "null" ] }, "item_id": { "type": "integer" }, "comments": { "type": "array", "items": { "type": "object", "properties": { "link": { "type": "string" }, "text": { "type": "string" }, "depth": { "type": "integer" }, "author": { "type": [ "string", "null" ] }, "item_id": { "type": "integer" }, "parent_id": { "type": "integer" }, "posted_at": { "type": [ "string", "null" ] }, "direct_replies": { "type": "integer" } } } }, "posted_at": { "type": [ "string", "null" ] }, "story_text": { "type": [ "string", "null" ] }, "website_link": { "type": [ "string", "null" ] }, "comment_count": { "type": "integer" }, "discussion_link": { "type": "string" } }}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
news.ycombinator.com/get_discussion- Returns
- title, link, author, points, comment count, story text, comments with depth, replies and parent
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 news.ycombinator.com/get_discussion with the inputs above.
Ask your agent
- Pull up the Hacker News thread for https://news.ycombinator.com/item?id=8863 with its comments in display order, capped at 50
- Get the full discussion for the HN story titled 'Ask HN: What are you working on?' including comment depth and parent info
- I need the comments on the Hacker News post about Show HN side projects, limited to the first 200, with author and points
- Fetch the ycombinator story matching 'Why Rust is taking over systems programming' and list its comments with reply structure
- Can you grab the Hacker News discussion linked at news.ycombinator.com/item?id=1 and return the top 100 comments without deleted or flagged ones
See more
All Hacker News methodsSearches 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_storiesLists current Hacker News stories in rank order from the top, newest, best, Ask HN, Show HN or jobs list.
news.ycombinator.com/list_front_pageLists top-level job posts from a monthly Ask HN: Who is hiring? thread in thread order, with post text and the company, roles, location, work arrangement, salary and application contact inferred from each post.
news.ycombinator.com/list_hiring_postsSearches the Y Combinator company directory by keyword, industry, batch, location, hiring and status, returning companies in directory order.
ycombinator.com/search_companiesLooks up a Y Combinator company by name or YC company page link and returns its profile, founders, social links and open job count.
ycombinator.com/get_companyLists current New York Times headlines with summaries, authors, images and publication times, in the order shown on the chosen section page (top stories or a section). Video-only items, ads and promotions are left out; times come from the section's feed and may be missing.
nytimes.com/list_headlinesLists the latest TechCrunch story headlines in a section, in page order. Skips video, podcast and event promotion cards.
techcrunch.com/list_headlinesReads a public TechCrunch article by link or headline and returns its text, authors, dates, section, tags and image. Live blogs return their latest public updates.
techcrunch.com/read_article