How to Download All Comments From a Hacker News Thread
To download every comment in a Hacker News thread, fetch https://hn.algolia.com/api/v1/items/<id>, which returns the whole comment tree as nested JSON in one request, then flatten it to CSV with each comment's depth and parent; without code, paste the thread link into InsightSocial's free Hacker News Thread Exporter for a CSV, or export it from the thread page with the InsightSocial Chrome extension, which falls back to HN's official Firebase API when Algolia's tree is incomplete and exports to CSV, Excel, JSON or Google Sheets. In our own runs in October 2026, a 71-comment thread took 6 seconds and a 2,484-comment thread took 2 minutes 22 seconds.
TL;DR
| Method | Output | Cost | Skill |
|---|---|---|---|
Algolia HN API (/api/v1/items/<id>) | Full nested tree as JSON, one request | Free, no key | A short script |
Official HN Firebase API (/v0/item/<id>.json) | One item per request, follow kids | Free, no key | A script |
| InsightSocial's free HN Thread Exporter (web page) | Every comment as rows, CSV download | Free, no login | None |
| Simon Willison's "Hacker News thread export" | The thread as plain text to copy | Free | None |
| Chrome extension (InsightSocial) | Rows with depth, parent, links | Free up to 500 rows/month | None |
Can you export Hacker News comments directly?
There is no export button on news.ycombinator.com, and the page itself collapses long threads behind "more" links, so copying the page misses replies. But Hacker News is one of the most open sites on the web: two public APIs serve every story and comment, without a key.
- The official API is a Firebase database (
hacker-news.firebaseio.com/v0/), documented in the HackerNews/API repository on GitHub. Each item (a story or a comment) is one JSON object with akidslist of its replies' ids, so a thread of 2,000 comments is 2,000 requests. - The Algolia HN Search API (
hn.algolia.com/api) returns a whole thread as one nested object from/api/v1/items/<id>. It is the fast route, and the one most scripts use.
What an HN comment export includes
- Comment id and permalink
- Parent id and depth (0 for a top-level comment, 1 for a reply, and so on), so you can rebuild the tree in a spreadsheet
- Author username
- Text, with HTML converted to plain text
- Links written inside the comment, ideally in their own column
- Posted time
- The story's title, URL, points and comment count
There is no score column: Hacker News keeps comment points private, so no tool can export them.
What the rows look like
Illustrative rows: the shape of an export, with made-up names and text, not real reviewers.
| id | parent_id | depth | author | posted | text | links |
|---|---|---|---|---|---|---|
| 1001 | 1000 | 0 | user_a | 2026-10-02 14:03 | We switched to SQLite for this last year and never looked back. | |
| 1004 | 1001 | 1 | user_b | 2026-10-02 14:20 | How did you handle concurrent writes? | |
| 1009 | 1004 | 2 | user_a | 2026-10-02 14:41 | WAL mode, and one writer process. Write-up here: | https://example.com/post |
| 1002 | 1000 | 0 | user_c | 2026-10-02 14:05 | The benchmark in the article is single-threaded. |
parent_id 1000 is the story itself, so depth-0 rows are top-level comments.
Method 1: The Algolia API and a short Python script
Take the number after item?id= in the thread's URL:
import csv, html, re, sys, requests
ITEM_ID = sys.argv[1] if len(sys.argv) > 1 else "8863" # the number after item?id=
tree = requests.get(f"https://hn.algolia.com/api/v1/items/{ITEM_ID}", timeout=30).json()
def plain(text):
text = re.sub(r"<p>", "\n\n", text or "")
return html.unescape(re.sub(r"<[^>]+>", "", text)).strip()
rows = []
def walk(node, depth):
for child in node.get("children", []):
if child.get("type") == "comment" and child.get("author"):
rows.append({"id": child["id"], "parent_id": child["parent_id"], "depth": depth,
"author": child["author"], "created_at": child["created_at"],
"text": plain(child.get("text"))})
walk(child, depth + 1)
walk(tree, 0)
with open(f"hn_{ITEM_ID}.csv", "w", newline="", encoding="utf-8-sig") as f:
writer = csv.DictWriter(f, fieldnames=["id", "parent_id", "depth", "author", "created_at", "text"])
writer.writeheader()
writer.writerows(rows)
print(len(rows), "comments")
Run python hn.py 8863 and you get hn_8863.csv, one row per comment. Deleted comments have no author and are skipped; their replies are kept, with a parent_id that points at the deleted comment.
One catch: Algolia's tree can leave out some comments, notably replies under flagged or dead comments. Compare len(rows) with the story's descendants count from https://hacker-news.firebaseio.com/v0/item/<id>.json. If it is short, walk the missing branches through the Firebase API item by item.
Method 2: Copy the thread as text
Simon Willison's Hacker News thread export takes a post id or URL and formats the whole thread as plain text you can copy, which is ideal for pasting into an LLM and asking it to summarise the discussion. It is not a spreadsheet: there are no columns to sort or filter.
Only need one thread? Paste its link into the free Hacker News Thread Exporter, nothing to install
For a spreadsheet without code, InsightSocial's free Hacker News Thread Exporter takes the thread link and downloads every comment as a CSV, with depth and parent, in your browser and without signing up. It reads Algolia's tree, so it shares Algolia's gaps described above.
Method 3: A Chrome extension, no code
With InsightSocial's Hacker News Comment Scraper:
- Install InsightSocial and sign in with Google.
- Open the thread: any
news.ycombinator.com/item?id=…page, a story, an Ask HN, a Show HN, or a single comment opened as its own page. No Hacker News account is needed. - Allow Hacker News once when Chrome asks.
- Click Scrape. The extension reads the tree from Algolia, and when Algolia's count falls short of the story's, walks it item by item through the Firebase API, so replies hidden behind "more" and replies under flagged comments are included. It keeps running in a background tab.
- Export to CSV, Excel, JSON or Google Sheets.
Speed: 71 comments in 6 seconds and 2,484 in 2 minutes 22 seconds in our October 2026 runs. A run stops walking item by item after about 2.5 minutes and fills the rest from Algolia, which covers roughly 6,000 comments; the panel says so when that happens.
What it costs: scraping is free; exporting uses one credit per row. The free plan's 500 rows a month covers most threads; Pro is $9.99 a month for 10,000. Re-exporting a row you already exported is free.
What to do with an HN thread in a spreadsheet
- Collect every tool a thread recommends. Filter the Links column, then count domains. "What do you use for X?" threads become a ranked list in a minute.
- Read only the top level. Filter depth = 0 to see the distinct opinions before the arguments.
- Find the debates. Sort parents by how many replies point to them.
- Launch feedback. For a Show HN, filter to comments that are not yours and tag them as bug, feature request or praise.
Troubleshooting
Fewer comments than the thread says. The count on HN includes deleted and dead comments. Algolia can also miss replies under flagged comments; compare with the Firebase descendants count.
HTML in the text. HN stores comment text as HTML (<p>, <a>, '). Strip tags and unescape entities, as the script does.
Very large threads. Algolia returns the whole tree in one response, which can be several megabytes. That is fine for a script; in a browser, give it a few seconds.
FAQ
Is there an API for Hacker News comments?
Yes, two, both free and without a key: the official Firebase API (one item per request) and the Algolia HN Search API, whose /api/v1/items/<id> returns a whole thread nested.
How do I export Hacker News comments to CSV without coding? Paste the thread link into InsightSocial's free Hacker News Thread Exporter for a CSV, no login needed. Or use the InsightSocial browser extension: open the thread and click Scrape. Both keep depth and parent as columns.
Does it include replies hidden behind "more"? Yes. The APIs return the whole tree regardless of what the page has expanded.
Can I get comment scores? No. Hacker News does not publish comment points, so no tool can export them.
Do I need a Hacker News account? No. Threads are public.
Can I export all comments by one Hacker News user?
Not with InsightSocial, which reads a thread. The Algolia search API can list a user's comments with search_by_date?tags=comment,author_<username>.
Related: how to export Quora answers to a spreadsheet, how to export Product Hunt reviews and comments, and all review and comment scrapers.