# Hacker News Scraper: Stories, Comments, Show HN & Jobs (`blueberry_rainstorm/hacker-news-scraper`) Actor

Search Hacker News stories, comments, Ask HN, Show HN and job posts by keyword, date, points or author. Uses the official HN search API: fast, reliable, no proxy or login.

- **URL**: https://apify.com/blueberry_rainstorm/hacker-news-scraper.md
- **Developed by:** [Pandapi](https://apify.com/blueberry_rainstorm) (community)
- **Categories:** News, 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.20 / 1,000 item scrapeds

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, Show HN & Jobs

Search and export **Hacker News** data: stories, comments, Ask HN, Show HN, job posts, polls and the current front page. Filter by keyword, date range, minimum points, minimum comments or author.

It uses the official public Hacker News search API (by Algolia), so it is **fast, cheap and reliable**: no browser, no proxy, no login, no blocking.

### What you can do with it

- **Track mentions** of your product, company or competitors on Hacker News
- **Find launches**: every Show HN post about a topic, with points and comment counts
- **Research trends**: all stories about "LLM", "Rust" or "remote work" over a date range
- **Collect job posts** from HN (YC company job ads)
- **Build datasets** of comments for sentiment analysis or AI training
- **Monitor daily**: schedule it with "Newest first" and a "From date" to get only new items

### Input

| Field | What it does | Default |
|---|---|---|
| Search query | Keywords. Leave empty for the latest items. | empty |
| Content type | Stories, Comments, Ask HN, Show HN, Job posts, Polls, Front page, Everything | Stories |
| Sort by | Newest first (no limit) or Most relevant (max 1,000) | Newest first |
| Minimum points / comments | Quality filter | none |
| From / To date | Date range (YYYY-MM-DD) | none |
| Author username | Only items by this HN user | none |
| Max items | How many items to return | 100 |

Example input:

```json
{ "searchQuery": "postgres", "contentType": "show_hn", "minPoints": 20, "dateFrom": "2026-01-01", "maxItems": 500 }
```

Unlike many HN scrapers, "Newest first" mode is **not capped at 1,000 results**: it walks back through time until it reaches your max items or date range.

### Output

One row per item:

```json
{
  "id": "50454951",
  "type": "story",
  "title": "Show HN: ...",
  "url": "https://github.com/...",
  "text": "Plain text body (Ask HN, Show HN and comments)",
  "textHtml": "<p>Original HTML body</p>",
  "author": "username",
  "points": 61,
  "numComments": 26,
  "createdAt": "2026-11-11T16:00:50Z",
  "storyId": 50454951,
  "parentId": null,
  "isShowHN": true,
  "isAskHN": false,
  "hnUrl": "https://news.ycombinator.com/item?id=50454951"
}
```

Export as JSON, CSV, Excel or HTML, or use the API.

### Pricing

Pay only for results: **$0.30 per 1,000 items**. No start fee. 100 items cost $0.03. You can set a maximum spend per run, and the scraper stops cleanly when it is reached.

### Notes

- Data comes from Hacker News's public search API. Points and comment counts are refreshed by the API every few minutes.
- Comment `title` and `url` hold the parent story's title and link.
- Questions or a missing feature? Open an issue on the Issues tab and I'll answer quickly.

### Responsible use

This tool reads Hacker News through the public, official HN search API (Algolia). Usernames and comments are public posts: use them for research, analysis and monitoring, not to contact or profile individual people, and respect the authors' copyright when republishing text. Want something removed from a dataset you got from us? Open an issue on the Issues tab.

### More from Pandapi 🐼

Pandapi makes friendly, no-nonsense data tools: simple input, clean output, and fair pay-per-result prices. Found a bug or need a feature? Open an issue on the Issues tab and we answer fast.

- [Web Page to Markdown](https://apify.com/blueberry_rainstorm/web-page-to-markdown): clean, chunked Markdown from any URL or sitemap, ready for AI and RAG
- [PDF to Text, Markdown & Excel](https://apify.com/blueberry_rainstorm/pdf-to-text-markdown): text, Markdown and real Excel tables from any PDF, with OCR
- [Website Contact Details Scraper](https://apify.com/blueberry_rainstorm/website-contact-finder): business emails, phones and social links, one row per website
- [Website Screenshot](https://apify.com/blueberry_rainstorm/website-screenshot): full-page and mobile screenshots or PDFs of many URLs at once
- [Broken Link Checker](https://apify.com/blueberry_rainstorm/broken-link-checker): every 404, dead link and redirect on a site, with the page it is on
- [Public Tenders Feed](https://apify.com/blueberry_rainstorm/public-tenders-feed): government tenders and contract awards from six official portals
- [App Store Reviews Scraper](https://apify.com/blueberry_rainstorm/app-store-reviews-scraper): iOS reviews, ratings and app details from about 180 countries
- [Google Play Reviews Scraper](https://apify.com/blueberry_rainstorm/google-play-reviews-scraper): Android reviews with developer replies, ratings and app data, many languages
- [HTML to PDF](https://apify.com/blueberry_rainstorm/html-to-pdf): web pages, HTML or a template plus JSON rows (invoices, certificates) to PDF

# Actor input Schema

## `searchQuery` (type: `string`):

Keywords to search for. Leave empty to get the latest items of the chosen type.

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

Which kind of Hacker News items to return.

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

Newest first can go past 1,000 results. Most relevant is capped at 1,000 by the HN API.

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

Only items with at least this many points (stories only).

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

Only stories with at least this many comments.

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

Only items created on or after this date (YYYY-MM-DD).

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

Only items created before or on this date (YYYY-MM-DD).

## `author` (type: `string`):

Only items posted by this HN username.

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

Maximum number of items to return.

## Actor input object example

```json
{
  "searchQuery": "AI agents",
  "contentType": "story",
  "sortBy": "date",
  "maxItems": 100
}
```

# Actor output Schema

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

No description

## `results` (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 = {
    "searchQuery": "AI agents"
};

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

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

```

## MCP server setup

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