glossary

Live JSON and No Key Required: Hacker News API How to Use

Taras Shynkarenko
Taras Shynkarenko
•Updated: •7 min read
Live JSON and No Key Required: Hacker News API How to UseLive JSON and No Key Required: Hacker News API How to Use

TL;DR

7 min read

Hacker News runs two free public APIs and neither one issues keys. The Firebase API at hacker-news.firebaseio.com/v0/ serves single items, user profiles and the ranked story lists, and its README states there is currently no rate limit. The Algolia API at hn.algolia.com/api/v1/ serves full text search and limits a single IP to 10,000 requests per hour.

How do you use the Hacker News API?

Every hacker news api how to use question resolves to one of two free hosts: hacker-news.firebaseio.com/v0/ serves live items, user profiles and ranked story lists, and hn.algolia.com/api/v1/ serves full text search. Both return plain JSON over HTTPS, both accept anonymous requests, and neither one issues API keys or accepts a token. Reach for Firebase when you already know an item id or want the current front page, and reach for Algolia when you have a keyword and no id.

What does the Firebase API return for one item?

The Firebase API returns one flat JSON object per item from /v0/item/<id>.json, and id is the only field that every item carries. The HackerNews/API README lists deleted, type, by, time, text, dead, parent, poll, kids, url, score, title, parts and descendants as the optional fields, with type taking one of "job", "story", "comment", "poll" or "pollopt". Write your parser against id plus whatever else you find, because a comment carries parent and text where a story carries url, score and descendants.

curl "https://hacker-news.firebaseio.com/v0/item/8863.json?print=pretty"
{
  "by": "dhouston",
  "descendants": 71,
  "id": 8863,
  "kids": [9224, 8917, 8884, 8887],
  "score": 104,
  "time": 1175714200,
  "title": "My YC app: Dropbox - Throw away your USB drive",
  "type": "story",
  "url": "http://www.getdropbox.com/u/2/screencast.html"
}

That is the live response for item 8863 with the kids array trimmed to four ids; the real one holds 33. time is a Unix timestamp in seconds, descendants counts the whole comment tree, and kids holds only the direct replies, so walking a full thread means recursing through kids one request at a time.

A developer typing terminal commands at a laptop, next to the list of Hacker News API endpoints.

Which Hacker News API endpoints exist?

The Firebase API exposes ten paths, all of them GET, all of them ending in .json. Every list path returns an array of item ids and not the items themselves, so a list read is one request plus one request per id you then resolve.

EndpointWhat it returnsSize
/v0/item/<id>.jsonone story, comment, job, poll or poll optionone object
/v0/user/<id>.jsonone profile: id, created, karma, about, submittedone object
/v0/maxitem.jsonthe current largest item idone integer
/v0/topstories.jsonranked front page ids, jobs includedup to 500 ids
/v0/newstories.jsonnewest item idsup to 500 ids
/v0/beststories.jsonhighest scoring story idsa list of ids
/v0/askstories.jsonAsk HN idsup to 200 ids
/v0/showstories.jsonShow HN idsup to 200 ids
/v0/jobstories.jsonjob posting idsup to 200 ids
/v0/updates.jsonchanged items and profilesitems and profiles arrays

The documented sizes are ceilings, not fixed lengths. Queried on 10 September 2026, /v0/topstories.json returned the full 500 ids while /v0/askstories.json returned 28, and /v0/maxitem.json returned 49,649,544. Ids are sequential from item 1, which is a story titled "Y Combinator" posted by user pg with a time of 1160418111, so a crawler can walk the whole corpus by counting up. That sequential id is also what makes the Hacker News statistics you can pull from the same endpoints checkable instead of secondhand.

A magnifying glass over printed pages on a desk, next to the section on searching Hacker News with Algolia.

How do you search Hacker News with the Algolia API?

