# Hacker News Daily Digest & Discussions Extractor (RAG) (`slavako/hacker-news-daily-digest-rag`) Actor

Scrape top trending stories, discussions, scores, and comment threads from Hacker News in clean Markdown. Zero-cost fast Firebase REST engine.

- **URL**: https://apify.com/slavako/hacker-news-daily-digest-rag.md
- **Developed by:** [Sviatoslav](https://apify.com/slavako) (community)
- **Categories:** News, AI, Developer tools
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 story records

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Daily Digest & Discussions Extractor (RAG)

[![Apify](https://img.shields.io/badge/Apify-Actor-FF6600?style=for-the-badge\&logo=apify\&logoColor=white)](https://apify.com/slavako/hacker-news-daily-digest-rag)
[![Zero-Cost Architecture](https://img.shields.io/badge/Architecture-100%25_Zero--Cost-success?style=for-the-badge)](https://apify.com/slavako/hacker-news-daily-digest-rag)
[![Monetization](https://img.shields.io/badge/Monetization-Pay--Per--Event-blue?style=for-the-badge)](https://apify.com/slavako/hacker-news-daily-digest-rag)
[![Standby MCP Ready](https://img.shields.io/badge/Standby-MCP_Ready-purple?style=for-the-badge)](https://apify.com/slavako/hacker-news-daily-digest-rag)

High-speed, zero-proxy-cost Hacker News trending stories and discussions extractor. Powered by the official Firebase REST API, it extracts top stories, submitter profiles, scores, comment counts, and compiles top-level community discussion threads into structured GitHub-flavored Markdown for AI coding assistants (Claude Desktop, Cursor), RAG vector pipelines, and automated tech newsletters.

***

### ⚡ Key Features

- **No API Rate Limits:** Connects directly to the official Hacker News Firebase REST API with sub-50ms latency.
- **Multiple Feed Options:** Extract stories from `top`, `best` (curated high-score), `new`, `ask` (Ask HN), or `show` (Show HN).
- **RAG-Ready Discussion Digest:** Formats story submissions and top community comments into clean Markdown blockquotes ready for embedding or summarization.
- **Standby Server & MCP Ready:** Run continuously in low-cost standby mode for instantaneous retrieval over HTTP endpoints (`/api/digest`).
- **100% Zero-Cost Architecture:** Lightweight HTTP engine requiring only 128 MB RAM, zero headless browser overhead, sub-second execution.

***

### 💰 Pay-Per-Event (PPE) Pricing

Transparent pricing with low barrier to entry:

| Event Name | Event Price (USD) | Description |
| :--- | :--- | :--- |
| **Actor Start** (`apify-actor-start`) | `$0.003` | Charged once when the Actor run initializes. |
| **Story Record** (`apify-default-dataset-item`) | `$0.001` | Charged per Hacker News story pushed to dataset. |
| **Discussion Markdown Enriched** (`hn-discussion-markdown-enriched`) | `$0.002` | Charged when story discussions and top comments are compiled into clean Markdown. |

***

### 📥 Input Parameters

| Parameter | Type | Required | Default | Description |
| :--- | :--- | :---: | :--- | :--- |
| `feed` | `string` | **Yes** | `top` | Hacker News feed: `top`, `best`, `new`, `ask`, or `show`. |
| `maxStories` | `integer` | No | `20` | Maximum number of stories to extract (1–50). |
| `includeTopComments` | `boolean` | No | `true` | Extract top-level comments and format them into Markdown. |
| `maxCommentsPerStory` | `integer` | No | `3` | Number of top comments to retrieve per story (1–10). |

#### Example Input

```json
{
  "feed": "top",
  "maxStories": 10,
  "includeTopComments": true,
  "maxCommentsPerStory": 3
}
```

***

### 📤 Output Dataset Format

Each story record pushed to the default dataset contains:

```json
{
  "id": 40123456,
  "title": "Show HN: Fast Vector Search in Rust",
  "url": "https://github.com/example/rust-vector",
  "hnDiscussionUrl": "https://news.ycombinator.com/item?id=40123456",
  "author": "rust_dev",
  "score": 245,
  "commentCount": 68,
  "feed": "top",
  "digestMarkdown": "## [Show HN: Fast Vector Search in Rust](https://github.com/example/rust-vector)\n\n- **Score:** 245 points | **Author:** [rust_dev](https://news.ycombinator.com/user?id=rust_dev) | **Comments:** 68\n- **Discussion:** https://news.ycombinator.com/item?id=40123456\n\n### Top Community Insights\n\n> **@commenter1:**\n>\n> Incredible throughput benchmarks on AVX-512...",
  "publishedAt": "2026-11-20T05:00:00.000Z",
  "scrapedAt": "2026-11-20T06:21:00.000Z"
}
```

***

### 🤖 Model Context Protocol (MCP) Integration

This Actor supports Apify Standby Server mode (`process.env.APIFY_META_ORIGIN === 'STANDBY'`). Once started in standby, query the digest directly:

```bash
GET /api/digest?feed=top&limit=5&comments=true
```

***

### 📜 Legal & Compliance Disclaimer

This Actor is an independent open-source tool developed by Slavako and is not affiliated with, endorsed by, or sponsored by Hacker News or Y Combinator. All trademarks belong to their respective owners. Scrapes only publicly accessible Firebase REST endpoints.

# Actor input Schema

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

Select the Hacker News feed to extract stories from.

## `maxStories` (type: `integer`):

Number of stories to extract from the selected feed (1 to 50).

## `includeTopComments` (type: `boolean`):

Extract top-level comments and format them into structured Markdown for AI context.

## `maxCommentsPerStory` (type: `integer`):

Maximum number of top comments to extract per story (1 to 10).

## Actor input object example

```json
{
  "feed": "top",
  "maxStories": 20,
  "includeTopComments": true,
  "maxCommentsPerStory": 3
}
```

# Actor output Schema

## `dataset` (type: `string`):

Extracted Hacker News stories, scores, submitters, discussion comments, and formatted Markdown.

# 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("slavako/hacker-news-daily-digest-rag").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("slavako/hacker-news-daily-digest-rag").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 slavako/hacker-news-daily-digest-rag --silent --output-dataset

```

## MCP server setup

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

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/C2raKbYjclZ5CUTut/builds/4Cv0u0MwBJOmZ5A4U/openapi.json
