Hacker News

Get Hacker News comment context

Get a Hacker News comment with its ancestor chain to the root story.

GET/v1/hackernews/comments/{id}/context
2credits
x-api-key*stringheader

API key (`sfk_...`)

Parameters
1
id*integerpath

Hacker News comment id.

≥ 0 · ≤ 9007199254740991

Response fields
55

Endpoint-specific response payload.

datalookupStatus
string

Whether the item was found as a comment, was missing, or exists but is not a comment.

one of: found, not_found, not_comment

The requested comment when found.

datacommentid
integer

Unique Hacker News item id.

≥ 0

datacommenttype
string

Item type.

one of: story, comment, job, poll, pollopt, unknown

datacommentauthor
stringnullable

Author username when present.

datacommentcreatedAt
stringnullable

Creation time as an ISO-8601 timestamp.

datacommenttitle
stringnullable

Plain-text title when present.

datacommenttext
stringnullable

Plain-text body when present (HTML stripped).

datacommenturl
stringnullable

External URL when present and publicly safe.

datacommentscore
integernullable

Score / votes when present.

datacommentcommentCount
integernullable

Total comment count when present (stories/polls).

datacommentparentId
integernullable

Parent item id for comments/pollopts.

≥ 0

Child item ids in ranked display order when present. Some list endpoints omit children and return an empty array.

datacommentchildIds[]
integeroptional

≥ 0

datacommentdead
boolean

Whether the item is marked dead. Some list endpoints omit this signal and return false.

datacommentdeleted
boolean

Whether the item is marked deleted. Some list endpoints omit this signal and return false.

datacommentitemUrl
string

Canonical news.ycombinator.com item URL.

Ancestor items from immediate parent up to (but not including) the story, nearest-parent first.

dataancestors[]id
integer

Unique Hacker News item id.

≥ 0

dataancestors[]type
string

Item type.

one of: story, comment, job, poll, pollopt, unknown

dataancestors[]author
stringnullable

Author username when present.

dataancestors[]createdAt
stringnullable

Creation time as an ISO-8601 timestamp.

dataancestors[]title
stringnullable

Plain-text title when present.

dataancestors[]text
stringnullable

Plain-text body when present (HTML stripped).

dataancestors[]url
stringnullable

External URL when present and publicly safe.

dataancestors[]score
integernullable

Score / votes when present.

dataancestors[]commentCount
integernullable

Total comment count when present (stories/polls).

dataancestors[]parentId
integernullable

Parent item id for comments/pollopts.

≥ 0

Child item ids in ranked display order when present. Some list endpoints omit children and return an empty array.

dataancestors[]childIds[]
integeroptional

≥ 0

dataancestors[]dead
boolean

Whether the item is marked dead. Some list endpoints omit this signal and return false.

dataancestors[]deleted
boolean

Whether the item is marked deleted. Some list endpoints omit this signal and return false.

dataancestors[]itemUrl
string

Canonical news.ycombinator.com item URL.

Root story when reachable within the depth cap; otherwise null.

datastoryid
integer

Unique Hacker News item id.

≥ 0

datastorytype
string

Item type.

one of: story, comment, job, poll, pollopt, unknown

datastoryauthor
stringnullable

Author username when present.

datastorycreatedAt
stringnullable

Creation time as an ISO-8601 timestamp.

datastorytitle
stringnullable

Plain-text title when present.

datastorytext
stringnullable

Plain-text body when present (HTML stripped).

datastoryurl
stringnullable

External URL when present and publicly safe.

datastoryscore
integernullable

Score / votes when present.

datastorycommentCount
integernullable

Total comment count when present (stories/polls).

datastoryparentId
integernullable

Parent item id for comments/pollopts.

≥ 0

Child item ids in ranked display order when present. Some list endpoints omit children and return an empty array.

datastorychildIds[]
integeroptional

≥ 0

datastorydead
boolean

Whether the item is marked dead. Some list endpoints omit this signal and return false.

datastorydeleted
boolean

Whether the item is marked deleted. Some list endpoints omit this signal and return false.

datastoryitemUrl
string

Canonical news.ycombinator.com item URL.

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/comments/2921983/context" \
  -H "x-api-key: YOUR_API_KEY"

Responses

Comment context result.