Introducing the Instagram APIRead more →

Hacker News Search API. Stories matching your search.

Stories by keyword, ranked or newest first. We handle the proxies, blocks and platform changes.

In your agent: Hacker News MCP server →

Hacker News Search API at a glance

Returns the public Hacker News stories that match your words, ranked by relevance or newest first: links, Ask HN, Show HN and Launch HN posts, jobs and polls. Filter by type, poster, points, comment count, date or the front page, or find who linked to a site. Each story has its title, the page it links to, its text as plain text, points and comment count, poster and posting time.

GET /v1/hackernews/search_stories

Read the API reference
  • 1 credit per page, $0.75–$1.97 per 1,000 pages
  • 23 typed fields null when unknown
  • 100 stories per page, HN Search's ranking: the best match of the words first, then the most points
  • query is all it needs, e.g. rust async

Send one request. Get up to 100 stories 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
query = rust async
GET /v1/hackernews/search_storiesTry in
const params = new URLSearchParams({
  query: "rust async",
});
const res = await fetch(`https://socialtap.dev/v1/hackernews/search_stories?${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/search_storiesLong arrays and strings are shortened here. Real responses are complete.Docs

One schema on 22 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

    Words to find stories by, as HN Search reads them: any word can match with a small typo, a phrase in quotes matches exactly, and a leading - leaves a word out (rust async, "memory safety" -rust).

  • Write one parser

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

platformstring
Platform ID (tiktok, youtube, …).
idstring
Platform-native post ID (string; Instagram shortcode, Reddit with its t3_ prefix).
urlstring
Canonical post URL.
typestring
Normalized content shape. New values may be added; treat unknown values as other.
platform_typestring
The platform's own product label, lowercase (reel, short, story, live, tweet, …).
titlestring
Headline (YouTube title, Reddit title); null on caption-only platforms.
textstring
Caption, description or body as plain text.
link_urlstring
The page the post links to: a link post's target, a pin's destination, or the page its link card or link sticker opens; null when it links to none.

What teams build with the Hacker News Search API.

  • Find every Hacker News thread about your product

  • See who submitted links to your site

  • Collect Show HN launches in a category

  • Track a topic's stories over time

  • Find the most discussed stories on a subject

Good to know before you build.

  • Results come from HN Search, the search Hacker News itself links to, which copies every story within minutes. Points and comment counts are as of its last update of the story: minutes behind for a story still being voted on, the final count for an older one.
  • sort=relevance serves the first thousand matching stories, then ends with platform_limit. sort=newest walks back through every match.
  • A poll lists its options by ID only: the Hacker News Story API returns their text and points.
  • Stories Hacker News killed or that were deleted are not in the results.
  • Words in Chinese, Japanese or Korean match only where they stand apart as words, so they find few stories.

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
  • 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 Search API.

More in the API reference.

How do I find the Hacker News stories that link to my site?
Send your domain as the query with search_in=url, for example query=example.com, and sort=newest to list them all, newest first.
How much does the Hacker News Search API cost?
A page of up to 100 stories 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 with your own search.

Type 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