Hacker News Comments Scraper: full thread text by story, bulk
Pricing
from $0.33 / 1,000 comment listeds
Hacker News Comments Scraper: full thread text by story, bulk
All comments under Hacker News stories, up to 200 stories per run and up to 2,000 comments each, in thread order with depth and parent: plain text, time, reply count and comment link, plus the story's title, points and URL on every row, from the official Algolia API. No usernames. Pay per comment.
Pricing
from $0.33 / 1,000 comment listeds
Rating
0.0
(0)
Developer
Steadydata Team
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
a day ago
Last modified
Categories
Share
All comments under Hacker News stories, up to 200 stories per run and up to 2,000 comments each, in thread order with depth and parent: plain text, time, reply count and comment link, plus the story's title, points and URL on every row, from the official Algolia API. No usernames. Pay per comment.
Why this scraper
- Only delivered results are charged. Inputs that fail come back as clear error records at no cost.
- One call per story to the official Hacker News API on Algolia returns the whole comment tree at once. Measured on the platform: 121 comments of two stories in 17 seconds for a quarter of a cent; a 201-comment thread is a single 111 KB response.
- The thread structure survives. Every comment carries its position in reading order, its depth, its parent id, how many direct replies it has and how many comments sit below it in total, so you can rebuild the discussion, take only top-level comments or find the most-discussed branch. The story's title, link, points and total comment count are on every row.
- No usernames. Hacker News handles are people; they are dropped before anything is stored. What you get is what was said, when, and where in the thread.
Who this is for
Paste Hacker News item ids or item URLs in stories (up to 200 per run) and set maxCommentsPerStory (default 200, ceiling 2,000). order is thread (reading order: each top-level comment followed by its replies) or newest (flat, most recent first). Built for sentiment and argument mining on launches, incidents and Ask HN threads, for summarising discussions, and for tracking how a story's reception develops.
Who this is not for
There are no usernames, karma or profile links on purpose, so this is not a tool for finding or profiling commenters. Hacker News does not publish comment scores, so there is no points per comment; replyCount and descendantCount are the only signals of attention. Deleted and dead comments have no text and are skipped (measured: 3 of 24 in one thread), so storyCommentCount can be a little higher than the rows delivered. A comment id instead of a story id comes back as a free INVALID_STORY error naming the story id to use. Text is flattened to one line; links inside a comment keep their anchor text, not the URL.
Input fields
| Field | Type | Required or default | What it does |
|---|---|---|---|
stories | list of text | required | One per row, up to 200: a Hacker News item id (45148944) or an item URL (https://news.ycombinator.com/item?id=45148944). |
maxCommentsPerStory | number | 200 | Cost ceiling per story, in thread order (top comments first, replies directly under them). |
order | text (thread, newest) | thread | thread (as shown on Hacker News: top-level comments with their replies) or newest (most recent first, flat). |
Input example
{"stories": ["45148944","https://news.ycombinator.com/item?id=45148944"],"maxCommentsPerStory": 200,"order": "thread"}
Output example
| Field | Type | What it holds | Example |
|---|---|---|---|
storyId | text | The story this comment hangs under, the key to join all its comments on. | 49880411 |
storyTitle | text | The title of that story. | Phyllotaxis: An audio-reactive LED display |
storyUrl | text | The article the story points to; empty on a text post. | https://jagi.studio/posts/phyllotaxis/ |
storyPoints | number | How many points the story has, the measure of its reach. | 289 |
storyCommentCount | number | How many comments the story has in total. | 48 |
position | number | The place of the comment in the order that was read, counting from 1. | 1 |
commentId | text | The id of the comment, the key to its own page. | 49888287 |
parentId | text | The comment or story this one answers. | 49880411 |
depth | number | How deep the comment sits in the thread; 0 is a direct answer to the story. | 1 |
text | text | The comment text, without markup. | Very cool. 5-fold symmetry on the PCB to use up the board... |
createdAt | text | When the item was posted, in UTC. | 2026-09-29T04:28:31.000Z |
replyCount | number | How many direct answers the comment has. | 0 |
descendantCount | number | How many answers hang under it in total, deeper levels included. | 0 |
hnUrl | text | The item's own page on Hacker News. | https://news.ycombinator.com/item?id=49888287 |
Error codes: INVALID_STORY, NOT_FOUND, NO_COMMENTS, BLOCKED.
One delivered row looks like this:
{"storyId": "45148944","storyTitle": "We hacked Burger King: How auth bypass led to drive-thru audio surveillance","storyUrl": "https://bobdahacker.com/blog/rbi-hacked-drive-thrus/","storyPoints": 427,"storyCommentCount": 201,"position": 15,"commentId": "45149383","parentId": "45148944","depth": 1,"text": "Great write-up! I was sorry to see there wasn’t a reward for you reporting this to them. At least you didn’t find that the bathroom rating tablets had audio as well!","createdAt": "2025-09-06T14:08:16.000Z","replyCount": 1,"descendantCount": 6,"hnUrl": "https://news.ycombinator.com/item?id=45149383","status": "ok"}
Related actors from steadydata
- hacker-news-search: the stories themselves, to find threads worth reading
- rss-feed-reader: the same stories as a feed, without the discussion
- webpage-to-markdown: the article a thread is about, as clean text
Pricing
Pay per event: one comment-listed event per delivered result. No charge for inputs
that fail, no separate platform-usage surcharge.
Free Apify plan: this actor delivers up to 25 rows per run for accounts on the Apify free plan, and then stops with a message. That limit is set by us, not by Apify. It exists so the actor keeps paying for itself for the people who do pay. Any paid Apify plan runs it at full size, billed per delivered row, with failed rows never charged.
Reviews: if this actor saves you time, a short review on this page is the one thing that helps most. Ratings are what other buyers look at first, and we have no other way to ask.
FAQ
Is personal data collected? No. The commenter's username that the API returns with every comment is dropped before storage; nothing on a row identifies who wrote it.
How do I rebuild the thread?
Rows arrive in reading order. depth 1 is a top-level comment; a reply has depth one higher and parentId equal to the comment it answers. descendantCount tells you how big each branch is without reading it.
Can I get the newest comments only?
Set order to newest: the same rows, sorted by createdAt descending, with position renumbered. With maxCommentsPerStory set to 50 that is the last fifty comments of the thread.
What about stories with thousands of comments? The ceiling is 2,000 per story; the API returns the whole tree in one response, so even a large thread is one call. Above the ceiling you get the first 2,000 in reading order.
Does a run cost anything when a story has no comments?
No. NO_COMMENTS, NOT_FOUND, INVALID_STORY and BLOCKED rows are free; only delivered comments are charged.
What happens when the source changes? Sources change from time to time; that is the nature of this work. The actor is monitored daily and fixed fast, and while it is broken you are not charged, because only delivered results cost anything.