Search runs on a separate host with two paths: /api/v1/search ranks by relevance, then points, then comment count, and /api/v1/search_by_date ranks newest first. Both accept query for full text, tags for type filters, numericFilters for conditions on created_at_i, points and num_comments, plus page and hitsPerPage for paging. Filter with tags before you filter in your own code, because the valid values cover story, comment, poll, pollopt, show_hn, ask_hn, front_page, author_:USERNAME and story_:ID.

curl "https://hn.algolia.com/api/v1/search?query=postgres&tags=story&hitsPerPage=1"
curl "https://hn.algolia.com/api/v1/search_by_date?tags=story&numericFilters=created_at_i>1788998400"
curl "https://hn.algolia.com/api/v1/search?tags=comment,story_18717168"
curl "https://hn.algolia.com/api/v1/search?tags=front_page"
{
  "hits": [
    {
      "objectID": "18717168",
      "title": "Bye Bye Mongo, Hello Postgres",
      "url": "https://www.theguardian.com/info/2018/nov/30/bye-bye-mongo-hello-postgres",
      "author": "philliphaydon",
      "points": 1562,
      "num_comments": 417,
      "created_at": "2018-12-19T17:08:53Z",
      "created_at_i": 1545239333,
      "story_id": 18717168,
      "_tags": ["story", "author_philliphaydon", "story_18717168"]
    }
  ],
  "nbHits": 14776,
  "page": 0,
  "nbPages": 1000,
  "hitsPerPage": 1,
  "processingTimeMS": 13
}

Tags are ANDed by default and ORed inside parentheses, so author_pg,(story,poll) reads as author pg AND (story OR poll). That is the whole query language, and it is narrower than the boolean search operators you would write for a search engine, so keyword coverage has to come from running several queries instead of one clever one. hitsPerPage defaults to 20.

What are the Hacker News API rate limits?

The two APIs publish different answers. The HackerNews/API README states "There is currently no rate limit" for the Firebase endpoints, and the hn.algolia.com/api documentation states that Algolia limits a single IP to 10,000 requests per hour and blacklists addresses that exceed it. No published number covers the Firebase side, so treat that headroom as a courtesy and not a guarantee and keep your polling honest either way.

Budget the Algolia side before you write the loop:

requests per hour = (3600 / poll interval in seconds) x number of saved queries

Thirty saved queries on a 60 second interval works out to 3600 / 60 = 60 polls per query per hour, and 60 x 30 = 1,800 requests per hour, which is 18 percent of the 10,000 allowance. Add a front page refresh on the Firebase side and the cost is 1 request for /v0/topstories.json plus 500 item requests, or 501 requests per pass. Anyone who has budgeted around Reddit's API rate limits will find both numbers generous by comparison.

Algolia hourly rate limit budget
Algolia hourly allowance10,000 requests
30 queries polled every 60 seconds1,800 requests
Headroom left over8,200 requests
Thirty saved queries polled every 60 seconds use 18 percent of Algolia's 10,000 request hourly cap, the example this post walks through.

What can the Hacker News API not do?

Both APIs are read only, so no endpoint posts a story, votes, or replies to a comment, and no path accepts credentials that would let it. Algolia also caps pagination: nbPages multiplied by hitsPerPage came back as exactly 1,000 at every page size tested on 10 September 2026, and requesting page 60 at 20 hits per page returned an empty hits array, which means one query reaches 1,000 results and no further. Split a wide search into date ranges with numericFilters on created_at_i when you need everything behind that wall.

Neither API alerts you. There is no webhook, no email, no keyword watch, no deduplication across repeat mentions, and no judgement about which thread is worth a reply. That gap is the work RedReplier does: it takes a website and a set of keywords, watches Hacker News alongside Reddit, X, Bluesky and Facebook in one place, ranks each mention by buying intent, explains with AI why it was flagged, and emails you on a per plan interval. The same product also exposes API access and an MCP server that works with Claude Code, Cursor and any standard MCP client, which is the difference between raw social media data collection and a queue of conversations worth answering.

RedReplier
RedReplier

Get Started

