# Hacker News Scraper: Stories, Comments & Who is Hiring (`rjmacarthy/hacker-news-scraper`) Actor

Hacker News search, front page, Ask/Show HN and comment threads via the official HN Algolia API, plus parsed "Who is hiring?" job posts (company, role, remote, salary range, tech). Only-new mode for keyword alerts. No login, no browser.

- **URL**: https://apify.com/rjmacarthy/hacker-news-scraper.md
- **Developed by:** [rj](https://apify.com/rjmacarthy) (community)
- **Categories:** News, Jobs, MCP servers
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.40 / 1,000 story scraped

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/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

## Hacker News Scraper: Stories, Comments, Search & Who is Hiring Jobs

Get **Hacker News stories, comments and "Who is hiring?" job posts in one Actor**, through the official public HN search API (Algolia). Search any keyword by date or relevance with points, comments, date and domain filters, read the current front page, Ask HN, Show HN and job lists, pull full comment threads with depth and parent, or turn the monthly **"Ask HN: Who is hiring?"** thread into clean job rows with company, roles, locations, remote flag, **parsed salary range**, visa sponsorship and tech keywords. Most HN Actors do just one of these. This one does all four and charges **$0.0004 per story** and **$0.001 per parsed job post**, against $0.00175+ per story and $0.002-0.003 per job elsewhere. Turn on **only new items** with a schedule for keyword alerts: each run outputs, and charges for, only what the last run didn't already return.

### What data can you get

| Row type (`itemType`) | Fields |
|---|---|
| `story` | `id`, `type` (story / ask / show / job / poll), `title`, `url`, `domain`, `hnUrl`, `author`, `points`, `numComments`, `createdAt`, `storyText` (Ask/Show HN text), `tags`, `searchQuery`, `list` |
| `comment` | `id`, `storyId`, `storyTitle`, `parentId`, `author`, `text` (plain text, full links), `createdAt`, `depth` (1 = reply to the story), `hnUrl` |
| `hiring-post` | `company`, `roles[]`, `locations[]`, `remote`, `onsite`, `visa`, `employmentType`, `salaryText`, `salaryMin`, `salaryMax`, `currency`, `salaryPeriod`, `techKeywords[]`, `applyUrl`, `headerLine`, `text`, `author`, `postedAt`, `commentUrl`, `threadId`, `threadMonth` |

Every row also has `url` and `scrapedAt`. Dates are ISO 8601, numbers are numbers, missing values are `null`. Email addresses and phone numbers in any text are replaced with `[removed]`.

### Use cases

- **Brand and competitor monitoring:** schedule a daily search for your product name over stories and comments with `onlyNewItems` on, and send new mentions to Slack.
- **Launch tracking:** follow your Show HN or launch post's points and comments, or collect every story that links to your domain.
- **Tech job market data:** every monthly Who is hiring thread as structured rows. Filter by keyword (rust, python, "machine learning") or remote-only, and compare salary ranges month to month.
- **Research and AI datasets:** comment threads with depth and parent IDs for sentiment analysis, topic modelling or RAG.
- **Content curation:** the top stories about a topic above a points threshold, for newsletters.

### How to use

Pick a **mode**, fill in that section and run. Examples:

**Newest stories about a keyword (the prefill)**

```json
{ "mode": "search", "queries": ["rust"], "sortBy": "date", "maxItems": 15 }
```

**Popular GitHub projects on HN (100+ points, newest first)**

```json
{ "mode": "search", "domain": "github.com", "minPoints": 100, "sortBy": "date", "maxItems": 20 }
```

**Every comment mentioning your brand in the last 30 days, only new ones on each run**

```json
{ "mode": "search", "queries": ["supabase"], "searchIn": "comments", "since": "30 days", "maxItems": 100, "onlyNewItems": true }
```

**Front page with the first 20 comments of each story (thread order)**

```json
{ "mode": "front", "lists": ["front_page"], "includeComments": true, "maxCommentsPerStory": 20, "maxItems": 30 }
```

**Remote Rust jobs from the latest Who is hiring thread**

```json
{ "mode": "whoIsHiring", "months": 1, "jobKeywords": ["rust"], "remoteOnly": true, "maxItems": 50 }
```

**All job posts from the last 3 months**

```json
{ "mode": "whoIsHiring", "months": 3, "maxItems": 0 }
```

Inputs worth knowing:

- `searchIn`: `stories`, `comments` or `both`. `sortBy`: `date` (newest first) or `relevance`.
- `since` / `until`: an ISO date (`2026-11-01`) or a relative time (`24 hours`, `7 days`, `3 months`).
- `minPoints`, `minComments`, `domain` apply to stories.
- `maxItems` is per query, list or thread (0 = no limit). Story comments are capped separately by `maxCommentsPerStory`.
- `threadIds` reads specific Who is hiring threads (IDs or `news.ycombinator.com/item?id=` URLs).

### Output example

Real rows from a local run (comment text and some job fields shortened):

```json
[
  {
    "itemType": "story",
    "id": 50648365,
    "type": "story",
    "title": "Bare Metal Qwen",
    "url": "https://github.com/alesha-pro/llm.asm/tree/main/02-baremetal-os",
    "domain": "github.com",
    "hnUrl": "https://news.ycombinator.com/item?id=50648365",
    "author": "miohtama",
    "points": 174,
    "numComments": 39,
    "createdAt": "2026-11-25T22:15:34.000Z",
    "storyText": null,
    "tags": [
      "story",
      "front_page"
    ],
    "searchQuery": null,
    "list": null,
    "scrapedAt": "2026-11-26T12:34:51.870Z"
  },
  {
    "itemType": "comment",
    "id": 50644863,
    "storyId": 50644817,
    "storyTitle": "1Password Security Incident",
    "parentId": 50644817,
    "author": "tom1337",
    "text": "> 1Password began investigating indications that an attacker gained access to an employee’s corporate GitHub account. Th...",
    "createdAt": "2026-11-25T17:23:09.000Z",
    "depth": 1,
    "hnUrl": "https://news.ycombinator.com/item?id=50644863",
    "url": "https://news.ycombinator.com/item?id=50644863",
    "searchQuery": null,
    "scrapedAt": "2026-11-26T12:34:59.288Z"
  },
  {
    "itemType": "hiring-post",
    "company": "Postscript (YC W19)",
    "roles": [
      "Senior Software Engineer",
      "Full Stack"
    ],
    "locations": [
      "US, Canada"
    ],
    "remote": true,
    "onsite": false,
    "visa": null,
    "employmentType": "Full-time",
    "salaryText": "$180K to $220K base + equity",
    "salaryMin": 180000,
    "salaryMax": 220000,
    "currency": "USD",
    "salaryPeriod": "year",
    "techKeywords": [
      "Rust"
    ],
    "applyUrl": "https://www.ycombinator.com/companies/postscript/jobs/ktOBqUe-senior-software-engineer-full-stack",
    "commentUrl": "https://news.ycombinator.com/item?id=50340820",
    "threadMonth": "2026-11"
  }
]
```

See `samples/sample-output.json` for complete rows. The dataset has three views: **Stories**, **Comments** and **Who is hiring jobs**.

### Pricing

Pay per event, no subscription:

| Event | Price | Charged when |
|---|---|---|
| `story` | $0.0004 | One story, Ask HN, Show HN, job or poll row is saved |
| `comment` | $0.0001 | One comment row is saved |
| `hiring-post` | $0.001 | One parsed Who is hiring job post is saved |

A tiny Actor start fee also applies. Worked examples, before that fee:

- **1,000 stories:** 1,000 × $0.0004 = **$0.40**
- **The 30 front-page stories with 50 comments each:** $0.012 + 1,500 × $0.0001 = **$0.16**
- **One month of Who is hiring (~230 job posts):** about **$0.23**

Items skipped by `onlyNewItems` are never charged, and the same item is never charged twice in a run. The Actor stops cleanly at your **Maximum cost per run**.

### Tips and limits

- **1,000 results per query.** The HN search API returns at most 1,000 hits per query. To go further back, split the search with `since` / `until` date ranges (the run summary warns when a query has more).
- **Exact words.** Typo tolerance is off, so "rust" doesn't also match "gust". Search matches titles, URLs, story text and author names.
- **Front page order** comes from the search API and can differ slightly from the live HN ranking.
- **Who is hiring parsing is best effort.** It reads the "Company | Role | Location | REMOTE | Salary" header line. Posts are free-form, so some fields will be wrong or empty. `headerLine` and `text` are always included so you can check. Posts with no header line are kept, with null header fields. Salaries stay in the stated period (`salaryPeriod`: year, month, day or hour) and are not converted. Replies to job posts are not output.
- **Only "Who is hiring?".** "Who wants to be hired?" and "Freelancer?" threads list individuals, so they are not supported, and their comments are skipped in search and comment results too.
- **onlyNewItems** remembers items for 120 days per input (the same queries and filters; changing `maxItems` keeps the state). It outputs anything not returned before, so a first run with a small `maxItems` is followed by older items on the next run. Use `since` for alerts on new posts only.
- **Comments of stories skipped as already seen** are not fetched again in only-new mode.
- No user profiles, karma or "about" text (on purpose).

### FAQ

**Is it legal?**
The Actor reads public Hacker News data through HN's public, documented search API, with no login. HN usernames are public handles. Email addresses and phone numbers are removed from all text, and user profiles are not scraped. You are responsible for using the data lawfully, including under the GDPR.

**Do I need a proxy?**
No. The API answers Apify datacenter IPs. Residential proxies are not supported: if you select them, the Actor logs a warning and uses Apify datacenter proxy instead.

**Why did I get more rows than `maxItems`?**
The limit is per query, list or thread, and comments from `includeComments` are counted separately (`maxCommentsPerStory`).

**Can I get the full history of a keyword?**
Yes, in date ranges of up to 1,000 results each. Use `since` and `until`, for example a month at a time.

**How fresh is the data?**
The search API usually indexes new stories and comments within minutes. Points and comment counts are as of the run.

### Integrations

Use the results through the [Apify API](https://docs.apify.com/api/v2), or connect the Actor to **Make**, **Zapier**, **n8n**, Google Sheets, Slack and webhooks. AI agents can call it through the [Apify MCP server](https://mcp.apify.com).

### Changelog

- **0.1:** First release. Search, front lists, comment threads, parsed Who is hiring job posts and an only-new-items mode.

### More scrapers by the same developer

- [Indeed Jobs Scraper - Salaries, Companies & New-Job Monitor](https://apify.com/rjmacarthy/indeed-scraper)
- [Computrabajo Scraper - LatAm Jobs (MX, CO, AR, PE, CL...)](https://apify.com/rjmacarthy/computrabajo-scraper)
- [Internshala Scraper - Internships & Jobs in India](https://apify.com/rjmacarthy/internshala-scraper)
- [JobStreet & JobsDB Scraper - Asia Jobs (MY, SG, PH, ID, HK, TH)](https://apify.com/rjmacarthy/jobstreet-jobsdb-scraper)
- [Welcome to the Jungle Jobs Scraper - Salary, Remote, Company](https://apify.com/rjmacarthy/welcome-to-the-jungle-scraper)
- [Apna Jobs Scraper - India Jobs by Keyword, City & Category](https://apify.com/rjmacarthy/apna-jobs-scraper)

Browse all my Actors on [my Apify Store profile](https://apify.com/rjmacarthy).

### Support

Found a problem or need a field? Open an issue on the Issues tab with your input and run ID.

# Actor input Schema

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

Search: stories and/or comments matching your keywords. Front lists: the current front page, Ask HN, Show HN or job lists. Who is hiring: parsed job posts from the monthly "Ask HN: Who is hiring?" threads.

## `queries` (type: `array`):

Search mode: one search per keyword or phrase (titles, URLs, story text and authors are searched). Each query returns up to "Max items per source".

## `searchIn` (type: `string`):

Search mode: stories, comments, or both (two searches per query).

## `sortBy` (type: `string`):

Search mode: newest first (date) or best match (relevance, which favours popular items).

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

Search mode, stories only: skip stories with fewer points. 0 = no minimum.

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

Search mode, stories only: skip stories with fewer comments. 0 = no minimum.

## `since` (type: `string`):

Search mode: only items posted on or after this time. An ISO date (2026-11-01) or a relative time ("24 hours", "7 days", "3 months"). Empty = no limit.

## `until` (type: `string`):

Search mode: only items posted on or before this time (same formats as "Posted since"). Combine both to split a big search into date ranges.

## `domain` (type: `string`):

Search mode, stories only: keep stories that link to this site (subdomains included), e.g. github.com. With no query, finds every story linking to the domain.

## `lists` (type: `array`):

Front mode: which lists to read. front_page = the current front page, ask_hn / show_hn / job = newest Ask HN, Show HN and YC job posts.

## `months` (type: `integer`):

Who is hiring mode: how many recent monthly "Ask HN: Who is hiring?" threads to read (1 = the latest month).

## `threadIds` (type: `array`):

Who is hiring mode: read these threads instead (HN item IDs or news.ycombinator.com/item?id= URLs). Only "Ask HN: Who is hiring?" threads posted by whoishiring are accepted.

## `jobKeywords` (type: `array`):

Who is hiring mode: keep posts that mention ANY of these words (case-insensitive), e.g. rust, python, "machine learning". Empty = all posts.

## `remoteOnly` (type: `boolean`):

Who is hiring mode: keep only posts whose header says REMOTE.

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

Search (stories) and front modes: also output the comment thread of every story, one row per comment with its depth and parent. Costs one extra request per story.

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

With "Include comments": stop after this many comments per story (thread order). 0 = all.

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

Maximum stories, comments (search) or job posts per query, list or thread. Story comments are capped separately. 0 = no limit (the HN search API stops at 1,000 per query).

## `onlyNewItems` (type: `boolean`):

Output (and charge) only items this same input has not output before. State is kept in the named key-value store "hacker-news-scraper-state" for 120 days. Use it with a schedule for keyword alerts.

## `maxConcurrency` (type: `integer`):

How many API requests run at the same time.

## `proxyConfiguration` (type: `object`):

Usually not needed: the HN Algolia API answers Apify datacenter IPs. Residential proxies are not supported: if you select the RESIDENTIAL group, the Actor uses Apify datacenter proxy instead.

## Actor input object example

```json
{
  "mode": "search",
  "queries": [
    "rust"
  ],
  "searchIn": "stories",
  "sortBy": "date",
  "minPoints": 0,
  "minComments": 0,
  "lists": [
    "front_page"
  ],
  "months": 1,
  "remoteOnly": false,
  "includeComments": false,
  "maxCommentsPerStory": 50,
  "maxItems": 15,
  "onlyNewItems": false,
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `stories` (type: `string`):

Story rows: title, link, points, comments, author.

## `comments` (type: `string`):

Comment rows with depth and parent.

## `hiring` (type: `string`):

Parsed job posts: company, roles, remote, salary, tech.

## `all` (type: `string`):

Every row and field.

## `summary` (type: `string`):

Per-source status, counts and request statistics.

# 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": "search",
    "queries": [
        "rust"
    ],
    "sortBy": "date",
    "maxItems": 15,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("rjmacarthy/hacker-news-scraper").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": "search",
    "queries": ["rust"],
    "sortBy": "date",
    "maxItems": 15,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("rjmacarthy/hacker-news-scraper").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": "search",
  "queries": [
    "rust"
  ],
  "sortBy": "date",
  "maxItems": 15,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call rjmacarthy/hacker-news-scraper --silent --output-dataset

```

## MCP server setup

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

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/mPSgmXLombgRS1QJI/builds/c4aODTyDc4yieZNyc/openapi.json
