# Hacker News Search & Monitor - Official API (`slanlabs/hackernews-monitor`) Actor

Search Hacker News stories and comments via the official HN API. Front page, latest, per-author. Filter by points and date. Agent-ready pay-per-event pricing.

- **URL**: https://apify.com/slanlabs/hackernews-monitor.md
- **Developed by:** [SlanLabs](https://apify.com/slanlabs) (community)
- **Categories:** News, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 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 Search & Monitor

Search every Hacker News story and comment since 2006 - plus the live front page, newest-first monitoring, and per-author history - through the official HN API (Algolia). No login, no scraping, no rate-limit pain.

### Why HN data

Hacker News is the earliest reliable signal for developer tools, startup traction, and tech sentiment. A front-page appearance moves markets for dev products. Teams monitor HN for their own launches and mentions, investors watch it for breakout tools, and researchers mine it for tech-discourse history. The official API returns structured JSON for all of it; this Actor adds agent-friendly modes, filters, and pay-per-item pricing.

### Modes

- `search` - relevance-ranked full-text search across all of HN
- `latest` - newest first; the monitoring mode
- `front-page` - what is on the front page right now
- `author` - everything one user has posted or commented

### What you get per item

- `id`, `title`, `url`, `author`
- `points`, `numComments`, `createdAt`
- `storyText` (self-posts) and `commentText`
- `hnUrl` - direct link to the HN discussion

### Inputs

| Field | Required | Description |
| --- | --- | --- |
| `mode` | yes | One of the four modes |
| `query` | no | Full-text query for search/latest, e.g. `"AI agents"` |
| `tags` | no | `story` (default), `comment`, `poll`, `show_hn`, `ask_hn`, or empty for all |
| `author` | author mode | HN username |
| `minPoints` | no | Minimum score filter |
| `dateFrom` | no | Only items created on/after this date |
| `maxResults` | no | Default 100, max 1000 |

### Examples

This week's Show HN launches with traction:

```json
{ "mode": "search", "tags": "show_hn", "minPoints": 10, "dateFrom": "2026-10-12" }
```

Everything about a topic, newest first:

```json
{ "mode": "latest", "query": "apify", "maxResults": 200 }
```

### FAQ

**Is this the official API?** Yes - the HN Algolia API that Hacker News itself documents.

**Do I need an account?** No.

**How far back does it go?** All of HN history, back to 2006.

**What does it cost?** Pay-per-event: $2 per 1,000 items.

**Can I monitor mentions continuously?** Yes - schedule `latest` mode runs with `dateFrom` for incremental pulls; dedupe on `id`.

**What is the rate limit?** The API is generous; the Actor pages politely within it.

### Pipeline patterns

**Launch monitoring.** After shipping, run `latest` with your product name every few hours. HN discussion often starts within minutes of a mention, and early comments are where positioning feedback lives.

**Competitor and keyword watch.** A scheduled `latest` query on competitor names or category terms with `dateFrom` rolling forward gives you a complete mention log; dedupe on `id`.

**Founder/VC watching.** `author` mode on key accounts archives everything they post and comment - the closest thing to a public-thinking feed.

**Trend research.** `search` with `minPoints` over a date range surfaces the discussions the community actually cared about, ranked by relevance - strong grounding for market maps and content research.

### Field notes

`points` and `numComments` are snapshots at fetch time; re-fetch popular items to track momentum. `storyText` is set for self-posts (Ask HN, Show HN text), `commentText` for comments - filter on `type` to separate them. `hnUrl` always resolves to the canonical discussion page. The Algolia index lags live HN by under a minute in practice.

### More FAQ

**Why is front-page capped at one page?** HN's front page is inherently ~30 items; for anything deeper use `latest` or `search`.

**Can I get a full comment tree?** This Actor returns flat item rows with IDs; for tree reconstruction, each item's ID joins to `news.ycombinator.com/item?id=`.

**Job posts?** Yes - jobs are items too; use `search` with empty `tags` to include them.

**Why did a known story not appear in search?** Very new items can lag the index by a minute; extremely old deleted items are gone for good.

**Dead/flagged content?** The API still returns flagged stories, which is useful for moderation research.

**Cost for big pulls?** $2 per 1,000 items - a full year of a niche topic is typically a few thousand items, so cents.

### More official-API Actors from SlanLabs

- [App Store Reviews (Official Apple Feeds)](https://apify.com/slanlabs/app-store-reviews) - every public review for any iOS app, any country
- [App Store Top Charts (Official Apple Feeds)](https://apify.com/slanlabs/app-store-top-charts) - live top free, paid and grossing charts for apps, books, podcasts and music
- [Bluesky Scraper - Posts, Profiles, Search](https://apify.com/slanlabs/bluesky-scraper) - posts, profiles, search and threads via the open AT Protocol
- [SEC EDGAR Filings Search & Monitor](https://apify.com/slanlabs/sec-edgar-filings) - full-text search and company feeds from the SEC's official APIs
- [GDELT Global News Monitor](https://apify.com/slanlabs/gdelt-news-monitor) - worldwide news coverage in 65+ languages, updated every 15 minutes
- [US Government Spending & Contracts (USASpending)](https://apify.com/slanlabs/usaspending-contracts) - federal contracts, grants and loans by keyword, agency, NAICS or recipient

# Actor input Schema

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

search: relevance-ranked search. latest: newest first. front-page: current front page. author: one user's posts and comments.

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

search/latest only. Full-text query, e.g. "AI agents". Empty returns everything.

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

search/latest only. Restrict to stories, comments, polls, Show HN or Ask HN. Empty = all.

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

author mode only. HN username, e.g. pg.

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

search/latest only. Only items with at least this many points.

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

search/latest only. YYYY-MM-DD. Only items created on/after this date.

## `maxResults` (type: `integer`):

Stop after this many items.

## Actor input object example

```json
{
  "query": "AI agents",
  "tags": "story",
  "maxResults": 100
}
```

# Actor output Schema

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

Hacker News items dataset

## `summary` (type: `string`):

Run summary (counts)

# 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 = {
    "query": "AI agents"
};

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

# Run the Actor and wait for it to finish
run = client.actor("slanlabs/hackernews-monitor").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 '{
  "query": "AI agents"
}' |
apify call slanlabs/hackernews-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,slanlabs/hackernews-monitor"
        }
    }
}
```

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/afPLqTV6JpBB5zwR6/builds/yPNJbbcWAD5GmF8x9/openapi.json
