# Hacker News Scraper – Stories, Comments & Who Is Hiring Jobs (`devteamdrew/hacker-news-scraper`) Actor

Search Hacker News stories and comments, export the front page, or extract every 'Who is hiring?' job post, filtered by keyword. Official HN Algolia API, LLM-ready Markdown, incremental mode.

- **URL**: https://apify.com/devteamdrew/hacker-news-scraper.md
- **Developed by:** [Andrew Moffat](https://apify.com/devteamdrew) (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 – Stories, Comments & Who Is Hiring Jobs

Search Hacker News stories and comments, export the front page, or extract every 'Who is hiring?' job post, filtered by keyword. Official HN Algolia API, LLM-ready Markdown, incremental mode.

**Hacker News Scraper** by Moxie: fast, reliable and polite, built on official/public data sources.

### What can it do?

- Tech recruiting: export and filter 'Who is hiring?' posts
- Brand and launch monitoring on HN
- Building datasets of discussions for LLM fine-tuning or RAG
- Trend research on technologies

### Data source

The official Hacker News Algolia search API (`hn.algolia.com`). Public data only.

### Features

- **Pay only for results** (pay-per-event pricing, no monthly rental)
- **Incremental mode**: scheduled runs return only items you haven't received before
- **LLM-ready output**: optional compact Markdown per item for RAG / AI agents
- **Polite rate limiting** with automatic retries and backoff
- Clean, flat JSON you can export as CSV, Excel, JSON or via API

### Input example

```json
{
  "mode": "search",
  "queries": [
    "apify"
  ],
  "maxItems": 20
}
```

### Output example

```json
{
  "id": "4058874",
  "kind": "story",
  "url": "https://news.ycombinator.com/item?id=4058874",
  "title": "HackerNews API: What if HN does not have API? Make API on the fly with APIfy",
  "text": null,
  "link": "http://apify.heroku.com/resources/4fca535156983f0001000002",
  "author": "example_user",
  "points": 132,
  "numComments": 49,
  "createdAt": "2012-06-02T19:16:33Z",
  "storyId": 4058874,
  "storyTitle": null,
  "query": "apify"
}
```

### Pricing

| Event | Price |
|---|---|
| Story or comment (`result`) | $0.0003 |
| Actor start | $0.003 per run |

**Example:** 1,000 results ≈ $0.30 + $0.003 start fee. Apify platform usage is included in the price.

Benchmark: epctex/hackernews-scraper charges $0.0003/result (Apify Store, 30 Oct 2026).

### Use via API or MCP

```bash
curl -X POST "https://api.apify.com/v2/acts/devteamdrew~hacker-news-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H 'Content-Type: application/json' -d '{"mode": "search", "queries": ["apify"], "maxItems": 20}'
```

AI agents (Claude, Cursor, etc.) can call this actor through the Apify MCP server: add `https://mcp.apify.com/?actors=devteamdrew/hacker-news-scraper` as an MCP server.

### FAQ

**Is this allowed?**\
Yes, it uses HN's official public API.

**How do I get all hiring posts?**\
Set mode to 'Who is hiring?' and leave queries empty.

**Can I schedule it?**\
Yes. Use Apify Schedules together with incremental mode to receive only new items.

**Something broke?**\
Open an issue on the actor's Issues tab; we monitor nightly and usually fix within 24 hours.

### Related actors

- [Bluesky Scraper & API – Posts, Profiles & Search](https://apify.com/devteamdrew/bluesky-scraper)
- [Companies House Scraper – UK Company Data, Directors & Filings](https://apify.com/devteamdrew/companies-house-scraper)
- [UK Planning Applications Scraper – 400+ Councils & Postcodes](https://apify.com/devteamdrew/uk-planning-applications)
- [npm Scraper – Package Downloads, Dependencies & Maintainers](https://apify.com/devteamdrew/npm-package-scraper)
- [GitHub Trending Scraper – Repos, Stars & Developers](https://apify.com/devteamdrew/github-trending-scraper)
- [Mastodon Scraper – Fediverse Hashtags, Accounts & Trends](https://apify.com/devteamdrew/mastodon-scraper)
- [Lemmy Scraper – Posts, Comments & Communities (Fediverse)](https://apify.com/devteamdrew/lemmy-scraper)
- [SEC EDGAR Scraper – Filings Search, 10-K, 10-Q & 8-K](https://apify.com/devteamdrew/sec-edgar-scraper)
- [arXiv Scraper – Papers, Abstracts & Authors Search](https://apify.com/devteamdrew/arxiv-scraper)

### Legal and GDPR

This actor only collects publicly available data from official or open APIs and respects their rate limits and terms of use.

# Actor input Schema

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

Search, front page, or the monthly 'Ask HN: Who is hiring?' thread.

## `queries` (type: `array`):

Search terms. In 'Who is hiring?' mode, only job posts containing one of these words are kept (e.g. `remote`, `TypeScript`).

## `tags` (type: `string`):

Restrict search to a type.

## `sortByDate` (type: `boolean`):

Sort search by date instead of relevance.

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

Only items with at least this many points.

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

Only items from the last N days (0 = any time).

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

For 'Who is hiring?', e.g. `October 2026`. Empty = latest thread.

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

Maximum number of results to return (and pay for) per run.

## `incremental` (type: `boolean`):

Remember items delivered in previous runs with the same input and skip them. Great for scheduled monitoring runs: you only pay for new results.

## `outputFormat` (type: `string`):

`json` = structured fields; `llm` = id, url and a compact Markdown block ready for LLMs/RAG; `both` = structured fields plus Markdown.

## `requestDelayMs` (type: `integer`):

Polite rate limit between API requests. Retries with backoff on 429/5xx are automatic.

## Actor input object example

```json
{
  "mode": "search",
  "queries": [
    "llm agents"
  ],
  "tags": "",
  "sortByDate": false,
  "minPoints": 0,
  "sinceDays": 0,
  "maxItems": 100,
  "incremental": false,
  "outputFormat": "json",
  "requestDelayMs": 500
}
```

# Actor output Schema

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

All results in the default dataset (overview view).

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

Counts of pushed and skipped (already seen) items.

# 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 = {
    "queries": [
        "llm agents"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("devteamdrew/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 = { "queries": ["llm agents"] }

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

```

## MCP server setup

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