100 free credits. No credit card required. Get a key

Hacker News comments API

Every comment in a Hacker News thread in one call, flattened in reading order with depth and parent, so you never walk the tree item by item.

GET /v1/hackernews/items/{id}/comments1 credit per callRefunded on failure
import os, requests

res = requests.get(
    "https://api.groundsocial.dev/v1/hackernews/items/8863/comments",
    headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()
Response
200 · 1 credit
{
"story": {
"id": 8863,
"type": "story",
"by": "dhouston",
"time": 1175714200,
"title": "My YC app: Dropbox - Throw away your USB drive",
"url": "http://www.getdropbox.com/u/2/screencast.html",
"score": 104,
"descendants": 71,
"kids": [
9224,
8917,
"… 31 more"
]
},
"comments": [
{
"id": 8865,
"author": "dhouston",
"text": "oh, and a mac port is coming :)",
"created_at": "2007-04-04T19:22:55.000Z",
"created_at_i": 1175714575,
"parent_id": 8863,
"story_id": 8863,
"depth": 0,
"reply_count": 1
},
{
"id": 9007,
"author": "vlad",
"text": "Drew, this is awesome! All of the features you mentioned are exactly what people need.",
"created_at": "2007-04-05T01:48:11.000Z",
"created_at_i": 1175737691,
"parent_id": 8865,
"story_id": 8863,
"depth": 1,
"reply_count": 0
},
"… 69 more"
],
"comment_count": 71
}

Parameters

NameTypeDescription
idpath · requiredstringAn item id or its link (news.ycombinator.com/item?id=…). Example: 8863.
sincequerystringOnly rows published on or after this date: YYYY-MM-DD (midnight UTC) or an ISO 8601 timestamp. Example: 2026-01-01.
untilquerystringOnly rows published on or before this date: YYYY-MM-DD (that whole UTC day) or an ISO 8601 timestamp. Example: 2026-12-31.
Response fields

200 with a HackerNewsThread, in Hacker News’s own items and search hits.

FieldTypeDescription
storyHackerNewsItem
commentsHackerNewsComment[]
comment_countintegerComments returned (after since/until).
Status codes
StatusMeaning
200The story and its comments.
400Invalid input. Nothing was charged.
401Missing or invalid API key.
402Not enough credits, a spend cap was reached, or payment is required.
403The target is private, or the account is suspended.
404The item or user does not exist.
429Too many requests. Wait for Retry-After seconds.
503Hacker News is temporarily unavailable. Retryable; nothing was charged.

Every error has code, message, hint and retryable. All error codes

Questions

Is it paged?

No: one call returns the whole thread.

Hacker News is a trademark of Y Combinator. We are not affiliated with or endorsed by Y Combinator.