BYTETOOLS

Hacker News API

Official Hacker News API with no key: top stories, comments, users and live item feeds via Firebase. Extremely stable. Tested curl example and live JSON.

No API key requiredCORS enabledHTTPSFree tier

Endpoint tested and returned HTTP 200 on 2026-08-19

What is the Hacker News API?

The Hacker News API is the official, free Firebase-backed API for Hacker News. It provides stories, comments, jobs, polls and user profiles with no API key, and has been stable for over a decade.

This is the official API, run by Y Combinator on Firebase, and it is remarkably dependable — the interface has barely changed in over ten years, which makes it a safe long-term dependency.

The design does require a specific approach: endpoints return arrays of item *ids*, not the items themselves, so rendering a front page means one request for the id list and then one request per story. Batch those with Promise.all rather than looping sequentially, or the page will crawl.

Quick facts

Base URL
https://hacker-news.firebaseio.com/v0
Authentication
No key required.
Rate limit
No published limit — it is served by Firebase and scales well.
Pricing
Free.
CORS
Enabled — callable directly from browser JavaScript
Official docs
Read the docs

How to use the Hacker News API

Every request below was executed against the live API on 2026-08-19, and the response shown is the real body it returned — not an illustration.

1. Fetch a single Hacker News item

GET https://hacker-news.firebaseio.com/v0/item/8863.json

curl
curl 'https://hacker-news.firebaseio.com/v0/item/8863.json'
JavaScript (fetch)
const res = await fetch("https://hacker-news.firebaseio.com/v0/item/8863.json");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);
Python (requests)
import requests

res = requests.get("https://hacker-news.firebaseio.com/v0/item/8863.json", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200
{
  "by": "dhouston",
  "descendants": 71,
  "id": 8863,
  "kids": [
    9224,
    8917,
    8884,
    8887,
    8952,
    8869,
    8873,
    8958,
    8940,
    8908,
    9005,
    9671,
    9067,
    9055,
    8865,
    8881,
    8872,
    8955,
    10403,
    8903,
    8928,
    9125,
    8998,
    8901,
    8902,
    8907,
    8894,
    8870,
    8878,
    8980,
    8934,
    8943,
    8876
  ],
  "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"
}

Parameters

ParameterTypeRequiredDescription
item/<id>pathOptionalFetch a story, comment, job or poll by id. 8863
topstoriespathOptionalArray of up to 500 top story ids. topstories
newstories / beststoriespathOptionalNewest and highest-scoring story ids. newstories
user/<id>pathOptionalFetch a user profile by username. pg

Response fields

idinteger
Item identifier.
typestring
story, comment, job, poll or pollopt.
titlestring
Story title; absent on comments.
urlstring
Linked URL; absent on text posts (Ask HN).
scoreinteger
Points the item has received.
kidsarray
Ids of direct child comments — fetch recursively for a thread.
timeinteger
Unix timestamp in seconds, not milliseconds.

What you can build with the Hacker News API

  • Build a custom Hacker News reader or front page
  • Monitor stories matching keywords for brand or topic tracking
  • Analyse posting trends and score distributions
  • Practise batching and recursive fetching of comment trees

Common errors and how to fix them

null response

The item id does not exist or was deleted.

Fix: Check for null before accessing fields; deleted items return null rather than an error.

Slow front page render

You fetched 500 ids then requested each sequentially.

Fix: Slice to the first 20-30 ids and fetch them in parallel with Promise.all.

Timestamps far in the past

`time` is in seconds, not milliseconds.

Fix: Multiply by 1000 before passing to a JavaScript Date constructor.

Hacker News API — frequently asked questions

Is the Hacker News API official and free?

Yes, it is the official API run by Y Combinator on Firebase, completely free with no API key and no published rate limit.

Why does topstories return numbers instead of stories?

It returns an array of item ids. Fetch each id individually via /item/{id}.json — batch them with Promise.all rather than looping sequentially.

How do I fetch a comment thread?

Each item has a `kids` array of child comment ids. Fetch those recursively to build the tree, and be prepared to limit depth on very large threads.

Why are my Hacker News dates wrong?

The `time` field is a Unix timestamp in seconds. JavaScript's Date expects milliseconds, so multiply by 1000.

Tools that pair with this API

Hacker News is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-19; always check the official documentation before relying on this API in production, as terms and limits can change.