Introducing the Instagram APIRead more →

Hacker News User Comments API. Comments, page by page.

Every comment a user wrote, newest first. We handle the proxies, blocks and platform changes.

In your agent: Hacker News MCP server →

Hacker News User Comments API at a glance

Returns a Hacker News user's comments, newest first, from a username or a link to the user. Each comment comes with its text as plain text, posting time, link, the story it is on with that story's title and link, the comment it replies to, and its reply count. Page back through the user's whole history, or set since and until for a time range. An unknown username returns not_found.

GET /v1/hackernews/user_comments

Read the API reference
  • 1 credit per page, $0.75–$1.97 per 1,000 pages
  • 16 typed fields null when unknown
  • 100 comments per page, newest first
  • handle is all it needs, e.g. pg

Send one request. Get up to 100 comments 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
handle = pg
GET /v1/hackernews/user_commentsTry in
const params = new URLSearchParams({
  handle: "rtm",
});
const res = await fetch(`https://socialtap.dev/v1/hackernews/user_comments?${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, page, meta } = body;
console.log(data, meta.credits_charged);
200 OK · GET https://socialtap.dev/v1/hackernews/user_commentsLong 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 Hacker News user: a username (case-sensitive: pg, not PG) or a link to the user's page or one of its lists (news.ycombinator.com/user?id=pg, threads?id=pg).

  • 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 User Comments API.

  • Archive everything a known commenter wrote

  • Track what a founder says about their product

  • Find the stories a user joins in on

  • Study one person's views over the years

  • Vet a candidate's public comments

Good to know before you build.

  • Usernames are case-sensitive on Hacker News: a username in the wrong case returns not_found.
  • Comments come from HN Search, which copies new comments within minutes. If it fails, we read the user's comments pages on Hacker News instead: the same comments, with the story's title but not its link.
  • Hacker News' own pages list each thread under the user's comment that starts it, so on that fallback a reply inside an older thread can come a page late, and a walk with since can stop before reaching it.
  • Comments that were deleted or that Hacker News killed are left out.
  • Hacker News shows nobody a comment's points but its author, so like_count is null.

1 credit per page. Failed requests are free.

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

SourcePrice per successful pagePer 1,000 pages
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 User Comments API.

More in the API reference.

Can I get every comment a Hacker News user ever wrote?
Yes. Follow next_cursor page by page: the list goes back to the user's first comment. Set since to stop at a date.
How much does the Hacker News User Comments API cost?
A page of up to 100 comments costs 1 credit. Every successful page is charged, empty pages included. SocialTap credits cost $0.75–$1.97 per 1,000, depending on the plan or pack.
How do I get the next page?
Repeat the same request with cursor set to page.next_cursor from the previous response, keeping the other parameters. When page.has_more is false there are no more pages. Cursors expire after 24 hours.

Try it on an account you know.

Paste its handle or link 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