# Hacker News Scraper: Search, Comments & Who's Hiring (`parth-tools/hacker-news-scraper`) Actor

Get Hacker News stories, comments, front page and parsed 'Who is hiring?' job posts via the official HN search API. Keyword search, points/date filters, full comment threads, remote/visa/salary flags. $0.20 per 1,000 items.

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

## Pricing

from $0.20 / 1,000 hacker news 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

## Hacker News Scraper – Search, Front Page, Comments & Who's Hiring

**Pull Hacker News data into clean JSON, CSV or Excel** — keyword search across all stories and comments since 2006, the current front page, complete comment threads, and the monthly **“Ask HN: Who is hiring?”** thread parsed into job posts with **remote / hybrid / onsite / visa / salary** flags.

Uses the official public Hacker News search API (by Algolia) — no scraping of news.ycombinator.com pages, no login, no proxies. **$0.20 per 1,000 items.**

### Modes

| Mode | What you get |
|---|---|
| **Search** | Stories, comments, Ask HN, Show HN, YC jobs or polls matching keywords; sort by relevance or date; filter by min points, min comments, date range. Date-sorted search goes beyond the API's 1,000-hit page limit. |
| **Front page** | Stories currently on the front page with points and comment counts |
| **Comments** | Every comment of one or more stories (flattened, with depth and parent IDs) |
| **Who is hiring** | Top-level job posts from the latest (or a chosen month's) “Who is hiring?” thread: company, header fields, remote/hybrid/onsite, visa sponsorship, salary text, links. Filter by keywords and remote. |

### Use cases

- 📣 **Brand & launch monitoring** — schedule a date-sorted search for your product or competitors
- 🧑‍💻 **Job hunting & recruiting research** — filter Who's Hiring for “python”, “remote”, “Berlin”
- 📊 **Trend research** — how often a technology is discussed over time
- 🤖 **AI datasets** — high-quality technical discussions and comment threads for summarization or RAG

### Input examples

Search newest stories about a topic with at least 20 points:

```json
{ "mode": "search", "query": "web scraping", "itemType": "story", "sortBy": "date", "minPoints": 20, "maxItems": 500 }
```

Remote Python jobs from the latest Who's Hiring thread:

```json
{ "mode": "who_is_hiring", "hiringKeywords": ["python"], "remoteOnly": true, "maxItems": 0 }
```

### Output examples

Story:

```json
{
    "id": 50060296,
    "type": "story",
    "title": "My Reddit AMA on the Law of Web Scraping",
    "url": "https://…",
    "domain": "…",
    "author": "…",
    "points": 114,
    "numComments": 37,
    "createdAt": "2026-10-12T18:02:32Z",
    "hnUrl": "https://news.ycombinator.com/item?id=50060296"
}
```

Who's hiring post:

```json
{
    "type": "job_post",
    "thread": "Ask HN: Who is hiring? (October 2026)",
    "company": "Sidekick Labs",
    "headerFields": ["Sidekick Labs", "Senior SWE, R&D Engineer, Intelligence Engineer", "REMOTE (US)"],
    "remote": true,
    "hybrid": false,
    "onsite": false,
    "visaSponsorship": null,
    "salaryText": "$170k to $230k",
    "urls": ["https://…"],
    "text": "Sidekick Labs | Senior SWE … full post text",
    "hnUrl": "https://news.ycombinator.com/item?id=49922609"
}
```

### Pricing

| Event | Price | When |
|---|---|---|
| Hacker News item | **$0.0002** ($0.20 / 1,000 items) | Each story, comment or job post saved |
| Actor start | $0.00005 | Once per run |

### FAQ

**Is this allowed?** It uses the public, documented HN Search API provided by Algolia for Hacker News, at a polite request rate.

**Why is my search capped at 1,000 results?** Relevance search is limited by the API; switch *Sort by* to *Date* to page through more.

**Does it include user profiles or emails?** No. It returns posts and comments as published (with the public username), and doesn't collect personal contact data.

# Actor input Schema

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

<b>Search</b> stories/comments by keyword. <b>Front page</b>: current front-page stories. <b>Comments</b>: full comment threads of given stories. <b>Who is hiring</b>: job posts from the monthly “Ask HN: Who is hiring?” thread, parsed.

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

Keywords (search mode). Leave empty to list everything matching the filters.

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

Search mode: which items to search.

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

Search mode: relevance (popular first) or date (newest first; supports more than 1,000 results).

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

Only items with at least this many points.

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

Only stories with at least this many comments.

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

Only items created on/after this date.

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

Only items created on/before this date.

## `storyIds` (type: `array`):

e.g. <code>https://news.ycombinator.com/item?id=4058874</code> or <code>4058874</code>.

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

Who-is-hiring mode: e.g. <code>October 2026</code>. Empty = latest thread.

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

Who-is-hiring mode: keep posts mentioning any of these (e.g. <code>python</code>, <code>rust</code>, <code>berlin</code>).

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

Who-is-hiring mode: keep posts that mention remote.

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

Maximum results to save (0 = no limit).

## Actor input object example

```json
{
  "mode": "search",
  "query": "web scraping",
  "itemType": "story",
  "sortBy": "relevance",
  "minPoints": 0,
  "minComments": 0,
  "remoteOnly": false,
  "maxItems": 100
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `all` (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": "search",
    "query": "web scraping"
};

// Run the Actor and wait for it to finish
const run = await client.actor("parth-tools/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",
    "query": "web scraping",
}

# Run the Actor and wait for it to finish
run = client.actor("parth-tools/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",
  "query": "web scraping"
}' |
apify call parth-tools/hacker-news-scraper --silent --output-dataset

```

## MCP server setup

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