# Hacker News Scraper: Search, Threads & Monitoring (`amygraphics/hacker-news-intelligence`) Actor

Scrape Hacker News stories, comments and hiring posts. Search and compare discussions, enrich GitHub links, and monitor new mentions or engagement changes.

- **URL**: https://apify.com/amygraphics/hacker-news-intelligence.md
- **Developed by:** [Zakaria el bouami](https://apify.com/amygraphics) (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

from $0.10 / 1,000 hn results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Intelligence: Search, Threads & Monitoring

Search public Hacker News stories and comments, explore ranked feeds and historical front pages, extract hiring posts, and monitor new mentions or engagement changes. Results retain source links and include bounded reply trees, optional GitHub and HN author enrichment, and explainable heuristic signals.

### Start quickly

```json
{"mode":"search","query":"postgres","tags":"story","sort":"date","maxResults":20,"includeComments":true,"maxComments":10}
```

One Dataset row represents a primary result. Optional comment trees are included in `comments` with `parentId`, `storyId`, and `depth`; `commentCoverage` shows whether the requested tree was truncated. Search comments directly with `tags: "comment"` to get one comment per primary row.

#### Ranked feeds and historical front page

```json
{"mode":"top","maxResults":10,"includeComments":true,"maxComments":5}
```

Other feeds: `new`, `best`, `ask`, `show`, `job`, `discover`. `user` accepts `username`; `threads` accepts IDs or HN item URLs in `itemIds`; `history` takes a UTC `historyDate` in `YYYY-MM-DD`. Historical mode reads HN's HTML front page and waits at least 30 seconds between page requests in the same run, in accordance with the site's crawl delay. Avoid concurrent historical runs. Feed and history modes apply limits before local domain or engagement filters, so they can return fewer than requested.

#### Date-bounded search and comparison

```json
{"mode":"search","query":"database","tags":"story","dateFrom":"2024-01-01","dateTo":"2024-01-31","autoSplit":true,"maxSplitBuckets":30,"maxResults":1000,"compareFrom":"2023-12-01","compareTo":"2023-12-31"}
```

The `OUTPUT_SUMMARY` key-value record includes sample sizes, per-term document-frequency deltas, unique authors and links to up to three example discussions. Counts reflect bounded samples, **not** an exhaustive population or statistically validated trend; source indexing can lag. Growth percentage is `null` when the previous count is zero. Search supports multiple `queries`, optional curated expansions (`AI`, `LLM`, `k8s`, `JS`), author/date/type/points/comment filters, and exact-domain/subdomain local filtering. Query batches and date partitions are deduplicated but are not globally relevance-ranked.

#### Hiring posts

```json
{"mode":"hiring","hiringThreadType":"hiring","remoteOnly":true,"keywords":["Python","Rust"],"maxResults":20}
```

The latest matching `whoishiring` story is selected by default. Use `dateFrom` and `dateTo` for an older monthly thread, or supply its ID in `itemIds`. Select `seeking` or `freelance` for other thread types. One top-level comment becomes a row. Fields such as company, role, location, remote, salary and visa are **heuristic candidates**, not verified jobs or employer records. A remote mention does not guarantee the position is remote. Email extraction is opt-in; raw public text may itself contain personal information. Use data lawfully and respect individual privacy.

#### Monitoring

```json
{"mode":"brand_monitor","query":"\"My Product\"","tags":"story","dateFrom":"2026-01-01","watchName":"my-product","watchChanges":true,"maxResults":500,"autoSplit":true}
```

An optional secret `webhookUrl` may point to an incoming Slack or Discord webhook. The first watch run creates a baseline without emitting records by default; later runs emit new matches and, if enabled, changed points/comment counts with `change.before` and `change.after`. `smartAlerts` uses an unvalidated heuristic threshold. State advances only after a complete scan, successful requested enrichment/comment collection, successful webhook delivery and available event budget. Webhook delivery sends at most 100 selected matches in batches of five; above that limit it sends none and does not advance state. Check `OUTPUT_SUMMARY.watchStateSaved` and `runDiagnostics.incompleteReasons`. Use the same inputs and watch name on subsequent runs; do not run the same watch concurrently. State stores up to 50,000 IDs and does not track removals. A narrow or capped query can miss items; event delivery is at-least-once rather than exactly-once if a run fails after output or notification. For moving time ranges use a suitably bounded query and a separate watch when changing filters.

### Cost and bounds

The Actor uses a per-primary-result event; bundled nested comments are not separate events. Configured event rates are $0.20 per 1,000 primary results on Free and Bronze, $0.15 on Silver, and $0.10 on Gold, Platinum and Diamond, with no separate Actor start event. Platform usage is billed separately to the user. Verify the live Pricing tab for current rates. Source request budget (`maxRequests`) and result/comment/depth/bucket limits are explicit. GitHub token and webhook are optional secret inputs. No token is sent outside GitHub's `api.github.com` host; webhook destinations are restricted to Slack and Discord incoming endpoints. No source limit bypass or proxy rotation is used.

Algolia restricts a single query to roughly 1,000 retrievable results. Date partitioning helps but can still be incomplete due to a single-second overflow, source changes, max buckets, max results, network errors, and rate limits. `OUTPUT_SUMMARY` reports encountered bounds. Source responses and optional enrichment can be missing or delayed. Heuristic scoring and feedback keyword labels are not validated sentiment, credibility, predictions, or guarantees. Historical page positions may differ from a historical archive snapshot; exact page completeness is not guaranteed.

### Sources and attribution

- HN official public Firebase API: https://github.com/HackerNews/API
- Algolia HN Search API, including its published rate limit: https://hn.algolia.com/api
- Historical HN front pages: https://news.ycombinator.com/front and https://news.ycombinator.com/robots.txt
- Optional GitHub public API: https://docs.github.com/en/rest

Public availability is not a grant of copyright or privacy rights. Review applicable terms and licenses before reuse, redistribution, AI training, or outreach. This independent Actor is not affiliated with Hacker News, Y Combinator, Algolia, GitHub, Slack or Discord.

# Actor input Schema

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

Search, ranked feeds, item threads, a user, a historical front page, or monitoring.

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

Optional list of up to 10 queries; deduplicated, not globally ranked. Overrides query.

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

Optional exact domains or subdomains, filtered locally. Feed limits apply before filtering.

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

Search words or quoted exact phrase. An empty query searches all.

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

Algolia item type; hiring and Show workflows override this.

## `sort` (type: `string`):

Newest first or relevance; auto-split is bucket-ordered, not globally ranked.

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

Optional HN username.

## `username` (type: `string`):

Username required by user mode.

## `hiringThreadType` (type: `string`):

Hiring, seeking work, or freelance; date range selects historical thread.

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

Optional OR terms for hiring listings; case-insensitive.

## `itemIds` (type: `array`):

For thread mode. Numeric IDs or https://news.ycombinator.com/item?id=... only.

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

Optional UTC date YYYY-MM-DD; end dates inclusive. historyDate required for historical mode.

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

Optional UTC date YYYY-MM-DD; end dates inclusive. historyDate required for historical mode.

## `historyDate` (type: `string`):

Optional UTC date YYYY-MM-DD; end dates inclusive. historyDate required for historical mode.

## `compareFrom` (type: `string`):

Optional UTC date YYYY-MM-DD; end dates inclusive. historyDate required for historical mode.

## `compareTo` (type: `string`):

Optional UTC date YYYY-MM-DD; end dates inclusive. historyDate required for historical mode.

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

Maximum primary dataset rows; reaching cap can mean incomplete search.

## `maxRequests` (type: `integer`):

Hard request budget across source searches, comment trees, and enrichments.

## `maxComments` (type: `integer`):

Total comments including nested replies per story; output includes explicit truncation.

## `commentDepth` (type: `integer`):

0 is top-level only; maximum reply depth.

## `maxEnrich` (type: `integer`):

Upper bound for author and GitHub enrichment.

## `maxSplitBuckets` (type: `integer`):

Maximum date partitions processed. Overflow is reported.

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

Minimum HN score; Algolia may omit scores on comments.

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

Minimum comment count on stories.

## `expandQuery` (type: `boolean`):

Optional curated expansions for AI, LLM, k8s and JS; extra source requests.

## `remoteOnly` (type: `boolean`):

Filter hiring listings containing remote, WFH or distributed.

## `includeDead` (type: `boolean`):

Include posts flagged dead by HN.

## `autoSplit` (type: `boolean`):

Split date ranges over 1,000 hits. Coverage and request limits reported.

## `includeComments` (type: `boolean`):

Fetch nested reply trees as comments with parentId and depth inside each story row.

## `includeAuthorProfile` (type: `boolean`):

Optional public HN karma and submission count.

## `includeGithub` (type: `boolean`):

For GitHub repository URLs add stars, forks, language and push date.

## `parseHiring` (type: `boolean`):

Heuristically extract company, remote mention and URLs from comments; verify manually.

## `includeEmails` (type: `boolean`):

Opt in to extracting emails found in public hiring text. Raw source text may contain emails.

## `watch` (type: `boolean`):

Uses persistent named storage. Do not run same watch concurrently.

## `watchChanges` (type: `boolean`):

For existing items, include changes in points and comment count with before/after evidence.

## `baselineOnly` (type: `boolean`):

First watch run records baseline without emitting or alerting; fails closed on partial search.

## `smartAlerts` (type: `boolean`):

Send only scores >=50. Scores are heuristic and not validated.

## `watchName` (type: `string`):

Required for monitoring; letters, numbers, hyphen or underscore. Do not run same watch simultaneously.

## `githubToken` (type: `string`):

Optional token for GitHub public API only. Stored as secret.

## `webhookUrl` (type: `string`):

Optional secret incoming webhook. Only hooks.slack.com or discord.com official webhook routes are accepted.

## Actor input object example

```json
{
  "mode": "search",
  "query": "",
  "tags": "story",
  "sort": "date",
  "hiringThreadType": "hiring",
  "maxResults": 50,
  "maxRequests": 300,
  "maxComments": 30,
  "commentDepth": 3,
  "maxEnrich": 20,
  "maxSplitBuckets": 20,
  "minPoints": 0,
  "minComments": 0,
  "expandQuery": false,
  "remoteOnly": false,
  "includeDead": false,
  "autoSplit": false,
  "includeComments": false,
  "includeAuthorProfile": false,
  "includeGithub": false,
  "parseHiring": false,
  "includeEmails": false,
  "watch": false,
  "watchChanges": false,
  "baselineOnly": true,
  "smartAlerts": false
}
```

# Actor output Schema

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

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,amygraphics/hacker-news-intelligence"
        }
    }
}
```

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/3MUBapiGnDDFTMhxx/builds/O8te0Bdh0NpyHoGaB/openapi.json
