Hacker News API
Public-data Hacker News endpoints.
Public-data Hacker News endpoints.
When To Use This API
The Hacker News API is for agent workflows that need public, platform-native data without writing a custom collector for every task. Use it when a prompt needs evidence from live public records, when a Skill needs repeatable enrichment, or when product code needs the same contract an agent discovered through MCP.
This section lists 13 live Hacker News operations from the canonical OpenAPI spec. Each operation page documents the route, method, parameters, response envelope, pagination behavior when available, and the error vocabulary shared across UnifAPI.
- Use Hacker News operations when an agent needs public records from this platform.
- Call the documented endpoints through MCP or HTTP and keep the response envelope consistent.
- Combine these records with other UnifAPI APIs for research, monitoring, and enrichment workflows.
Agent Contract Notes
Agents usually discover these endpoints with the hosted UnifAPI MCP server, inspect the operation schema, then call only the records needed for the current task. Developers can call the same endpoints over HTTP with an API key, which makes the path from exploratory agent run to production integration direct.
Every successful response uses a stable envelope with a request id, data payload, optional pagination cursor, and billing metadata. Errors use the same closed vocabulary across platforms, so retry logic, user-facing explanations, and cost reporting can stay consistent even when a workflow spans multiple public-data sources.
When you are choosing an operation, start from the public identifier the user already has: a profile username, post id, channel id, subreddit name, search term, or URL-derived slug. Prefer the narrowest endpoint that answers the question, then expand only when the agent needs more evidence. This keeps record usage predictable, makes citations easier to explain, and avoids turning a focused research task into an expensive crawl.
Operations
Items
GET /hacker-news/items/{id}/comments— List the comment tree of a Hacker News story — Returns the comments on a Hacker News story, depth-first with parent ids and depth, so a thread can be rebuilt.GET /hacker-news/items/{id}/context— Get a Hacker News comment with its thread — Returns a Hacker News comment with its ancestor chain up to the root story.GET /hacker-news/items/{id}— Get Hacker News item by ID — Fetch a single Hacker News item.
Jobs
GET /hacker-news/jobs/who-is-hiring— List jobs from Who is Hiring — Returns the top-level job posts from the monthly Hacker News "Who is Hiring" thread, for the latest month or a givenmonth(YYYY-MM).
Max Item
GET /hacker-news/max-item— Get largest Hacker News item ID — Return the ID of the most recently created Hacker News item.
Search
GET /hacker-news/search— Search Hacker News stories and comments — Full-text search over Hacker News stories, comments, polls and jobs with filters for type, author, domain, date range and points.
Stories
GET /hacker-news/stories/{feed}/items— List Hacker News story items — Fetch item details from a named Hacker News story feed in one operation.GET /hacker-news/stories/{feed}— List Hacker News story IDs — List Hacker News story ids from a named feed.
Updates
GET /hacker-news/updates— Get changed Hacker News items and profiles — Return the IDs of recently changed Hacker News items and user profiles.
Users
GET /hacker-news/users/{id}/comments— List a Hacker News user's comments — Returns a Hacker News user's comments, newest first.GET /hacker-news/users/{id}/favorites— List a Hacker News user's favorites — Returns the stories and comments a Hacker News user has marked as public favorites.GET /hacker-news/users/{id}— Get Hacker News user by ID — Return a public Hacker News user profile by case-sensitive username, including karma, account creation date, and the about text.GET /hacker-news/users/{id}/submissions— List a Hacker News user's submissions — Returns a Hacker News user's stories, polls and jobs, newest first.