Hacker News

Get Hacker News story comments

List comments on a Hacker News story by id.

GET/v1/hackernews/stories/{id}/comments
3credits
x-api-key*stringheader

API key (`sfk_...`)

Parameters
3
id*integerpath

Hacker News story id whose comment tree should be returned.

≥ 0 · ≤ 9007199254740991

limitintegeroptionalquery

Maximum comment nodes to return in this page (1–100). Default: 50.

≥ 1 · ≤ 100

cursorstringoptionalquery

Opaque continuation cursor from a previous response. Omit for the first page.

min 1 chars

Response fields
32

Endpoint-specific response payload.

datalookupStatus
string

Whether the story was found, not found, or not a story.

one of: found, not_found, not_story

Story summary when lookupStatus is `found`; null otherwise.

datastoryid
integer

Story id.

≥ 0

datastorytitle
stringnullable

Plain-text title when present.

datastoryauthor
stringnullable

Author username when present.

datastorycommentCount
integernullable

Total comment count when present.

datastoryitemUrl
string

Canonical news.ycombinator.com item URL.

Top-level comment ids in ranked display order. Empty when the story has no comments or lookupStatus is not `found`.

datarootCommentIds[]
integeroptional

≥ 0

Comment nodes returned in this page. Reconstruct the tree using rootCommentIds and each node's childIds.

datacomments[]id
integer

Comment item id.

≥ 0

datacomments[]parentId
integer

Immediate parent item id (story or comment).

≥ 0

Child comment ids in ranked display order. Unresolved children may still appear here when traversal is incomplete.

datacomments[]childIds[]
integeroptional

≥ 0

datacomments[]author
stringnullable

Author username when available.

datacomments[]createdAt
stringnullable

Creation time as an ISO-8601 timestamp when available.

datacomments[]text
stringnullable

Plain-text body when available (HTML stripped). Null for deleted/tombstone nodes.

datacomments[]dead
boolean

Whether the comment is marked dead.

datacomments[]deleted
boolean

Whether the comment is marked deleted.

datacomments[]itemUrl
string

Canonical news.ycombinator.com item URL.

Traversal metadata when lookupStatus is `found`; null otherwise.

datatraversalcomplete
boolean

True when every currently reachable child edge has been traversed. Not a historical archive guarantee.

datatraversalnextCursor
stringnullable

Opaque cursor to continue the same traversal when complete is false; otherwise null.

datatraversalreturnedNodes
integer

Number of comment nodes returned in this page.

≥ 0

datatraversaldiscoveredNodes
integer

Total comment nodes discovered so far across this traversal snapshot.

≥ 0

datatraversalsnapshotAt
string

ISO-8601 timestamp when this traversal snapshot began (first page).

Metadata describing the request and billing outcome.

metarequestId
string

Unique request identifier for tracing this API call.

min 1 chars

metacreditsCharged
integer

Credits charged for this request.

≥ 0

metaversion
string

Public API version that served the response.

one of: v1

metacached
booleanoptional

True when served from shared response cache. Credits still apply (full endpoint price); Age header may be present.

Code example

curl "https://api.socialfetch.dev/v1/hackernews/stories/8863/comments" \
  -H "x-api-key: YOUR_API_KEY"

Responses

Hacker News story comment tree page. Each successful page costs one credit, including cursor continuations.