Disclosure: I built the Apify Actor linked at the end and charge per result. The raw endpoint below is free and needs no key.
Algolia's HN API has an items endpoint that returns a story plus its entire comment tree in a single request.
The request
curl -s "https://hn.algolia.com/api/v1/items/8863"
Item 8863 is the famous "My YC app: Dropbox" thread. Checked 2026-11-01: the response had title, points 104, and 72 nodes counting the story and every nested comment. Each node has author, text (HTML), created_at, parent_id, story_id and a children array.
Flatten it with jq
curl -s "https://hn.algolia.com/api/v1/items/8863" \
| jq -r '[.. | objects | select(.type=="comment")] | .[] | [.author, .created_at, (.text // "" | gsub("<[^>]*>";""))] | @tsv'
That gives one comment per line, ready for a spreadsheet or an LLM prompt.
Gotchas
-
textis HTML; strip tags or decode entities before analysis. - Deleted comments can have a null
textorauthor. - Very large threads are a big single response; fetch once and cache.
- The item id is the number at the end of
news.ycombinator.com/item?id=....
Hosted version
For many threads at once, with the tree flattened to one row per comment, I packaged this as an Apify Actor (thread mode; pay per event, no subscription): https://apify.com/northgrid-data/hacker-news-search-threads-hiring
Feedback welcome in the Actor's issues.
Top comments (0)