# Hacker News API — UnifAPI

> Stories, search, comment trees, users, jobs. Hacker News items, users and story feeds free from the official API, plus full-text search, comment trees, user activity and Who is hiring posts.

- Category: News
- API base URL: https://api.unifapi.com
- Auth: `Authorization: Bearer <UnifAPI API key>` (OAuth recommended for MCP clients)
- MCP server: https://mcp.unifapi.com
- Developer docs: https://docs.unifapi.com/api/hacker-news
- OpenAPI spec: https://unifapi.com/openapi.json
- HTML page: https://unifapi.com/apis/hacker-news
- Full catalog: https://unifapi.com/apis.md

## Endpoints (13)

Every endpoint returns the UnifAPI JSON envelope (`request_id`, `data`, `pagination` on lists, `billing`) and bills max(records × credits per record, minimum) in credits.

### Get Hacker News item by ID

`GET /hacker-news/items/{id}`

Fetch a single Hacker News item. Stories, comments, jobs, polls, and poll options share the same item shape.

- Price: free (0 credits)
- Required: `id` (path)
- Details: https://unifapi.com/apis/hacker-news/items/id/get
- Docs: https://docs.unifapi.com/api/hacker-news/items/id/get

### List the comment tree of a Hacker News story

`GET /hacker-news/items/{id}/comments`

Returns the comments on a Hacker News story, depth-first with parent ids and depth, so a thread can be rebuilt. Paginate with `cursor`. Returns `not_found` when the story does not exist.

- Price: 1 credit per record, minimum 9 credits ($0.009) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/hacker-news/items/id/comments/get
- Docs: https://docs.unifapi.com/api/hacker-news/items/id/comments/get

### Get a Hacker News comment with its thread

`GET /hacker-news/items/{id}/context`

Returns a Hacker News comment with its ancestor chain up to the root story. Returns `not_found` when the comment does not exist.

- Price: 1 credit per record, minimum 6 credits ($0.006) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/hacker-news/items/id/context/get
- Docs: https://docs.unifapi.com/api/hacker-news/items/id/context/get

### List jobs from Who is Hiring

`GET /hacker-news/jobs/who-is-hiring`

Returns the top-level job posts from the monthly Hacker News "Who is Hiring" thread, for the latest month or a given `month` (YYYY-MM). Paginate with `cursor`.

- Price: 1 credit per record, minimum 3 credits ($0.003) per call
- Details: https://unifapi.com/apis/hacker-news/jobs/who-is-hiring/get
- Docs: https://docs.unifapi.com/api/hacker-news/jobs/who-is-hiring/get

### Get largest Hacker News item ID

`GET /hacker-news/max-item`

Return the ID of the most recently created Hacker News item. Useful as an upper bound for walking the full item range or detecting new activity since a previous poll.

- Price: free (0 credits)
- Details: https://unifapi.com/apis/hacker-news/max-item/get
- Docs: https://docs.unifapi.com/api/hacker-news/max-item/get

### Search Hacker News stories and comments

`GET /hacker-news/search`

Full-text search over Hacker News stories, comments, polls and jobs with filters for type, author, domain, date range and points. Paginate with `cursor`.

- Price: 1 credit per record, minimum 3 credits ($0.003) per call
- Details: https://unifapi.com/apis/hacker-news/search/get
- Docs: https://docs.unifapi.com/api/hacker-news/search/get

### List Hacker News story IDs

`GET /hacker-news/stories/{feed}`

List Hacker News story ids from a named feed. Use `/hacker-news/items/{id}` to fetch item details.

- Price: free (0 credits)
- Required: `feed` (path)
- Details: https://unifapi.com/apis/hacker-news/stories/feed/get
- Docs: https://docs.unifapi.com/api/hacker-news/stories/feed/get

### List Hacker News story items

`GET /hacker-news/stories/{feed}/items`

Fetch item details from a named Hacker News story feed in one operation. Use this when an agent needs readable story titles, URLs, scores, authors, or comment counts.

- Price: free (0 credits)
- Required: `feed` (path)
- Details: https://unifapi.com/apis/hacker-news/stories/feed/items/get
- Docs: https://docs.unifapi.com/api/hacker-news/stories/feed/items/get

### Get changed Hacker News items and profiles

`GET /hacker-news/updates`

Return the IDs of recently changed Hacker News items and user profiles. Useful for incrementally syncing only what changed since the last poll instead of re-fetching everything.

- Price: free (0 credits)
- Details: https://unifapi.com/apis/hacker-news/updates/get
- Docs: https://docs.unifapi.com/api/hacker-news/updates/get

### Get Hacker News user by ID

`GET /hacker-news/users/{id}`

Return a public Hacker News user profile by case-sensitive username, including karma, account creation date, and the about text. Useful for attributing stories and comments and profiling contributors.

- Price: free (0 credits)
- Required: `id` (path)
- Details: https://unifapi.com/apis/hacker-news/users/id/get
- Docs: https://docs.unifapi.com/api/hacker-news/users/id/get

### List a Hacker News user's comments

`GET /hacker-news/users/{id}/comments`

Returns a Hacker News user's comments, newest first. Paginate with `cursor`. Returns `not_found` when the user does not exist.

- Price: 1 credit per record, minimum 3 credits ($0.003) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/hacker-news/users/id/comments/get
- Docs: https://docs.unifapi.com/api/hacker-news/users/id/comments/get

### List a Hacker News user's favorites

`GET /hacker-news/users/{id}/favorites`

Returns the stories and comments a Hacker News user has marked as public favorites. Paginate with `cursor`. Returns `not_found` when the user does not exist.

- Price: 1 credit per record, minimum 3 credits ($0.003) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/hacker-news/users/id/favorites/get
- Docs: https://docs.unifapi.com/api/hacker-news/users/id/favorites/get

### List a Hacker News user's submissions

`GET /hacker-news/users/{id}/submissions`

Returns a Hacker News user's stories, polls and jobs, newest first. Paginate with `cursor`. Returns `not_found` when the user does not exist.

- Price: 1 credit per record, minimum 3 credits ($0.003) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/hacker-news/users/id/submissions/get
- Docs: https://docs.unifapi.com/api/hacker-news/users/id/submissions/get

## Related APIs

- [News API](https://unifapi.com/apis/news/index.md) — Articles, top stories, publishers
- [Reddit API](https://unifapi.com/apis/reddit/index.md) — Subreddits, posts, comments, feeds, search
- [Twitter / X API](https://unifapi.com/apis/twitter/index.md) — Users, posts, search, trends, lists, communities
- [GitHub API](https://unifapi.com/apis/github/index.md) — Users, repositories, contributions, trending
