# Hacker News Scraper (`maged120/hacker-news-scraper`) Actor

Scrape Hacker News stories, comments, Ask/Show HN posts and the monthly "Who is hiring" job posts, with points, comment counts, authors and links.

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

## Pricing

from $6.00 / 1,000 results

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

**Scrape Hacker News: stories, comments, Ask HN, Show HN and every "Who is hiring?" job post.** Search by keyword with date and points filters, or pull the monthly hiring threads as **structured job rows** with company, role, location, remote flag, salary, emails and links.

### What does Hacker News Scraper do?

Hacker News Scraper collects posts from [Hacker News](https://news.ycombinator.com/), the tech community run by Y Combinator. Search any keyword across HN's full history, get the current front page, or turn the monthly **"Ask HN: Who is hiring?"** threads into a clean job list.

It runs on the Apify platform, so you also get API access, scheduled runs, integrations (Google Sheets, Slack, Zapier, Make, webhooks) and run monitoring.

### Why use Hacker News Scraper?

- **Tech recruiting and job hunting**: every "Who is hiring" post as a row with company, role, location, remote and salary, filterable by your keywords.
- **Brand and product monitoring**: track every HN mention of your product, company or competitors.
- **Launch research**: study successful Show HN launches by points and comments.
- **Trend analysis**: see which topics and domains get traction over time.
- **Developer marketing**: find active discussions and commenters in your niche.

### How to scrape Hacker News

1. Open the **Input** tab.
2. Add **keywords**, pick a **content type** (stories, comments, Ask HN, Show HN, jobs, front page) and optional filters.
3. To collect jobs, set **"Who is hiring" months** to 1 or more and optionally add job keywords.
4. Click **Start** and download the results as JSON, CSV, Excel or HTML.

### Input

| Field | Description |
|---|---|
| `searches` | Keywords to search. Empty = latest items of the selected type. |
| `contentType` | Stories, comments, Ask HN, Show HN, job posts, polls or the current front page. |
| `sortBy` | Relevance (popular first) or newest first. |
| `dateFrom` / `dateTo` | Only items posted within these dates. |
| `minPoints` | Skip stories below this score. |
| `maxItemsPerSearch` | Up to 1,000 per keyword. |
| `whoIsHiringMonths` | Collect job posts from the last N "Who is hiring?" threads. 0 = off. |
| `hiringKeywords` | Keep only job posts mentioning these words. |

```json
{
    "searches": ["rust", "AI agents"],
    "contentType": "story",
    "minPoints": 50,
    "maxItemsPerSearch": 200,
    "whoIsHiringMonths": 1,
    "hiringKeywords": ["python", "remote"]
}
```

### Output

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

**Story**

```json
{
    "entityType": "story",
    "searchTerm": "rust",
    "type": "story",
    "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",
    "points": 1582,
    "comments": 642,
    "author": "Sikul",
    "createdAt": "2020-02-04T17:30:40Z",
    "hnUrl": "https://news.ycombinator.com/item?id=22238335"
}
```

**Job post from "Who is hiring?"**

```json
{
    "entityType": "job",
    "thread": "Ask HN: Who is hiring? (September 2026)",
    "company": "Modash.io",
    "role": "Senior Product Engineer",
    "location": "Remote (Europe)",
    "remote": true,
    "salary": "€75k–110k",
    "header": "Modash.io | Senior Product Engineer | Remote (Europe) | Full-time | €75k–110k | https://modash.io",
    "emails": null,
    "links": ["https://modash.io"],
    "hnUrl": "https://news.ycombinator.com/item?id=49523011"
}
```

#### Data fields

| Row type | Main fields |
|---|---|
| Story / Ask / Show / job / poll | title, url, domain, text, points, comments, author, createdAt, hnUrl |
| Comment | text, author, storyTitle, storyId, createdAt, hnUrl |
| Who is hiring job | company, role, location, remote, salary, header, full text, emails, links, author, createdAt |

#### Dataset views

**Stories & posts**, **Comments** and **Who is hiring**.

### How many results will I get?

Up to 1,000 items per keyword, plus about 250–400 job posts per monthly "Who is hiring?" thread.

### Tips

- **Monthly job feed**: schedule the actor on the 2nd of each month with `whoIsHiringMonths: 1`.
- **Brand monitoring**: sort by newest with your brand as the keyword, and schedule it daily.
- **Find launch winners**: content type Show HN, sort by relevance, minimum points 100.
- Company, role and location in job rows are read from the post's first line. The full post text is always included in `text`.

### FAQ

**Is this data public?**
Yes. Everything comes from public Hacker News posts.

**Something missing or broken?**
Open an issue in the **Issues** tab and we'll look at it quickly. Need a custom version? Get in touch through the same tab.

***

⭐ **Found this Actor useful?** A quick review on the Store helps other users find it and keeps it maintained.

### Related tools

- [Google Trends Scraper – interest over time, by region and related queries](https://apify.com/maged120/google-trends-scraper)

# Actor input Schema

## `searches` (type: `array`):

Search Hacker News for these keywords. Leave empty to list the latest items of the selected type.

## `contentType` (type: `string`):

What to collect.

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

Order of results.

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

Only items posted on or after this date.

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

Only items posted on or before this date.

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

Skip stories below this score.

## `maxItemsPerSearch` (type: `integer`):

Up to 1,000 per keyword.

## `whoIsHiringMonths` (type: `integer`):

Also collect every job post from the last N monthly "Who is hiring?" threads (1 = this month). Each post becomes a job row with company, role, location, remote flag, salary and links. 0 = off.

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

Only keep job posts mentioning any of these words (for example python, remote, Berlin). Leave empty for all.

## Actor input object example

```json
{
  "searches": [
    "rust",
    "ai agents"
  ],
  "contentType": "story",
  "sortBy": "relevance",
  "minPoints": 0,
  "maxItemsPerSearch": 100,
  "whoIsHiringMonths": 0
}
```

# Actor output Schema

## `dataset` (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 = {
    "searches": [
        "rust",
        "ai agents"
    ],
    "maxItemsPerSearch": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("maged120/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 = {
    "searches": [
        "rust",
        "ai agents",
    ],
    "maxItemsPerSearch": 100,
}

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

```

## MCP server setup

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