# Hacker News Scraper — Stories, Comments & Who Is Hiring Jobs (`jeffev/hacker-news-scraper`) Actor

Search Hacker News stories, comments, Ask HN and Show HN by keyword with date range and minimum points, beyond the 1,000-result limit. Or turn any month's 'Who is hiring?' thread into structured job posts with company, remote flag, links and emails.

- **URL**: https://apify.com/jeffev/hacker-news-scraper.md
- **Developed by:** [Jefferson Valandro](https://apify.com/jeffev) (community)
- **Categories:** Jobs, News, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.21 / 1,000 story or comments

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Hacker News Scraper — Stories, Comments & Who Is Hiring Jobs

Two tools in one:

1. **Search Hacker News** stories, comments, Ask HN and Show HN by keyword, with **date range, minimum points and ordering**. Sorting by date goes **beyond the 1,000-result limit** of the HN search API (the actor walks back in time window by window).
2. **"Ask HN: Who is hiring?" jobs**: turn any month's thread into **structured job posts**: company, headline, remote/onsite flags, visa mention, **emails and links**, full text, author and date. Filter by keywords and remote.

Built for **brand and competitor monitoring, trend research, dataset building, recruiters and job boards**.

### Input

All stories mentioning Postgres since January, newest first:

```json
{
  "mode": "search",
  "query": "postgres",
  "itemType": "story",
  "sort": "date",
  "sinceDate": "2026-01-01",
  "maxItems": 3000
}
```

Remote Python jobs from the latest "Who is hiring?":

```json
{
  "mode": "hiring",
  "keywords": ["python"],
  "remoteOnly": true
}
```

Use `hiringMonth` (e.g. `"September 2026"`) for an older thread.

### Output

**Search mode** (one item per story or comment):

| Field | Description |
|---|---|
| `type` | `story` or `comment` |
| `id`, `hnUrl`, `title`, `url` | item and link (for comments, the parent story's title and link) |
| `author`, `points`, `comments`, `createdAt` | metadata |
| `text` | comment or story text, without HTML |
| `storyId`, `parentId` | thread position (comments) |

**Hiring mode** (one item per job post):

| Field | Description |
|---|---|
| `company`, `headline`, `headlineParts` | first line of the post, split on `\|` |
| `remote`, `onsite`, `visa` | flags read from the post |
| `emails`, `links` | contacts found in the text |
| `text`, `author`, `postedAt`, `url` | the post |
| `thread`, `threadUrl` | which "Who is hiring?" thread |

### Example output

One real item from a test run (long texts and lists shortened):

```json
{
  "type": "hiring-post",
  "company": "Sidekick Labs",
  "headline": "Sidekick Labs | Senior SWE, R&D Engineer, Intelligence Engineer | REMOTE (US Timezones) | Full-time | $170k to $230k Base + Equity + Health",
  "headlineParts": [
    "Sidekick Labs",
    "Senior SWE, R&D Engineer, Intelligence Engineer",
    "REMOTE (US Timezones)"
  ],
  "remote": true,
  "onsite": false,
  "visa": false,
  "emails": [
    "eric+hn@sidekicklabs.com"
  ],
  "links": [
    "https://www.linkedin.com/in/three-two-one",
    "https://sidekicklabs.com"
  ],
  "text": "Sidekick Labs | Senior SWE, R&D Engineer, Intelligence Engineer | REMOTE (US Timezones) | Full-time | $170k to $230k Base + Equity + Health\n\nSidekick builds ...",
  "author": "mcintyem",
  "postedAt": "2026-10-01T15:03:36.000Z",
  "url": "https://news.ycombinator.com/item?id=49922609",
  "thread": "Ask HN: Who is hiring? (October 2026)",
  "threadUrl": "https://news.ycombinator.com/item?id=49922569"
}
```

### Tips

- **Relevance** ordering returns at most 1,000 results; switch to **Newest first** for complete history.
- `minPoints` keeps only stories that got traction (e.g. 100+).
- Schedule the hiring mode on the 2nd of each month to get each new thread.

### Feedback

Found a problem or need a field? Open an issue in the **Issues** tab: every issue is read and answered. If the actor helped you, a review on the Store helps a lot.

### How much does it cost?

You pay only for results delivered, at a fixed price per item. **Apify platform usage is included** in that price, so there are no compute costs on top. Errors and items that couldn't be found are free.

| What you get | Price | Example |
|---|---|---|
| Who is hiring job post | $0.001 each | 1,000 who is hiring job posts = $1.00 |
| Story or comment | $0.0003 each | 1,000 stories or comments = $0.30 |

The Apify **Free plan includes $5 of monthly credit**, enough for about **5,000 who is hiring job posts** per month at no cost. You can also set a maximum spend per run.

On paid Apify plans it gets cheaper automatically: **10% off on Starter, 20% on Scale and 30% on Business**.

# Actor input Schema

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

Search HN content, or extract the job posts of a monthly 'Ask HN: Who is hiring?' thread.

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

Search mode: keywords to search (e.g. 'postgres', 'YC', 'your brand name'). Empty = everything.

## `itemType` (type: `string`):

Search mode: what to search.

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

How many results to return (sorting by date can go beyond 1,000).

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

Search mode: ordering. Newest first can walk back in time without the 1,000-result limit.

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

Search mode: only stories with at least this many points.

## `sinceDate` (type: `string`):

Search mode: only items created on or after this date (YYYY-MM-DD).

## `untilDate` (type: `string`):

Search mode: only items created before this date (YYYY-MM-DD).

## `hiringMonth` (type: `string`):

Hiring mode: month and year like 'October 2026'. Empty = the latest thread.

## `keywords` (type: `array`):

Hiring mode: keep posts mentioning any of these words (e.g. 'python', 'rust', 'Berlin').

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

Hiring mode: keep posts marked REMOTE.

## Actor input object example

```json
{
  "mode": "search",
  "query": "open source",
  "itemType": "story",
  "maxItems": 50,
  "sort": "relevance",
  "remoteOnly": false
}
```

# Actor output Schema

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

Stories, comments or hiring posts (field 'type').

# 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 = {
    "query": "open source",
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("jeffev/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 = {
    "query": "open source",
    "maxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("jeffev/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 '{
  "query": "open source",
  "maxItems": 50
}' |
apify call jeffev/hacker-news-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jeffev/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/svCapmosOoADK86aF/builds/dWEAN13y9aiZLYhaE/openapi.json
