
Hacker News
Official read-only data API for Hacker News stories, comments, and users, served via Firebase.HackerNews/API
- Stars
- 13.4k
- Forks
- 766
- Licence
- MIT
- Language
- —
- Last update
- 1.8 years ago
- Type
- Learning resource
No commits in over a year — check for forks or alternatives before adopting.
What it is
This repository documents the official Hacker News API, which provides public HN data (stories, comments, jobs, polls, and user profiles) in near real time through Firebase. Developers use it to build their own apps, feeds, or analysis on top of HN content without scraping the website.
- Fetch the current top or newest stories by requesting item IDs and loading each item
- Load a story's comment tree by walking its kids IDs
- Look up a user's karma, creation date, and submitted items
- Read poll options and their scores for a given poll
Great for
- Developers building a Hacker News reader, widget, or bot
- People who want to pull HN stories or comments into their own tools
- Data hobbyists analyzing public HN activity
- Developers who already use Firebase client libraries
Not ideal for
- Anyone needing write access; the README describes only reading public data
- People expecting a polished, easy-to-use public API; the README says the design is awkward and was released under time pressure
- Users looking for a ready-made app; this is documentation and samples, not a client
How to get it
- 1
See the README
Clone the repository
git clone https://github.com/HackerNews/API - 2
Run it
- Open https://hacker-news.firebaseio.com/v0/item/8863.json?print=pretty in a browser to see a sample story
- Request https://hacker-news.firebaseio.com/v0/user/jl.json?print=pretty to see a user record
- Use a Firebase client library for your platform if you want efficient networking and change events
- 3
Get the most out of it
- Use a Firebase client library instead of raw HTTP, since the README recommends it for efficient networking and event handling
- Walk the kids array to load comment threads rather than expecting nested comments in one response
- Ignore unexpected fields, as the README says clients should handle additional fields gracefully
- Email api@ycombinator.com to report bugs, per the README
Downloads
Strengths
- Official data source maintained in partnership with Firebase
- Documents the item and user schemas clearly with field tables and examples
- No rate limit is stated in the README
Trade-offs
- The README describes the design as awkward, so common tasks like counting comments or building a feed take multiple requests
- Versioned v0 URIs may change in later iterations, and the maintainers say changes won't always be backward compatible
- The README is truncated here, so the full list of endpoints and sample code could not be checked
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.