# Hacker News Scraper: Stories, Search, Ask HN & Who Is Hiring (`datafeedlab/hacker-news-scraper`) Actor

Hacker News scraper for stories, search, Ask HN, Show HN and parsed Who is Hiring jobs, from official Firebase and Algolia APIs. No API key.

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

## Pricing

$0.10 / 1,000 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: Stories, Search, Ask HN & Who Is Hiring

**A Hacker News scraper for stories, search, Ask HN, Show HN and parsed Who is Hiring posts — from official APIs, with no API key and no HTML scraping.** Front page, new, best, Ask HN, Show HN, jobs, full-text search, individual threads, and **parsed "Who is Hiring?" posts** (company, role, location, remote).

This Actor uses only:

- the official [Hacker News Firebase API](https://github.com/HackerNews/API) (`hacker-news.firebaseio.com`)
- the official [HN Search API by Algolia](https://hn.algolia.com/api) (`hn.algolia.com/api`)

💸 **$0.10 per 1,000 items. No start fee.** Filtered-out items are free.

### Why use it?

| | This Actor | Typical HN Actors |
|---|---|---|
| Price | **$0.10 / 1,000 items** | $0.30–$0.90 / 1,000, often + start fees |
| Source | Official Firebase + Algolia APIs | often page scraping |
| API key | **None** | — |
| Who is Hiring | ✅ parsed company / role / location / remote | usually raw comments only |
| Search | Official Algolia HN Search | limited |

### Use cases

- **Recruiting** — extract this month's "Ask HN: Who is hiring?" thread into a structured job list, optionally remote-only.
- **Trend and brand monitoring** — search stories and comments about a product, library or company.
- **Research and newsletters** — dump the front page or Show HN into CSV on a schedule.
- **Job boards** — follow official HN Jobs (`jobstories`).

### How to use

1. Pick a mode: Front page, New, Best, Ask, Show, Jobs, Search, Who is Hiring, or a single item.
2. For Search, enter a query (and optional tags such as `story` or `comment`).
3. For Who is Hiring, leave the month empty to get the latest official thread, or pass e.g. `November 2026`.
4. Set max items. Optionally require a minimum score, or include top-level comments.
5. Run and export the **Overview** table to CSV, Excel, JSON or Google Sheets.

#### Example input (front page)

```json
{
  "mode": "front_page",
  "maxItems": 30
}
```

#### Example input (Who is Hiring)

```json
{
  "mode": "who_is_hiring",
  "maxItems": 200,
  "onlyRemoteHiring": false
}
```

#### Example output (story)

```json
{
  "type": "story",
  "id": 42914340,
  "title": "Example story",
  "url": "https://example.com",
  "hnUrl": "https://news.ycombinator.com/item?id=42914340",
  "author": "pg",
  "points": 312,
  "numComments": 148,
  "createdAt": "2026-11-13T12:00:00+00:00",
  "source": "hacker-news.firebaseio.com"
}
```

#### Example output (hiring post)

```json
{
  "type": "hiring",
  "id": 42920001,
  "company": "Example Inc",
  "role": "Staff engineer",
  "location": "Remote (US timezones)",
  "remote": true,
  "text": "Example Inc | Staff engineer | Remote (US timezones) | ...",
  "author": "hiringmanager",
  "hnUrl": "https://news.ycombinator.com/item?id=42920001",
  "hiringThreadTitle": "Ask HN: Who is hiring? (November 2026)"
}
```

Hiring fields are parsed from the usual first-line format (`Company | Role | Location`). Posts that do not follow it still return the full text; `company` may then just be the first segment of that line.

### Compliance

- Official, key-free APIs documented at [github.com/HackerNews/API](https://github.com/HackerNews/API) and [hn.algolia.com/api](https://hn.algolia.com/api).
- This Actor does not scrape `news.ycombinator.com` HTML.
- Usernames are the public HN handles already published by those APIs.

### Pricing

**$0.10 per 1,000 items** saved to the dataset. No start fee. Items removed by the minimum-points or remote-only filters are free.

### More Actors by DataFeed Lab

ToS-compliant data Actors for growth, product and research teams. All are callable from the Apify API, integrations, or [Apify's MCP server](https://mcp.apify.com) for AI agents.

- [Greenhouse Jobs Scraper](https://apify.com/datafeedlab/ats-jobs-scraper) — Official Greenhouse, Lever, Ashby, Workable, SmartRecruiters and Recruitee job APIs, with salary, remote flag and a new-jobs monitor. $1 per 1,000 jobs.
- [WHOIS Lookup](https://apify.com/datafeedlab/bulk-domain-intel) — Bulk WHOIS/RDAP domain age and expiry, DNS, SPF/DMARC and SSL checker. $1 per 1,000 domains.
- [Contact Details Scraper](https://apify.com/datafeedlab/contact-details-scraper) — Company emails, phones, social profiles, contact forms and tech stack (no personal emails). $2 per 1,000 sites with contacts.
- [Shopify Scraper](https://apify.com/datafeedlab/shopify-products-scraper) — Products, prices, variants, stock and sales, with a price/stock monitor. $0.70 per 1,000 products.
- [Tech Stack Detector](https://apify.com/datafeedlab/tech-stack-detector) — BuiltWith alternative: CMS, Shopify, analytics, pixels and hosting. $1 per 1,000 sites.
- [App Store Reviews Scraper](https://apify.com/datafeedlab/app-store-reviews) — Official Apple iOS reviews and metadata. $0.08 per 1,000 rows.
- [OpenStreetMap POI Scraper](https://apify.com/datafeedlab/osm-places) — Local business leads via the official Overpass API. $0.50 per 1,000 places.
- [Website to Markdown Crawler](https://apify.com/datafeedlab/website-markdown-crawler) — HTML to Markdown for AI and RAG, robots.txt respected. $1 per 1,000 pages.

# Actor input Schema

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

Mode

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

Used in Search mode. Official Algolia HN Search (`hn.algolia.com/api`).

## `searchTags` (type: `string`):

Optional Algolia tags, e.g. `story`, `comment`, `show_hn`, `ask_hn`, `front_page`, `author_pg`. See the Algolia HN API docs.

## `itemIds` (type: `array`):

Used in Item mode (and optionally to pin a Who is Hiring thread). Numeric HN IDs or `https://news.ycombinator.com/item?id=...` URLs.

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

Optional, e.g. `November 2026`. Leave empty to use the latest official 'Ask HN: Who is hiring?' thread by `whoishiring`.

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

Maximum stories, comments or hiring posts to save.

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

For story lists and item mode, also save top-level comments (each comment is a billed row). Ignored in Who is Hiring mode, which already returns parsed comments.

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

Optional. Stories below this score are skipped and free.

## `onlyRemoteHiring` (type: `boolean`):

Keep only hiring comments that look remote-friendly. Filtered comments are free.

## Actor input object example

```json
{
  "mode": "front_page",
  "searchTags": "story",
  "maxItems": 50,
  "includeComments": false,
  "onlyRemoteHiring": false
}
```

# Actor output Schema

## `items` (type: `string`):

Stories, comments and hiring posts ('Overview' view).

## `runSummary` (type: `string`):

Counts and errors (free).

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("datafeedlab/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 = {}

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

```

## MCP server setup

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