How to list Hacker News story comments by ID
Get a Hacker News story's comments as clean JSON with author, text, timestamp, parent, and permalink fields
On this page
You have five Hacker News launch threads and their story IDs, and you need the comment text, authors and timestamps from each thread before drafting a response. Run each story id through anyapi.hackernews.story_comments and collect the returned comment objects into one worksheet. No run has been executed for this guide; the tables below are designs, not results
The worksheet is the deliverable: one row per comment, with the story id kept alongside the comment fields so five threads can be reviewed together. The decision you are supporting is simple: which objections recur in the discussions before you write an answer
Example input and worksheet design
Example input, with an invented placeholder story id:
| Story slot | Story id |
|---|---|
| 1 | 48123657 |
| 2 | (replace with your second story id) |
| 3 | (replace with your third story id) |
| 4 | (replace with your fourth story id) |
| 5 | (replace with your fifth story id) |
The first row is an example value; the other four rows show where your remaining story ids go. Replace them with real Hacker News story ids before running. The tool takes one story id per call, so five threads need five calls
The output worksheet uses these columns. Values here are placeholders showing the shape:
| Story id | id | parentId | author | createdUtc | text | permalink | postId |
|---|---|---|---|---|---|---|---|
| (input id) | (comment id) | (parent id) | (username) | (epoch seconds) | (comment body) | (news.ycombinator.com link) | (story id) |
Keep the story id in a separate column if you combine five result sets, or use postId to tie each comment back to its story. The id column is the Hacker News comment id, not the input story id. A single story can return many rows, so the five-thread worksheet may be longer than five rows
The input the tool takes
anyapi.hackernews.story_comments takes id, a Hacker News story id as a string, such as "47340079". The catalog lists the tool as called through POST /v1/runs with toolId anyapi.hackernews.story_comments. Call it once per story id
If the provided story id does not resolve, the call returns found false with reason set to not_found and data null. That is a successful call rather than an error, so a missing story does not stop the five-thread batch. Record the id and move to the next story
How to read the output fields
The response has found, data and, when needed, reason. When found is true, data.comments holds the comment objects
Use the fields that drive the review:
id: comment id for de-duplicationparentId: id of the parent item, useful for separating top-level comments from repliesauthor: commenting usernamecreatedUtc: UTC epoch timestamp in seconds; multiply by 1000 for a JS Date in millisecondstext: comment body textpermalink: permalink to the item on news.ycombinator.compostId: Hacker News item ID of the story the comment belongs to
Sort by createdUtc to read each thread in time order. Compare parentId with postId to separate comments whose parent is the story from replies whose parent is another comment. Group by parentId to see reply chains. Read text for the objections that recur across the five launch threads, and use permalink when you need to open the source comment. When found is false, record reason as not_found and leave the comment fields empty
The review table can also carry a short objection label that you assign after reading text, for example a tag such as pricing, onboarding or documentation. That label is your analysis layer; the contract supplies the comment fields, not the label
The agent prompt
Set up https://purrkey.app/SKILL.md, then use Purrkey to list the comments on five Hacker News stories. Check the current inputs and price of anyapi.hackernews.story_comments before running anything. Call it once per story id in the list below. Return one table with story id, id, parentId, author, createdUtc, text, permalink and postId. Sort the table by story id and then createdUtc. If a story id does not resolve, keep a row with found false and reason not_found, and do not invent comments. Do not summarize the comments; return the rows as returned.
Example story id: 48123657
Add your other four story ids here before running.Replace the example id and add the remaining four story ids. Keep the first run to five calls so the worksheet stays easy to check. The prompt asks for the comment fields and a found row for a missing story; it does not ask the agent to judge whether a comment is correct
Estimated tool cost
Prices from the Purrkey catalog, read November 13, 2026. The tool is listed at up to $0.0036 per max_call: Maximum per call. Successful runs settle at the actual AnyAPI charge. The totals below are ceilings, not settled charges
| Step | Formula | Unit price | Planned quantity | Total |
|---|---|---|---|---|
| List one story's comments | calls x max price | $0.0036 per call | 1 | $0.0036 |
| List five stories' comments | calls x max price | $0.0036 per call | 5 | $0.018 |
| Five-story plan | $0.018 |
The five-story plan covers one call per story id. A story that returns found false is still a successful call, so the five-call total stays at $0.018 for five attempted ids. If you add a sixth id, the plan adds one more call at up to $0.0036. Model fees for the agent are not counted
Next action
Open Hacker News story comments to check the current input and price before the first run
Get started by giving this to your agent
- Claude Code
- Codex
- Gemini CLI
- Cursor
- GitHub Copilot
Set up https://purrkey.app/SKILL.md, then use Purrkey to show me what I can do with Hacker News.FAQ
How do I list Hacker News story comments by ID?
Call anyapi.hackernews.story_comments once per story id with the id field, then collect the returned data.comments objects into a worksheet. The output fields include id, parentId, author, createdUtc, text, permalink and postId.
What input does anyapi.hackernews.story_comments take?
It takes id, a Hacker News story id as a string, such as 47340079. Agents call it through `POST /v1/runs` with toolId `anyapi.hackernews.story_comments`.
What happens if the Hacker News story id does not resolve?
The call returns found false with reason set to not_found and data null. That is a successful call rather than an error.
What does createdUtc mean in the story comments output?
createdUtc is a UTC epoch timestamp in seconds. Multiply by 1000 for a JS Date in milliseconds.
How much does it cost to list comments on five Hacker News stories?
The five-call plan is at most $0.018, because the listed price is up to $0.0036 per call. A story that returns found false is still a successful call.
Can I use the example story id 48123657 for a real run?
The story id in the guide is an invented placeholder. Replace it with a real Hacker News story id before running.
What fields should I keep in the comment worksheet?
Keep id, parentId, author, createdUtc, text, permalink and postId, plus the input story id if you combine five result sets. The id column is the comment id, not the input story id.
Next step
Try this with Hacker News
The tool directory lists every endpoint with its current price. Inspect the inputs there, then let your agent run a small batch before scaling up.