Hn Get Thread
hn_get_threadGet an item and its comment tree as a threaded discussion, with child comments resolved recursively. Use depth 0 for an item-only lookup.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| depth | No | How many levels of replies to resolve. 0 = just the item, no comments. 1 = direct replies only. Popular stories often have more top-level comments than maxComments — to see nesting, raise maxComments together with depth, or call again with a specific comment's itemId to drill into a subtree. | |
| itemId | Yes | ID of the story, comment, or poll to fetch the thread for. | |
| maxComments | No | Maximum total comments to include across all depth levels. Highest-ranked top-level comments resolve first; replies fill in only after the level above is exhausted. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cap | No | The maxComments cap that was applied. | |
| item | No | The root item (story, comment, or poll). | |
| error | No | Present when the call failed. Absent on success. | |
| shown | No | Number of comments returned. | |
| notice | No | Truncation context: counts of deleted/dead comments dropped during traversal, or pagination hint when totalLoaded < totalAvailable. Absent when no comments were dropped and all available comments were loaded. | |
| comments | No | Flat comment list ordered breadth-first by rank: highest-ranked top-level comments first, then their replies. Use depth/parentId to reconstruct nesting. | |
| truncated | No | True when the comment list was capped by maxComments. | |
| totalLoaded | No | Number of comments actually fetched and included. | |
| totalAvailable | No | Total comment count from the root item. If totalLoaded < totalAvailable, raise maxComments (and depth, if you want nested replies) and call again. |