Thread

Hacker News

Retrieve one public Hacker News item with a bounded nested comment tree and explicit truncation state.

Current price
$0.0050/call
Availability
Ready to run
Last accepted verification

What this API does

Retrieve a Hacker News story, job, poll or comment by exact numeric item ID or canonical item URL and return its nested discussion with configurable depth and comment-count limits. IDs stay strings, comment HTML becomes plain text, hierarchy and canonical links remain explicit, and dead, deleted, partial or truncated states are reported rather than silently omitted.

Agents select this operation with tool ID hacker-news.thread, then inspect its current executable contract before a run.

Public input and output shape

Input

id_or_urlstring · required

Positive numeric HN item ID or canonical news.ycombinator.com item URL.

minLength: 1 · maxLength: 2048

max_commentsinteger · optional

Value supplied for max comments.

minimum: 1 · maximum: 200

max_depthinteger · optional

Value supplied for max depth.

minimum: 0 · maximum: 8

Output

captured_atstring

Returned captured at value.

itemobject

Returned item value.

max_depthnumber

Returned max depth value.

omitted_commentsnumber

Returned omitted comments value.

returned_commentsnumber

Returned returned comments value.

source_urlstring

Returned source url value.

total_commentsnumber

Returned total comments value.

truncatedboolean

Returned truncated value.

Example request and output

This reviewed worked example is shared with inspect. Inspect also returns the current executable schema and price estimate before a paid run.

Request

{
  "tool_id": "hacker-news.thread",
  "input": {
    "id_or_url": "https://news.ycombinator.com/item?id=8863",
    "max_depth": 2,
    "max_comments": 25
  }
}

Output

{
  "item": {
    "id": "8863",
    "type": "story",
    "state": "available",
    "title": "My YC app: Dropbox - Throw away your USB drive",
    "author": "dhouston",
    "children": [
      {
        "id": "8865",
        "text": "oh, and a mac port is coming :)",
        "type": "comment",
        "state": "available",
        "author": "dhouston",
        "parent_id": "8863",
        "source_url": "https://news.ycombinator.com/item?id=8865"
      }
    ],
    "source_url": "https://news.ycombinator.com/item?id=8863"
  },
  "max_depth": 2,
  "truncated": true,
  "source_url": "https://news.ycombinator.com/item?id=8863",
  "captured_at": "2026-08-21T00:00:00.000Z",
  "total_comments": 71,
  "omitted_comments": 46,
  "returned_comments": 25
}
Teaching errors and limitations
  • not_found: Hacker News could not find that public item.Use an exact positive item ID or canonical news.ycombinator.com item URL.
Updated
21 August 2026

Use Thread with Scrollport

Scrollport identifies and validates the best-in-class API tools and provides them on a pay-as-you-go basis so you don't need to maintain a separate provider account, subscription or credits.

Give your agent the setup prompt to receive $1 in trial credit and start using the tools right away.