Introducing the Instagram APIRead more →

Hacker News Comment API. Send a story link or ID.

One comment with its story, parent and thread depth. We handle the proxies, blocks and platform changes.

In your agent: Hacker News MCP server →

Hacker News Comment API at a glance

Returns a public Hacker News comment from its link, its context link or its item ID. You get the text as plain text, the author and posting time, its direct reply count, the story it is on with its title, link, points and comment count, the comment it replies to, and how deep it sits in the thread. A deleted comment returns not_found.

GET /v1/hackernews/comment

Read the API reference
  • 1 credit per request, $0.75–$1.97 per 1,000 requests
  • 16 typed fields null when unknown
  • url is all it needs, e.g. https://news.ycombinator.com/item?id=9224
  • 100 credits free when you sign up, no card, so you can build before you spend

Send one request. Get 16 fields back.

Copy the request in your language, or hand it to your agent. Sign up for an API key and your first 100 credits are free.

$ npm install socialtap
url = https://news.ycombinator.com/item?id=9224
GET /v1/hackernews/commentTry in
const params = new URLSearchParams({
  url: "https://news.ycombinator.com/item?id=9224",
});
const res = await fetch(`https://socialtap.dev/v1/hackernews/comment?${params}`, {
  headers: { "x-api-key": process.env.SOCIALTAP_API_KEY ?? "" },
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.error.code}: ${body.error.message}`);
const { data, meta } = body;
console.log(data, meta.credits_charged);
200 OK · GET https://socialtap.dev/v1/hackernews/commentLong arrays and strings are shortened here. Real responses are complete.Docs

One schema on 13 platforms.

The response reference lists every field, its type and when it is null. See the full schema.

  • Null means unknown

    A field Hacker News doesn't show is null, never zero or an empty string, so a real zero always means zero.

  • What it accepts

    The comment: its link on Hacker News (news.ycombinator.com/item?id=9224), its context link (item?id=8863#9224, the comment after the #), or its item ID alone (9224).

  • Write one parser

    Hacker News, TikTok, Instagram and 10 more platforms answer in these fields, so the code that reads one reads them all.

platformstring
Platform ID (tiktok, youtube, …).
idstring
Platform-native comment ID (string; Reddit with its t1_ prefix).
post_idstring
ID of the post commented on (equals post.id).
parent_idstring
ID of the comment this replies to; null for top-level comments.
urlstring
Permalink, when the platform has one.
textstring
Comment body as plain text.
authorobject
The commenting account. An account the platform no longer names (a deleted account) has a null id and username and the platform's label as display_name (Reddit: [deleted]).
published_atstring
When the comment was posted, RFC 3339 UTC. Where the platform shows only a relative time ("3 weeks ago"), the latest time that label allows (the fetch time minus the stated amount), listed in approximate_fields.

What teams build with the Hacker News Comment API.

  • Archive a cited Hacker News comment as plain text

  • Show a comment beside the story it is on

  • Rebuild a reply chain one parent at a time

  • Check whether a quoted comment still stands

Good to know before you build.

  • Stories, comments and poll options share one ID counter. A story's ID or link returns invalid_input naming the endpoint that returns stories, and a poll option's names its poll.
  • A context link (item?id=8863#9224) returns the comment after the #, not the story.
  • A comment Hacker News killed returns with is_dead true and empty text: logged out, its page shows its author and place, and [flagged] or [dead] for its text.
  • Hacker News shows a comment's points only to its author, so like_count is null.
  • When the comment is read from its page, reply_count and the story's fields other than its title are null, and so is depth for a reply to another comment.

1 credit per request. Failed requests are free.

Buy credits once and spend them on any endpoint, on any platform.

SourcePrice per successful requestPer 1,000 requests
Platform API api1 credit$0.75–$1.97
Public page page1 credit$0.75–$1.97
  • Cache hits are free.
  • Credits from packs and top-ups never expire.
  • A monthly plan's credits are spent first, and what is left of them ends at each renewal.
  • Prices exclude tax: sales tax is added at checkout where it applies.
  • Outside the US, plans and packs are sold to businesses: checkout asks for your VAT, GST or other business tax ID.

Questions about the Hacker News Comment API.

More in the API reference.

How much does the Hacker News Comment API cost?
A request costs 1 credit. SocialTap credits cost $0.75–$1.97 per 1,000, depending on the plan or pack.

Try it on a link you already have.

Paste it in the playground, or copy the request into your code.

100free credits
  • No credit card
  • Failed requests are free
  • Works on all 276 endpoints
Start for free Read the docs