# Hacker News Scraper — Stories, Comments & HN Jobs (`tamgadev/hacker-news-scraper`) Actor

Hacker News via the official APIs: keyword search, front-page lists (top/new/best/ask/show), comment threads, and "Who is hiring?" posts parsed into structured jobs (company, remote, salary, emails). PPE $0.50/1k items, $3/1k jobs.

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

## Pricing

from $0.50 / 1,000 stories

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 — Stories, Comments & HN Jobs

Everything public on Hacker News, as clean rows, through **HN's official APIs** (no proxy, no blocks):

- **Keyword search**: every story or comment mentioning your brand, product or competitor, newest first
- **Front-page lists**: Top, New, Best, Ask HN, Show HN, Jobs, with rank
- **Comment threads**: full discussion with depth, for any story
- **"Who is hiring?" jobs**: the monthly Ask HN thread turned into **one row per job**, with company, remote/onsite/hybrid, salary, emails and links

| Row type | Fields |
| --- | --- |
| `story` | title, link, HN link, author, points, comments, date, text (Ask/Show HN), story type, list rank |
| `comment` | text, author, date, story, parent, depth |
| `job` | month, company, header parts (role, location, type), remote / onsite / hybrid, salary, visa mention, emails, links, full text |

### Who uses this

- **Founders and marketers**: get alerted when your product or a competitor is mentioned
- **Recruiters and job seekers**: every HN job of the month in a spreadsheet, filterable by stack and remote
- **Researchers and AI teams**: high-signal tech discussions for analysis

### 60-second start

1. Add a keyword (e.g. your product name) and/or pick a list like **Top**.
2. Want jobs? Turn on **Who is hiring?** and optionally add keywords like `typescript` or `remote`.
3. Run. To monitor mentions: save as a Task with `sinceDays: 1` and schedule it daily.

### Pricing (PPE)

| Event | Price |
| --- | --- |
| Story | **$0.50 / 1,000** |
| Comment | **$0.50 / 1,000** |
| Job (Who is hiring) | **$3 / 1,000** |

Example: a full month of "Who is hiring?" (~300 jobs) ≈ **$0.90**. A daily brand-mention monitor usually costs well under a cent per run.

### Input example

```json
{
  "searchQueries": ["apify", "web scraping"],
  "searchType": "all",
  "sinceDays": 7,
  "lists": ["show"],
  "maxItemsPerSource": 100,
  "whoIsHiring": true,
  "hiringKeywords": ["typescript", "node"],
  "remoteOnly": true
}
```

### Did this save you time?

A **30-second ★ review** on the [reviews tab](https://apify.com/tamgadev/hacker-news-scraper/reviews) is the best way to support this Actor. Missing a field? Open an Issue and we usually ship it within days.

### Legal note

Uses the public Hacker News APIs (Algolia HN Search and the official Firebase API). Job posts may contain personal contact details: use them in line with GDPR and applicable law.

Profile: https://apify.com/tamgadev

# Actor input Schema

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

Find stories or comments mentioning these words (newest first). Great for brand and competitor monitoring.

## `searchType` (type: `string`):

What the keyword search returns.

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

Current Hacker News lists to scrape.

## `maxItemsPerSource` (type: `integer`):

Per keyword, per list, or per hiring thread.

## `sinceDays` (type: `integer`):

For schedules: 1 = only the last 24 hours. 0 = no limit.

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

Skip stories below this score.

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

Adds the comment thread (with depth) for every story.

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

Only used when comments are included.

## `whoIsHiring` (type: `boolean`):

Parse the monthly Ask HN: Who is hiring? thread into one row per job.

## `hiringMonths` (type: `integer`):

1 = latest month only.

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

Keep only jobs mentioning any of these, e.g. typescript, rust, berlin.

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

Keep only jobs that mention REMOTE in the header line.

## Actor input object example

```json
{
  "searchQueries": [
    "apify"
  ],
  "searchType": "story",
  "lists": [
    "top"
  ],
  "maxItemsPerSource": 100,
  "sinceDays": 0,
  "minPoints": 0,
  "includeComments": false,
  "maxCommentsPerStory": 50,
  "whoIsHiring": false,
  "hiringMonths": 1,
  "hiringKeywords": [],
  "remoteOnly": false
}
```

# Actor output Schema

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

Stories, comments and jobs

# 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"
    ],
    "lists": [
        "top"
    ],
    "hiringKeywords": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("tamgadev/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"],
    "lists": ["top"],
    "hiringKeywords": [],
}

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

```

## MCP server setup

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