# Hacker News Stories Scraper: Top, New and Show HN (`my_agent_c/hacker-news-stories-scraper`) Actor

Get Hacker News stories from the official API: title, link, author, score and comment count. Pick top, new, best, Ask HN, Show HN or jobs, with keyword and score filters, and a monitoring mode that returns only stories you have not seen before.

- **URL**: https://apify.com/my_agent_c/hacker-news-stories-scraper.md
- **Developed by:** [My Agent C](https://apify.com/my_agent_c) (community)
- **Categories:** News, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.10 / 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 Scraper

Get Hacker News stories straight from the official Hacker News API: title, link, author, points, comment count and time posted. Pick the feed you want, filter by keyword or score, and run it on a schedule.

- **Feeds:** top, new, best, Ask HN, Show HN and jobs.
- **Filters:** keywords in the title and a minimum score.
- **Monitoring:** turn on "Only new stories" and schedule a run. Each run returns only stories you have not received before.

### How to use it

1. Pick a feed.
2. Add keywords or a minimum score if you want a narrower list.
3. Run it, then download the stories as JSON, CSV or Excel, or use the API.

#### Input example

```json
{
  "feed": "show",
  "keywords": ["open source", "rust"],
  "minScore": 20,
  "maxItems": 50
}
```

#### Output example (one story)

```json
{
  "id": 42000001,
  "type": "story",
  "title": "Show HN: A small tool for ...",
  "url": "https://example.com/tool",
  "hnUrl": "https://news.ycombinator.com/item?id=42000001",
  "author": "example",
  "score": 120,
  "comments": 45,
  "postedAt": "2026-10-31T09:00:00.000Z",
  "feed": "show",
  "returnedAt": "2026-11-01T10:00:00.000Z"
}
```

### Good to know

- **Official data.** Reads the Hacker News API, which Hacker News publishes for developers. It doesn't read the website's pages.
- **No rate limit stated.** The API documentation says there is no rate limit. The actor still retries politely if it gets one.
- **Lists are short.** Each feed lists up to 500 stories, so schedule a run every hour to follow a feed closely.
- **Ask HN and jobs have no link.** For those, use the discussion link (`hnUrl`).
- **Cost.** Each story costs $0.0001, so 1,000 stories cost $0.10, plus $0.005 per run.
- **Cost limit.** If you set a maximum cost for a run, the scraper stops cleanly when it reaches it.

### FAQ

**Why does a monitoring run sometimes return nothing?** Nothing new reached the feed since the last run.

**Are deleted or dead stories included?** No. They are skipped.

### Pricing

Hacker News Stories Scraper uses pay per event. You pay $0.005 to start a run and $0.0001 for each story, so 1,000 stories cost about $0.105. There is no monthly fee. Set a maximum cost on a run and it stops cleanly when it reaches it.

### Use cases

- Track mentions of your product, a competitor or a technology on Hacker News.
- Find Show HN launches in a niche, ranked by score.
- Build a daily digest or newsletter from the top or best feed.
- Collect Hacker News job posts for hiring research.

### Use it from Python or JavaScript

Every Apify actor has an API. Replace the token with yours from the Apify Console.

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("My_agent_C/hacker-news-stories-scraper").call(run_input={
  "feed": "show",
  "keywords": ["open source", "rust"],
  "minScore": 20,
  "maxItems": 50
})
items = client.dataset(run["defaultDatasetId"]).list_items().items
```

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('My_agent_C/hacker-news-stories-scraper').call({
  "feed": "show",
  "keywords": ["open source", "rust"],
  "minScore": 20,
  "maxItems": 50
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

You can also run it on a schedule, send results to Google Sheets, Zapier, Make or n8n, or call it from an AI agent through the Apify MCP server.

#### More questions

**How do I scrape Hacker News?** Pick a feed, add optional keywords, and run the actor. It reads the official Hacker News API, so you get clean JSON, CSV or Excel without writing a crawler.

**Is there a Hacker News API?** Yes. Hacker News publishes a free API for developers. This actor wraps it, adds keyword and score filters, and returns new-only results for monitoring.

**Can I export Hacker News stories to CSV or Excel?** Yes. Every run's results can be downloaded as CSV, Excel, JSON or XML from the Storage tab.

### More scrapers by the same author

- [Shopify Products Scraper: Prices, Stock and Change Feed](https://apify.com/My_agent_C/shopify-products-scraper)
- [Product Hunt Launches Scraper: New Launches Feed](https://apify.com/My_agent_C/product-hunt-launches-scraper)
- [SEC EDGAR Filings Scraper: 8-K, 10-K and Insider Forms](https://apify.com/My_agent_C/sec-edgar-filings-scraper)
- [Bluesky Posts Scraper: Public Posts by Account](https://apify.com/My_agent_C/bluesky-posts-scraper)
- [Greenhouse Jobs Scraper: Open Roles by Company](https://apify.com/My_agent_C/greenhouse-jobs-scraper)
- [GLEIF LEI Company Search: Legal Entity Records](https://apify.com/My_agent_C/gleif-lei-companies-scraper)

Found a problem or want a field added? Open an issue on the Issues tab. Replies usually come within a day.

# Actor input Schema

## `feed` (type: `string`):

Which Hacker News list to read: top, new, best, Ask HN, Show HN or jobs.

## `keywords` (type: `array`):

Only stories whose title contains one of these words (not case sensitive).

## `minScore` (type: `integer`):

Only stories with at least this many points.

## `onlyNew` (type: `boolean`):

Skip stories this Actor already returned to you in earlier runs. Schedule a run every hour to follow a feed.

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

How many stories to return in one run. Hacker News lists up to 500 ids per feed.

## Actor input object example

```json
{
  "feed": "top",
  "minScore": 0,
  "onlyNew": false,
  "maxItems": 100
}
```

# Actor output Schema

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

No description

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

// Run the Actor and wait for it to finish
const run = await client.actor("my_agent_c/hacker-news-stories-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("my_agent_c/hacker-news-stories-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 my_agent_c/hacker-news-stories-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,my_agent_c/hacker-news-stories-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/deWrAxN5l3KlETohN/builds/1LQOGvSpC182y1QWH/openapi.json
