Documentation Python quickstart Blog Free tools Enterprise solutions hello@quanticdata.ioLog in
All collectors

Hacker News API

Developers & tech · v1.1.0 · hacker_news

$0.0003 / story

$0.24 / 1K · pay per delivered story

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

What it does

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.

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.

Outputs — 14 fields, one row per story

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…).
domainstring · nullableHost of the linked page (github.com); null for text posts.
updated_atstring · nullableLast time the story changed in the index (ISO 8601).
typestringstory, ask_hn, show_hn, job or poll.

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}'

Example response

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 stories × $0.0003 · nothing delivered, nothing charged

Try it

Hacker News stories, running now

Change the input and run it against the live collector — nothing to install, no sign-up.

Run it from your own code, on your own inputs

Same collector, same rows — $2 of free API credit every month, no card.

Get my free API key
Hacker News API: from query, type and sort, QuanticData reads the Hacker News front page and returns one row per story with title, points and author, at $0.0003 per delivered story.
You send query and type; the run goes out through a residential exit and comes back as stories with rank, id and title — 14 fields on every row — and you are billed $0.0003 for each story actually delivered, nothing for a run that delivers none.
$0.0003 / story6,666 stories on the free $2 every month
Semantic inputquery, type, sort — no URL lists
Up to 200stories per run, pagination handled for you
No browserread over HTTP/TLS — cheaper and faster than rendering

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 stories before you spend anything.

$0.0003per delivered story$0.24 per 1,000 delivered stories
6,666 storieson 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

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.

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

What people search for

Live autocomplete demand around Hacker News stories, pulled with our own Keyword ideas collector.

Hacker News API: the POST to the hacker_news collector, 30 stories delivered and the bill, 30 × $0.0003 = $0.009 in usage.cost_usd; zero stories would cost $0.
The same call you would paste into a terminal: a Bearer key, query, type and sort in the body, and back the envelope every QuanticData endpoint returns — type, message, payload — where count is how many stories arrived and usage.cost_usd is $0.009, which is 30 × $0.0003. A run that delivers nothing costs nothing. The key is good for 60 req/min on the free tier.

Sources and standards

The platform documentation and standards this collector is built against — check any claim on this page against the primary source:

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 stories 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 stories — 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.

Run in dashboard
Illustration: three coloured zones of the page that is read (Hacker News front page) turn into clean JSON with the fields title, points and author; 14 fields on every row.