Documentation Blog Free tools [email protected]Log in

Hacker News API

A Hacker News API that answers two questions from one endpoint: what is on the front page right now, and what HN has ever posted about a term. Leave the query empty for the live front page, or search the full archive by relevance or by date — either way you get one row per story with points, author, comment count, the outbound link and the discussion permalink.

$0.0003 per delivered story · $2 free every month · Failed runs never billed

POST /v1/scraper/collectors/hacker_news/run
$ curl $QD/hacker_news/run \
    -H "Authorization: Bearer $QD_API_KEY" \
    -d '{"max_results": 30}'
{ "status": "done", "count": 30,
  "results": [
    {
      "id": "…",
      "title": "…",
      "url": "…",
      "points": … } ],
  "cost": 0.009 }
# 30 storys × $0.0003 · nothing delivered, nothing charged
$0.0003 / story6,666 storys on the free $2 every month
Semantic inputquery, type, sort — no URL lists
Up to 200storys per run, pagination handled for you
No browserread over HTTP/TLS — cheaper and faster than rendering

What a Hacker News API does

Hacker News publishes a Firebase feed of raw item ids, which means reconstructing a front page or a search is a fan-out of hundreds of per-item lookups you then have to assemble and rank yourself. This collector reads the official Algolia index that HN itself uses for search, so a front page or a keyword query comes back already ordered and already joined — one call per run, not a tree of them.

What lands is a flat table: title, the outbound url (null when the post is a text submission), points, author, comments and the timestamps, plus the hn_url that points at the discussion. Ask HN and Show HN are selectable as their own types, and self-post text arrives with its tags stripped, so a corpus of Show HN launches or Ask HN threads is a filter setting rather than a scraping project.

What one story looks like

Every delivered story carries these fields. Nullable means the source did not publish it — the field stays empty instead of being guessed.

FieldTypeWhat it holds
rankinteger1-based position.
idstringHN item id.
titlestringStory title.
urlstring · nullableOutbound link (null for text posts).
pointsinteger · nullableUpvotes.
authorstring · nullableSubmitter.
commentsinteger · nullableComment count.
created_atstring · nullableSubmission time (ISO 8601).
textstring · nullableSelf-post text (Ask HN), tags stripped.
hn_urlstringLink to the HN discussion.
tagsstring[]Index tags (story, show_hn…).

Inputs

The whole request. Anything you leave out falls back to the default shown in the catalog.

InputTypeRequiredWhat it does
querystringnoWhat to search. Empty = current front page.
typestringnoStory type filter (default: story when searching, front_page otherwise). One of: story, ask_hn, show_hn, front_page.
sortstringnorelevance (default when searching) or date (newest first). One of: relevance, date.
max_resultsintegernoHow many stories to deliver at most (1–200). You pay only for delivered stories.

Pricing

Hacker News API pricing

$0.0003 per delivered story. A run that delivers nothing costs nothing: blocked pages, challenges and retries are on us, and the $2 monthly allowance covers about 6,666 storys before you spend anything.

$0.0003per delivered story$0.24 per 1,000 delivered storys
6,666 storyson the free allowance$2 every month, no card
Zero rowszero chargeblocks, captchas and retries are on us
−30%on volume tiersthe catalog returns your key's price

Pay as you go

$0/mo
  • $2 free credit / month
  • 60 requests / min
  • List unit prices

Starter

$19/mo
  • $15 free credit / month
  • 300 requests / min
  • 10% off unit prices

Scale

$299/mo
  • $250 free credit / month
  • 1,200 requests / min
  • 30% off unit prices

Same wallet, same key and same $2 monthly allowance as every other Data API. Prices are launch pricing read live from the billing config — GET /v1/scraper/collectors returns the price your key actually pays.

Integration

One POST, typed rows

Base URL https://api.quanticdata.io/v1, Bearer auth, the same key as every other Data API. Endpoint: POST /v1/scraper/collectors/hacker_news/run.

curl -X POST https://api.quanticdata.io/v1/scraper/collectors/hacker_news/run \
  -H "Authorization: Bearer $QD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"max_results":30}'

What people build with the Hacker News API

Three shapes of work this endpoint was designed around.

Launch and sentiment monitoring

Search your product, a competitor or a topic across the whole archive and get every story with its points and comment count, so a spike in attention is a row with numbers rather than a screenshot someone sent you.

Front-page datasets

Take the live front page on a schedule and you accumulate a time series of what the audience surfaced, ranked, with the outbound link and discussion link on each row.

Show HN and Ask HN mining

Target the Show HN or Ask HN type to build a clean set of launches or questions — title, submitter, self-text and engagement — for trend analysis or lead discovery.

Hacker News API versus rolling your own

The differences that actually cost time when you build this in-house.

DIY scraperThis collector
AssemblyFan-out of per-item id lookupsOne call, stories already ranked
CoverageFront page or a hand-rolled indexFront page or the full Algolia archive
Row shapeItem ids to resolve and joinTitle, points, author, comments, links

FAQ

Questions we get about the Hacker News API.

Something else? Ask us →

Which Hacker News API is this reading?

The official Algolia-powered search index — the same one behind HN's own search box — for both keyword queries and the front page. It is not the Firebase item feed, so you get ranked stories in one response instead of a list of ids to resolve one by one.

Can I search old stories, or only what is live now?

Both. An empty query returns the current front page; a query with sort set to relevance or date searches the entire archive, so you can pull the highest-scoring stories about a term or the most recent ones.

Do I get the comments themselves?

You get the comment count per story and the hn_url that links to the discussion, plus self-post text for Ask HN threads. The endpoint is story-level; it does not return the individual comment tree.

Is there a free Hacker News API?

Every account gets $2 of credit every month with no card, which is about 6,666 delivered storys on this endpoint at $0.0003 each. It renews monthly, and a run that delivers nothing is never billed — so a failed or blocked attempt does not eat the allowance.

How much does one run cost?

Multiply the rows you actually receive by $0.0003. A run capped at 200 storys — the maximum for this collector — costs $0.06 if every row comes back, and less when the source has fewer. Volume tiers take up to 30% off, and GET /v1/scraper/collectors returns the price your key actually pays.

Run the Hacker News API now

$2 of free credit every month, no card. Your key returns its own prices from GET /v1/scraper/collectors.

Get my free API key
Get my free API key