# Hacker News API – Search, Front Page & Users

Search every Hacker News story and comment by keyword, date and points, or pull the live Top, New, Best, Ask, Show and Jobs feeds. Returns title, URL, author, points, comment count, text and dates. Official APIs, no blocks.

$0.24 per 1,000 items

[Get an API key](https://pushbuild.com/apis/app/signup?api=hacker-news)

Example request

```
POST /hacker-news/run
{
  "searchQueries": [
    "rust",
    "openai"
  ],
  "maxItems": 20
}
```

## What a response looks like

POST /hacker-news/run{"maxItems": 5, "searchQueries": ["rust", "openai"]}

```
{"count": 5, "items": [{ "author": "Sikul", "comments": 642, "createdAt": "2020-02-04T17:30:40Z", "hnUrl": "https://news.ycombinator.com/item?id=22238335", "id": 22238335, "parentId": null, "points": 1582, "query": "rust", "storyId": 22238335, "tags": [ … ]}
```

`comments` by `author` in this sample response

| author | comments | createdAt | hnUrl | id | parentId |
| --- | --- | --- | --- | --- | --- |
| Sikul | 642 | 2020-02-04T17:30:40Z | https://news.ycombinator.com/item?id=22238335 | 22,238,335 |  |
| darthdeus | 972 | 2024-04-26T17:33:56Z | https://news.ycombinator.com/item?id=40172033 | 40,172,033 |  |
| selvan | 330 | 2021-01-02T05:50:39Z | https://news.ycombinator.com/item?id=25610741 | 25,610,741 |  |
| jhund | 306 | 2015-05-15T17:02:09Z | https://news.ycombinator.com/item?id=9551937 | 9,551,937 |  |
| formalsystem | 264 | 2019-04-05T15:18:45Z | https://news.ycombinator.com/item?id=19583384 | 19,583,384 |  |

Real rows returned by this API on 2026-11-09 for the request shown.

## What it returns

Search every Hacker News story and comment, or pull the live front page and other lists, as clean JSON.

- **Search** all stories, comments, Ask HN, Show HN, jobs or polls by keyword, sorted by relevance or newest, with date range and minimum points filters.
- **Live feeds**: Top, New, Best, Ask, Show and Jobs, in their current rank order.
- **User profiles**: karma, account age, about text and submission count.

Each item has `id`, `type`, `title`, `url`, `text`, `author`, `points`, `comments`, `createdAt`, `hnUrl` and the `query` that produced it.

## Common uses

Brand and competitor monitoring, launch tracking, trend research, lead generation from Show HN and hiring threads.

## Request

`POST https://api.pushbuild.com/hacker-news/run` with a JSON body. Send your key in the `X-API-Key` header.

| Field | Type | Description |
| --- | --- | --- |
| `searchQueries` | list of strings | Keywords to search all of Hacker News for. |
| `itemType` | string: story, comment, ask, show, job, poll | Which kind of item to search. Default: `"story"`. |
| `sort` | string: relevance, date | Order of search results. Default: `"relevance"`. |
| `fromDate` | string | Only items created on or after this date (YYYY-MM-DD). |
| `untilDate` | string | Only items created on or before this date (YYYY-MM-DD). |
| `minPoints` | integer | Only stories with at least this many points. |
| `feeds` | list of strings | Current Hacker News lists: top, new, best, ask, show, job. |
| `users` | list of strings | Hacker News usernames to look up (karma, created, about). |
| `maxItemsPerQuery` | integer | Search returns up to 1,000 per query; feeds up to 500. Default: `100`. |
| `maxItems` | integer | Maximum items to return (1-500). Default: `100`. |

### Example

```
curl -X POST https://api.pushbuild.com/hacker-news/run \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"searchQueries": ["rust", "openai"], "maxItems": 20}'
```

### Response

```
{"count": 20, "truncated": false, "seconds": 1.4, "items": [ { ... } ]}
```

Each call returns up to 500 items. Records that fail validation or are not found are flagged in the items and not charged.

## Pricing

Pay only for results returned: $0.24 per 1,000 items. No charge for errors or empty searches.

| Items | Cost |
| --- | --- |
| 1,000 | $0.24 |
| 10,000 | $2.40 |
| 100,000 | $24.00 |
| 1,000,000 | $240.00 |
| 4,166 a month | Free ($1 monthly credit) |

## Use it from Claude, ChatGPT or Cursor

This API is also an MCP server: `https://api.pushbuild.com/mcp/hacker-news`. Add it to any assistant that supports remote MCP servers, with your key in the `X-API-Key` header. Same prices. [Setup for each app](https://pushbuild.com/apis/mcp.html).

## Related APIs

- [USGS Earthquakes API](https://pushbuild.com/apis/usgs-earthquakes.html): Search every earthquake recorded by the USGS by date, magnitude, depth, location radius or bounding box, or pull the live past-hour, day, week and month feeds.
- [US Poll Releases Feed API](https://pushbuild.com/apis/poll-releases.html): New US election poll releases from pollsters' own feeds (Emerson, InsiderAdvantage, Trafalgar, Marist, Data for Progress, Quantus, UNH) plus news coverage of NYT/Siena, Fox, Quinnipiac, AtlasIntel, Marquette, Cygnal: exact release time, states, offices, headline numbers..
- [Google News API](https://pushbuild.com/apis/google-news.html): Fast Google News results for any keyword, topic or country: title, source, publish time, snippet and link.
- [Hurricane Tracker API](https://pushbuild.com/apis/hurricane-tracker.html): Official NOAA National Hurricane Center data: active tropical storms and hurricanes, 2- and 7-day formation outlooks, and every Atlantic (1851+) and Pacific (1949+) storm's best track: winds, pressure, category, landfalls, ACE and wind radii.
- [Google Trends API](https://pushbuild.com/apis/google-trends.html): Google Trends data for any keywords: interest over time, interest by country/state, related queries and topics (top and rising), plus today's trending searches.
- [Internet Outage API](https://pushbuild.com/apis/internet-outages.html): Internet outage alerts from IODA (Georgia Tech): connectivity drops by country, region and network detected from BGP routing, active probing and darknet traffic, with severity, value versus baseline and percent drop..

## Tell us what you need built.

Questions about this API, higher volumes, or a data source you need that we don't cover yet.

[hello@pushbuild.com](mailto:hello@pushbuild.com?subject=API%20question)

## New APIs and data, twice a month

New data APIs, coverage changes and analysis from Pushbuild. No spam; one click to leave.

---
As of 2026-12-03. Source: https://pushbuild.com/apis/hacker-news.html