Reddit, X, Bluesky & HN

Real-time intent alerts

Unlimited AI replies

Ranked by buyer intent

Frequently asked questions

Does the Hacker News API need an API key?

No. Neither hacker-news.firebaseio.com/v0/ nor hn.algolia.com/api/v1/ issues keys, and neither one accepts a token. A plain unauthenticated GET returns JSON from both hosts, which is why a single curl command is enough to test any endpoint on this page.

Is there an official Hacker News API rate limit?

Algolia publishes one and Firebase does not. The hn.algolia.com/api documentation caps a single IP at 10,000 requests per hour, and the HackerNews/API README says "There is currently no rate limit" for the Firebase endpoints. No documented number exists for Firebase, so anyone quoting a specific requests per second figure for it is guessing.

How do I get all the comments on a Hacker News story?

Two routes work. On Firebase, read the story's kids array and recurse into each child item, which costs one request per comment. On Algolia, one request to /api/v1/search?tags=comment,story_<ID> returns the comments as search hits, subject to the 1,000 result pagination cap.

What is the difference between the Firebase API and the Algolia API?

Firebase is the live record and Algolia is the index over it. Firebase answers "give me item 8863" and "what is on the front page right now" with fields like score, kids and descendants. Algolia answers "which stories mention postgres" with fields like points, num_comments and created_at_i, and it is the only one of the two that does full text search.

Can I post or vote on Hacker News through the API?

No. Both APIs are read only, and neither documents any write path for submitting stories, posting comments, or voting. Anything that posts to Hacker News on your behalf is driving the website, not the API.

How far back does Hacker News API data go?

To the first item on the site. Item id 1 is a story titled "Y Combinator" posted by user pg, carrying a Unix time of 1160418111, which puts it in October 2006. Ids run sequentially from there to the value /v0/maxitem.json reports today.

How do I get Hacker News's current front page with the API?

The Firebase API's /v0/topstories.json returns ranked front page ids, up to 500 of them, and each id still needs a separate /v0/item/<id>.json request to resolve into a title, score and url. Algolia offers a shortcut for the same list: /api/v1/search?tags=front_page returns the front page as search hits in one request. Pick Firebase when you want the live ranking with every field, and Algolia when one call is enough.

Can I filter Hacker News search results by score or comment count?

The Algolia API accepts numericFilters for conditions on points and num_comments, alongside created_at_i for date ranges. A query like numericFilters=points>500 narrows /api/v1/search to stories above that score, and filters combine with a comma. Firebase carries the same score and descendants fields on each item, but it has no filter parameter, so filtering there means fetching items and checking the fields yourself.

How do I track new Hacker News posts as they're submitted?

Poll /v0/newstories.json on Firebase, which returns the newest item ids, up to 500 at a time, and diff each poll against the ids you already have. Pairing that with /v0/maxitem.json gives you the current ceiling of the whole corpus, so a jump in that number signals new items before you even list them. The README's "There is currently no rate limit" statement means polling this endpoint often costs nothing documented, but the Algolia budget math in this post still applies once you mix in search calls.

Can I look up everything a specific Hacker News user has posted?

/v0/user/<id>.json on Firebase returns a profile with a submitted field, an array of every item id that user has posted, comments included. Resolve each id with /v0/item/<id>.json to get the actual titles, text and scores, the same one-request-per-id pattern used for walking a comment tree. Algolia's author_:USERNAME tag filters search hits to one author too, which is faster if you only need stories and not a full submission history.

See us more often in Google

One click marks RedReplier as a preferred source, so our articles sit higher in your Top Stories, AI Mode, and AI Overviews.

Before you go...

RedReplier

RedReplier

Catch every buyer asking for what you sell

RedReplier watches Reddit, X, Bluesky and Hacker News in real time, ranks every thread by buyer intent, and drafts your reply, so you get there first.

Reddit, X, Bluesky & HN

Real-time intent alerts

Unlimited AI replies

Ranked by buyer intent

Related Articles