# Hacker News Scraper: Search, Comments & Who Is Hiring Jobs (`tali-works/hacker-news-scraper`) Actor

Search Hacker News stories and comments (any date range, points filter), get the front page, export full comment threads, or parse the monthly 'Who is hiring?' thread into structured job posts with company, role, location, remote, salary and emails. $1 per 1,000 items.

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

## Pricing

Pay per event

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

## Hacker News Scraper: Search, Comment Threads & "Who Is Hiring?" Jobs

Export **Hacker News** data in clean, structured form:

- **Search stories, comments, Ask HN, Show HN, jobs and polls** by keyword and **date range**, with a **points filter**, sorted by relevance or newest first (no 1,000-result cap on date sort).
- **Front page** snapshot.
- **Full comment threads** (every nested comment with depth and parent) for any HN item.
- **The monthly "Who is hiring?" thread parsed into job posts**: company, roles, location, remote/onsite/hybrid, visa, **salary range**, links and **contact emails**. "Who wants to be hired?" and "Freelancer?" threads are supported too.

**$1 per 1,000 items.** No login, API key or proxies needed.

### Why this Actor

- **Hiring posts come pre-structured.** Other Actors charge up to $20 per 1,000 for "Who is hiring" posts; here they're $1 per 1,000 with salary and email extraction.
- **Complete history.** Newest-first search walks back through time, so you can export everything about a topic.
- **Discussion analysis.** Export full threads with depth for sentiment, research or LLM training.
- **Official data:** the Algolia HN Search API that powers hn.algolia.com, so it's fast and reliable.

### Input

| Field | Description |
|---|---|
| `searchQueries` | Keywords. |
| `itemTypes` | `story`, `comment`, `ask_hn`, `show_hn`, `job`, `poll`. |
| `sort` | `relevance` or `date`. |
| `from` / `to` | Date range. |
| `minPoints` | Points filter for search results (not applied to comment threads; HN doesn't expose comment points). |
| `fuzzyMatch` | Off by default (exact keyword match, so `shopify` doesn't also return "Spotify"). Turn on for typo-tolerant search. |
| `frontPage` | Export the front page. |
| `commentThreads` | HN item URLs/IDs to export comments for. |
| `whoIsHiring` | `whoishiring`, `whowantstobehired`, `freelancer`. |
| `hiringKeywords` / `hiringRemoteOnly` | Hiring post filters. |
| `maxItemsPerQuery` / `maxTotalItems` | Cost caps. |

```json
{ "whoIsHiring": "whoishiring", "hiringKeywords": ["python", "rust"], "hiringRemoteOnly": true }
```

### Output

Hiring post:

```json
{
  "type": "hiring_post", "id": "49922609", "hnUrl": "https://news.ycombinator.com/item?id=49922609",
  "thread": "Ask HN: Who is hiring? (October 2026)", "company": "Sidekick Labs",
  "roles": ["Senior SWE, R&D Engineer, Intelligence Engineer"], "location": "REMOTE (US Timezones)", "remote": true,
  "salaryMin": 170000, "salaryMax": 230000, "salaryCurrency": "USD", "salaryText": "$170k to $230k",
  "urls": ["https://..."], "emails": ["eric+hn@sidekicklabs.com"], "text": "Sidekick Labs | Senior SWE ..."
}
```

Story or comment:

```json
{ "type": "story", "id": "4058874", "title": "HackerNews API: ...", "url": "http://...", "hnUrl": "https://news.ycombinator.com/item?id=4058874",
  "author": "sathish316", "points": 132, "numComments": 49, "createdAt": "2012-06-02T19:16:33Z", "text": null }
```

### Pricing

**$1.00 per 1,000 items** (stories, comments or hiring posts), plus $0.00005 per run start.

### Notes

Hiring posts are free-form text, so the parsing is best effort; the original `text` is always included.

# Actor input Schema

## `searchQueries` (type: `array`):

Keywords to search (Algolia HN search). Use an empty string to list everything in the date range.

## `itemTypes` (type: `array`):

What to search. Default: stories.

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

Relevance search is capped at 1,000 results per query by HN's search; date sort can page through everything.

## `from` (type: `string`):

Only items created on or after this date.

## `to` (type: `string`):

Only items created on or before this date.

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

Search only: skip stories with fewer points (not billed). Not applied to comment threads, because HN doesn't expose comment points.

## `fuzzyMatch` (type: `boolean`):

Off (default): keywords must match exactly, so 'shopify' won't also return 'Spotify'. Turn on for typo-tolerant search like hn.algolia.com.

## `frontPage` (type: `boolean`):

Also export the current HN front page.

## `commentThreads` (type: `array`):

HN item URLs or IDs; exports every comment (with depth and parent) of each thread.

## `whoIsHiring` (type: `string`):

Export the latest monthly thread. 'Who is hiring?' posts are parsed into company, roles, location, remote, salary, URLs and emails.

## `hiringKeywords` (type: `array`):

Hiring thread: keep posts mentioning any of these (e.g. python, rust, data).

## `hiringRemoteOnly` (type: `boolean`):

Hiring thread: keep only posts marked remote.

## `maxItemsPerQuery` (type: `integer`):

Default 1,000.

## `maxTotalItems` (type: `integer`):

Hard cap for the whole run, to control cost.

## Actor input object example

```json
{
  "searchQueries": [
    "apify"
  ],
  "sort": "relevance",
  "fuzzyMatch": false,
  "frontPage": false,
  "whoIsHiring": "off",
  "hiringRemoteOnly": false,
  "maxItemsPerQuery": 100
}
```

# Actor output Schema

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

All results in the default dataset.

# 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 = {
    "searchQueries": [
        "apify"
    ],
    "maxItemsPerQuery": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("tali-works/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 = {
    "searchQueries": ["apify"],
    "maxItemsPerQuery": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("tali-works/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 '{
  "searchQueries": [
    "apify"
  ],
  "maxItemsPerQuery": 100
}' |
apify call tali-works/hacker-news-scraper --silent --output-dataset

```

## MCP server setup

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