Hacker News API

The Hacker News API returns assembled, structured JSON for stories, full comment trees, front-page lists, full-text search, and user profiles. The official HN Firebase API is intentionally minimal โ€” id-only lists, no search, recursive comment fetching. These endpoints give you the finished objects in one call, through every Anysite surface (REST, MCP, CLI).

5 endpoints  ยท  items ยท comments ยท lists ยท search ยท users  ยท  REST + MCP + CLI

What Is the Hacker News API?

Hacker News is the developer community's front page โ€” stories, comments, jobs, polls, and the people behind them. The official Firebase API returns raw item ids and makes you reassemble everything yourself, with no search and id-only front-page lists. The Anysite Hacker News endpoints return the assembled objects directly: a full item by id, the entire nested comment tree in one call, front-page lists with full item data, full-text search across everything, and user profiles by username.

All 5 Endpoints

Items, Lists, Search & Users

EndpointWhat It Returns
POST /api/hackernews/items A single item โ€” story, comment, job, or poll โ€” by numeric id: title, url, author, score, time, type, and descendant count.
POST /api/hackernews/items/comments The full nested comment tree of a thread by id, in one call โ€” no recursive id-by-id Firebase fetching.
POST /api/hackernews/items/lists Front-page lists (top, new, best, ask, show, job) returned with full item data, not just ids.
POST /api/hackernews/items/search Full-text search across stories, comments, jobs, and polls โ€” the capability the official API does not have.
POST /api/hackernews/users A user profile by username: karma, account age, and submission history.

What Can You Build with the Hacker News API?

Launch Monitoring

Watch the show and new lists plus a search for your product or category, then pull the full comment tree the moment a relevant thread appears.

Developer Sentiment

Search a tool or company across all of Hacker News and read the complete threads behind every hit โ€” not just the headline.

Audience & Influencer Mapping

Resolve usernames to karma, account age, and submission history to find and rank the developers shaping a conversation.

Trend & Content Signals

Treat the front page and top search results as a live demand map for what the developer audience cares about right now.

Quick-Start Examples

Get the current top front page with full item data:

Shell
curl -X POST https://anysite.io/api/hackernews/items/lists \
  -H "X-API-Key: YOUR_KEY" -H "Content-Type: application/json" \
  -d '{"list": "top", "count": 30}'

Full-text search across Hacker News:

Shell
curl -X POST https://anysite.io/api/hackernews/items/search \
  -H "X-API-Key: YOUR_KEY" -H "Content-Type: application/json" \
  -d '{"query": "ai agents"}'

Get a thread's full comment tree by id:

Shell
curl -X POST https://anysite.io/api/hackernews/items/comments \
  -H "X-API-Key: YOUR_KEY" -H "Content-Type: application/json" \
  -d '{"id": 8863}'

Plans

Every endpoint is included in all Anysite plans โ€” there's no per-endpoint pricing to track. Use MCP Unlimited for flat-rate access through your AI tools, or a credit plan for REST & CLI at scale.

Frequently Asked Questions

  • How is this different from the official Firebase API?
    The official HN API returns raw item ids: you reassemble comment trees by fetching each id recursively, the front-page lists are id-only, and there is no search. These endpoints return the assembled objects directly โ€” full comment trees in one call, lists with full item data, and full-text search.
  • Can I get a full comment thread in one request?
    Yes. /api/hackernews/items/comments returns the complete nested comment tree for a thread by its numeric id, so you never fetch comments id-by-id.
  • Which front-page lists are available?
    /api/hackernews/items/lists supports top, new, best, ask, show, and job โ€” each returned with full item data and an optional count.
  • Is full-text search supported?
    Yes. /api/hackernews/items/search runs full-text search across stories, comments, jobs, and polls โ€” the capability the official Firebase API does not provide.

Start Building with Hacker News Data

Stories, full comment trees, front-page lists, search, and user profiles โ€” assembled JSON by API key. Sign up for a free Anysite account and start querying HN in minutes.

Get Started Free Read the Docs