# Hacker News Scraper — Front Page, Show HN, Ask HN & Search (`saliga/hacker-news-scraper`) Actor

Hacker News stories from the front page, new, best, Ask HN, Show HN and jobs, or a keyword search over all of HN: title, link, domain, points, comments, author, date. Official HN API and Algolia search. $1 per 1,000 stories.

- **URL**: https://apify.com/saliga/hacker-news-scraper.md
- **Developed by:** [Salih Küçükkayış](https://apify.com/saliga) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 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 stories, cleanly: the **front page**, **newest**, **best**, **Ask HN**, **Show HN** and **jobs**, or a **keyword search over all of Hacker News** since 2007. Each story with title, link, domain, points, comment count, author, date and its HN discussion link. Filter by points, comments, age and site.

**$1 per 1,000 stories.** Uses the official Hacker News API and HN's Algolia search: fast, no proxies, no blocking.

### Quick start

Press **Start** with the example input: the current front page, in order.

Search example, popular stories about Rust from the last 30 days:

```json
{
  "mode": "search",
  "query": "rust",
  "minPoints": 100,
  "postedWithinDays": 30,
  "maxItems": 200
}
```

### What you get

```json
{
  "id": 41234567,
  "rank": 3,
  "title": "Show HN: I built a tiny database",
  "url": "https://github.com/example/tinydb",
  "domain": "github.com",
  "points": 412,
  "comments": 187,
  "author": "example",
  "createdAt": "2026-11-04T08:15:00Z",
  "type": "show",
  "text": null,
  "hnUrl": "https://news.ycombinator.com/item?id=41234567"
}
```

`rank` is the position in the list (front page, new …); `type` is story, ask, show, launch or job; `text` holds the body of Ask HN and text posts as plain text.

### Use it for

- **Launch tracking**: did your Show HN or blog post make the front page, and how many points did it get?
- **Market research**: every story about your product, competitor or technology, with the discussion links.
- **Content feeds**: a daily digest of the top stories, filtered by points or by sites like github.com and arxiv.org.
- **AI agents**: fresh, structured tech news without scraping web pages.

### Inputs

- **What to get**: front page, newest, best, Ask HN, Show HN, jobs, or search.
- **Search**: query, kind of posts (all stories, Ask HN, Show HN, jobs, front-page stories), sorted by relevance or newest first.
- **Filters**: minimum points, minimum comments, posted within N days, only stories linking to certain sites.
- **Maximum stories**.

### What it costs

**$1 per 1,000 stories** written to the dataset, plus a tiny $0.00005 start fee per run. The whole front page (30 stories) costs about $0.03.

### Good to know

- Lists (front page, new, best …) are Hacker News' live rankings at the moment of the run; points and comment counts change over time.
- Comments themselves are not included, only the count and the link to the discussion.

### More from this developer

- [Google Trends Trending Now](https://apify.com/saliga/google-trends-trending-now): what people search for right now, by country.
- [Google Sheets Import & Export](https://apify.com/saliga/google-sheets-import-export): keep a sheet of stories up to date (upsert by `id`).

Questions or a missing feature: open an issue on the Actor page.

**Need a custom version?** I also build custom Actors, changes to this one, and n8n or Make integrations around them, for a fixed price. Open an issue on the Actor page starting with "Custom request", or email support@saligasoftware.com, with what you need and an example input.

# Actor input Schema

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

A live Hacker News list, or a keyword search over every story since 2007.

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

For search: words to look for in titles, URLs and text, e.g. rust, openai, "vector database".

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

For search: which kind of posts.

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

For search.

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

Only stories with at least this many points.

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

Only stories with at least this many comments.

## `postedWithinDays` (type: `integer`):

Only stories from the last N days. Empty: any date.

## `domains` (type: `array`):

Only stories linking to these domains (subdomains included), e.g. github.com, arxiv.org.

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

Stop after this many stories.

## Actor input object example

```json
{
  "mode": "top",
  "searchType": "story",
  "sortBy": "relevance",
  "maxItems": 100
}
```

# Actor output Schema

## `stories` (type: `string`):

One row per story.

# 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("saliga/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("saliga/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 saliga/hacker-news-scraper --silent --output-dataset

```

## MCP server setup

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