# Stories, Search and Who Is Hiring for Hacker News (`forgeloop/hacker-news-api`) Actor

Get top, new, best, Ask HN, Show HN and job stories for Hacker News, run full text search with filters and read Who is hiring job posts with company and remote hints. Official HN API and HN Search API. Pay per item. Not affiliated with Y Combinator or Hacker News.

- **URL**: https://apify.com/forgeloop/hacker-news-api.md
- **Developed by:** [Markus Heiß](https://apify.com/forgeloop) (community)
- **Categories:** News, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 items

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Stories, Search and Who Is Hiring for Hacker News

Get stories, comments and job posts for Hacker News as clean JSON. Read the front page and the other story lists, run a full text search with date, points and comment filters, or pull every job post from the monthly "Ask HN: Who is hiring?" thread with company, remote and location hints.

The Actor reads the official Hacker News API and the HN Search API by Algolia. It does not scrape the Hacker News website. No API key needed. Not affiliated with Y Combinator or Hacker News.

### What it does

- **Story lists:** top, new, best, Ask HN, Show HN and job stories, in the order Hacker News shows them, with their rank. Up to 500 stories per run.
- **Search:** full text search over stories and comments through the HN Search API. Filter by item type (story, comment, Ask HN, Show HN, job, poll), date range, minimum points and minimum comments. Sort by relevance or newest first. Up to 1,000 hits per run, the limit of the search API.
- **Who is hiring:** finds the latest "Ask HN: Who is hiring?" thread of the whoishiring account, or the thread of a month you choose, and returns its top level comments as job posts. Each post gets hints: company (the text before the first `|`), remote yes or no, locations and the URLs in the post. An optional keyword returns only posts that contain it, for example `rust` or `berlin`.
- **Comments:** turn on "Include comments" to also load the comment tree of each story, up to 50 comments per story by default.
- **Plain text:** HN HTML becomes readable text. Links show their full URL. Choose `html` to also get the original HTML, or `none` to leave the text out.
- **Privacy by default:** e-mail addresses and phone numbers in post and comment texts are masked.
- **Monitor mode:** returns only items that earlier runs did not return yet. Schedule it to get new stories, new mentions or new job posts.
- **Fast:** 10 parallel requests to the HN API, retries on rate limits and server errors. The 30 top stories take about 2 seconds.

### Use cases

- **Tech trend monitoring:** follow what reaches the front page, which domains get traction, and which topics gain points over time.
- **Brand mentions on HN:** search stories and comments for your product, company or competitor names. Run it daily with monitor mode and sort by date.
- **Launch tracking:** watch Show HN and Launch HN posts, their points and comments, and the discussion under your own launch.
- **Hiring data from Who is hiring:** collect every monthly job post with company, remote flag and locations for market research, job boards or recruiting analytics.
- **AI agents and RAG:** feed current Hacker News discussions as clean text into LLM pipelines, vector stores and agents.

### Input

| Field | Description | Default |
|---|---|---|
| Mode | `list`, `search` or `whoIsHiring` | `list` |
| Story list | List mode: `top`, `new`, `best`, `ask`, `show` or `job` | `top` |
| Max items | Stories, search hits or job posts. Comments come on top | 30 (list, max 500), 100 (search, max 1,000), 100 (Who is hiring, max 1,000) |
| Search query | Search mode: full text query. Who is hiring mode: optional keyword filter | empty |
| Item types | Search mode: any of `story`, `comment`, `ask_hn`, `show_hn`, `job`, `poll`, combined with OR | all |
| Sort | Search mode: `relevance` or `date` (newest first) | `relevance` |
| Date from, Date to | Search mode: `YYYY-MM-DD`, ISO date time, or relative like `7 days` or `24 hours` (UTC) | none |
| Minimum points, Minimum comments | Search mode: lower limits for stories | none |
| Who is hiring month | `2026-10` or `October 2026`. Empty means the latest thread | latest |
| Include comments | List and search mode: load the comments of each story | off |
| Max comments per story | 1 to 1,000 | 50 |
| Text format | `text`, `html` (text plus original HTML) or `none` | `text` |
| Mask e-mails and phone numbers | Replace them in all texts | on |
| Only new items (monitor mode) | Skip items earlier runs already returned | off |

Front page example:

```json
{
  "mode": "list",
  "list": "top",
  "maxItems": 30
}
```

Search example, new mentions of a name in stories and comments of the last 7 days:

```json
{
  "mode": "search",
  "query": "postgres",
  "tags": ["story", "comment"],
  "sort": "date",
  "dateFrom": "7 days",
  "maxItems": 100
}
```

Who is hiring example, posts that mention Python in the October 2026 thread:

```json
{
  "mode": "whoIsHiring",
  "month": "2026-10",
  "query": "python",
  "maxItems": 200
}
```

### Output

One dataset item per story or comment. All items have the same fields, so the CSV and Excel exports stay flat. A story from search mode:

```json
{
  "id": 22238335,
  "type": "story",
  "rank": null,
  "title": "Why Discord is switching from Go to Rust",
  "url": "https://blog.discordapp.com/why-discord-is-switching-from-go-to-rust-a190bbca2b1f",
  "domain": "blog.discordapp.com",
  "hnUrl": "https://news.ycombinator.com/item?id=22238335",
  "author": "Sikul",
  "points": 1582,
  "commentsCount": 642,
  "createdAt": "2020-02-04T17:30:40.000Z",
  "text": null,
  "html": null,
  "parentId": null,
  "storyId": null,
  "storyTitle": null,
  "depth": null,
  "job": null,
  "isNew": null,
  "error": null,
  "fetchedAt": "2026-11-14T16:16:34.278Z"
}
```

A job post from Who is hiring mode (shortened, made up example):

```json
{
  "id": 50300001,
  "type": "comment",
  "hnUrl": "https://news.ycombinator.com/item?id=50300001",
  "author": "examplecorp",
  "createdAt": "2026-11-03T09:12:00.000Z",
  "text": "Example Corp | Senior Backend Engineer | Austin, TX or REMOTE (US) | Full-time | https://example.com/jobs\n\nWe build tools for ... Apply at [email removed]",
  "parentId": 50338728,
  "storyId": 50338728,
  "storyTitle": "Ask HN: Who is hiring? (November 2026)",
  "depth": 1,
  "job": {
    "headline": "Example Corp | Senior Backend Engineer | Austin, TX or REMOTE (US) | Full-time | https://example.com/jobs",
    "company": "Example Corp",
    "remote": true,
    "locations": ["Austin, TX", "US"],
    "urls": ["https://example.com/jobs"]
  }
}
```

- `type` is `story`, `ask_hn` (Ask HN and Tell HN), `show_hn`, `job`, `poll` or `comment`.
- `rank` is the position on the Hacker News list in list mode, `null` in the other modes.
- `author` is the public HN username. `points` and `commentsCount` are `null` for comments, because HN does not publish comment scores.
- `text` is the plain text of Ask HN posts, job stories and comments. Link stories have no text. `html` is filled only with the text format `html`.
- **Comments are separate items,** not a nested array. Each comment follows its story and has `storyId`, `storyTitle`, `parentId` (the story or the comment it replies to) and `depth` (1 for direct replies). Comments load breadth first: direct replies first, then replies to replies, until "Max comments per story" is reached. This keeps the table flat and lets you filter stories and comments by `type`.
- `job` is filled only in Who is hiring mode. The hints are a best effort guess from the first line of the post. `company` is `null` when the first line has no `|`. `remote` is `null` when the post does not say.
- `isNew` is `true` in monitor mode and `null` otherwise.
- Deleted and flagged (dead) items are skipped. An item that cannot be loaded after 4 attempts returns an item with `error` set.

The dataset has two views: **Overview** for stories and comments, and **Who is hiring** with company, remote, locations and URLs as columns. Export as JSON, CSV or Excel, or read it through the Apify API.

### Monitor mode

With "Only new items" turned on, the Actor stores the IDs it returned in the named key-value store `hn-monitor`. The key combines the mode with a hash of the settings that change the result (list, query, item types, sort, point and comment filters, month, comments on or off), so different searches do not mix. The last 5,000 IDs per key are kept.

Each run looks at the same window as without monitor mode, for example the 50 newest stories, and returns only the items in that window that are new. The first run returns everything. With comments turned on, new comments under stories you already have are returned too. Sort by date in search mode for monitoring, so new items appear at the top of the window.

### Pricing

Pay per item: 0.001 USD per delivered story or comment, so 1.00 USD per 1,000 items. Items skipped by monitor mode and error items are free. You can cap the cost of a run with the maximum charge setting in Apify.

Each run also has a start fee of 0.00005 USD per GB of memory, which Apify shows as Actor Start.

### Limits

- The HN API lists hold at most 500 stories (top and new) or 200 stories (best, Ask, Show, jobs).
- The HN Search API returns at most 1,000 hits per query. Split long time ranges with "Date from" and "Date to" to get more.
- Search has no typo tolerance, so `rust` does not match `trust`. Prefixes still match, so `rust` also finds `rusty`.
- Search results and their points and comment counts can lag a few minutes behind Hacker News. List mode reads live data from the official API.
- Who is hiring hints are heuristics. Posts that do not follow the `Company | Role | Location` format get fewer hints. Always check the text.
- Text formatting is simplified. Code blocks keep their line breaks, but not their indentation.

### Data source, permitted use and legal

- **Data source:** the official Hacker News API (hacker-news.firebaseio.com, documented at github.com/HackerNews/API) and the HN Search API by Algolia (hn.algolia.com/api), which Hacker News links as its search. The Actor does not scrape the Hacker News website. Not affiliated with Y Combinator or Hacker News.
- **Usernames:** `author` is the public HN username that is shown next to every post. The Actor does not load user profiles.
- **Contact data masked:** e-mail addresses and phone numbers in post and comment texts are replaced with `[email removed]` and `[phone removed]` by default. The Who is hiring hints are taken from the masked text. If you turn masking off, you are responsible for any contact data in the results.
- **Content belongs to its authors:** stories, comments and job posts are written by Hacker News users and belong to them. Respect that. Quote with attribution and link back with `hnUrl`, and do not republish posts as your own.
- **Snapshot:** Results show the data at the time of the run. We do not guarantee that they are complete, current or correct.
- **For business use:** This Actor is offered to businesses only, not to consumers.
- **Permitted use:** Use the data for research, monitoring, analytics and your own products in line with the terms of the Hacker News API and the HN Search API. Do not use it to contact, profile or track individual users.
- **Your responsibility:** You choose the lists, queries and filters and decide what happens with the results. If the results contain personal data, you are the controller and need your own legal basis.
- **No circumvention:** The Actor uses public, unauthenticated endpoints only. It does not bypass rate limits or access restrictions.
- **Request volume:** At most 10 parallel requests to the HN API and 2 to the search API, and it waits when a server asks for it. Do not use it to put excessive load on these services.
- **Provider:** forgeloop, Markus Heiss, Austria. [Imprint](https://devhem.github.io/forgeloop-legal/imprint.html), [Privacy Notice](https://devhem.github.io/forgeloop-legal/privacy.html), [Terms of Use](https://devhem.github.io/forgeloop-legal/terms.html).

### Questions and issues

Open an issue on the Actor page.

# Actor input Schema

## `mode` (type: `string`):

"list" reads one of the Hacker News story lists. "search" runs a full text search through the HN Search API by Algolia. "whoIsHiring" returns the job posts of the latest (or a given) "Ask HN: Who is hiring?" thread.

## `list` (type: `string`):

List mode only. Which Hacker News list to read. Top and new hold up to 500 stories, the others up to 200.

## `maxItems` (type: `integer`):

Maximum number of stories (list mode), search hits (search mode) or job posts (Who is hiring mode). Comments loaded with "Include comments" come on top. Default 30 in list mode (max 500), 100 in search mode (max 1,000, the limit of the search API) and 100 in Who is hiring mode (max 1,000).

## `query` (type: `string`):

Search mode: full text query, for example "rust" or "openai". Leave empty to get the newest items that match the tags and filters. Who is hiring mode: optional keyword, only job posts that contain it are returned, for example "rust" or "berlin".

## `tags` (type: `array`):

Search mode only. Limit the search to these item types. Several types are combined with OR. Empty means all types.

## `sort` (type: `string`):

Search mode only. "relevance" puts the best matches with many points first. "date" puts the newest first, best for monitoring.

## `dateFrom` (type: `string`):

Search mode only. Only items created on or after this date (UTC). Format YYYY-MM-DD, an ISO date time, or a relative value like "7 days" or "24 hours".

## `dateTo` (type: `string`):

Search mode only. Only items created on or before this date (UTC, the whole day counts). Same formats as "Date from".

## `minPoints` (type: `integer`):

Search mode only. Only stories with at least this many points. Comments have no public points, so they never match this filter.

## `minComments` (type: `integer`):

Search mode only. Only stories with at least this many comments.

## `month` (type: `string`):

Who is hiring mode only. Month of the thread, for example "2026-10" or "October 2026". Empty means the latest thread.

## `includeComments` (type: `boolean`):

List and search mode. Also load the comments of each story. Comments are returned as separate items right after their story, with storyId, parentId and depth.

## `maxCommentsPerStory` (type: `integer`):

With "Include comments": the most comments loaded per story. Direct replies come first, then replies to replies.

## `contentFormat` (type: `string`):

"text" returns the text of Ask HN posts, jobs and comments as plain text. "html" also adds the original HN HTML in the field html. "none" leaves the text out.

## `maskContacts` (type: `boolean`):

Replace e-mail addresses and phone numbers in post and comment texts with \[email removed] and \[phone removed]. On by default.

## `monitorMode` (type: `boolean`):

Return only items that earlier runs with the same settings did not return yet. The IDs are kept in the named key-value store "hn-monitor" (the last 5,000 per setting). The first run returns everything. Schedule the Actor to watch a list, a search or the Who is hiring thread.

## Actor input object example

```json
{
  "mode": "list",
  "list": "top",
  "maxItems": 30,
  "sort": "relevance",
  "includeComments": false,
  "maxCommentsPerStory": 50,
  "contentFormat": "text",
  "maskContacts": true,
  "monitorMode": false
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "mode": "list",
    "list": "top",
    "maxItems": 30
};

// Run the Actor and wait for it to finish
const run = await client.actor("forgeloop/hacker-news-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "mode": "list",
    "list": "top",
    "maxItems": 30,
}

# Run the Actor and wait for it to finish
run = client.actor("forgeloop/hacker-news-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mode": "list",
  "list": "top",
  "maxItems": 30
}' |
apify call forgeloop/hacker-news-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,forgeloop/hacker-news-api"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Wsu1JFJ5POLuS475v/builds/kHjX0whc6ncInyzla/openapi.json
