# Hacker News Pulse: Trending Stories with Velocity Scores (`54m_music/hacker-news-pulse`) Actor

Search Hacker News by keyword and get each story with computed velocity: points per hour, discussion ratio, trending flag and a 0-100 pulse score. Official HN Algolia API, no login, no proxy.

- **URL**: https://apify.com/54m_music/hacker-news-pulse.md
- **Developed by:** [Sam](https://apify.com/54m_music) (community)
- **Categories:** News, Developer tools, AI
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 scored 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 Pulse: trending stories with velocity scores

Search Hacker News for any keyword and get every matching story **already scored**: points per hour,
a 0-100 pulse score, a trending flag and the kind of discussion it started. Use it to spot launches
that are taking off, track your brand or competitors on HN, or feed an AI agent a ranked list
instead of raw search results.

### What you get for each story

| Field | What it means |
| --- | --- |
| `title`, `url`, `domain`, `hnUrl` | The story, where it links, and its Hacker News thread |
| `storyType` | `story`, `show_hn` or `ask_hn` |
| `postedAt`, `ageHours` | When it was posted and how old it is now |
| `points`, `comments` | The live counts at run time |
| `pointsPerHour` | Upvote speed: points divided by age in hours, with age floored at 0.25 h (a 2-hour-old story with 60 points scores 30) |
| `commentsPerPoint` | Comments for each upvote |
| `discussion` | `quiet` when points and comments are both under 5; otherwise by comments per point: `debate` at 1.0 or more, `applause` under 0.3, `conversation` between |
| `pulseScore` | 0-100. 60% is the story's speed rank inside this run, 40% is its absolute speed (full marks at 50 points an hour) |
| `trending` | `true` when the pulse score is 70+ and the story has at least 10 points |
| `keywordInTitle` | `true` when every word of your keyword is in the title, not only in the URL or text |

Results are sorted by pulse score, highest first. Author usernames are not collected.

### Input

| Field | Default | Notes |
| --- | --- | --- |
| `queries` | `["AI agents"]` | One or more keywords; each is searched separately |
| `storyType` | `story` | `story`, `show_hn` or `ask_hn` |
| `sinceHours` | 72 | Only stories posted in this window (up to one year) |
| `minPoints` | 0 | Skip low-scoring stories |
| `maxItems` | 100 | Cap per keyword |

```json
{ "queries": ["AI agents", "Rust"], "storyType": "story", "sinceHours": 72, "maxItems": 30 }
```

### Output example

```json
{
  "query": "AI agents",
  "title": "Show HN: An open-source agent that runs your CI",
  "domain": "github.com",
  "hnUrl": "https://news.ycombinator.com/item?id=50480000",
  "storyType": "show_hn",
  "points": 148, "comments": 61, "ageHours": 5.2,
  "pointsPerHour": 28.46, "commentsPerPoint": 0.41,
  "discussion": "conversation", "pulseScore": 83, "trending": true, "keywordInTitle": false
}
```

### Pricing

Pay per event: you pay only for scored stories written to the dataset (see the Pricing tab), plus the
standard Apify start event. No proxy or browser is used, so runs are small and fast: 60 stories take
about 10 seconds.

### How it works and limits

- Data comes from the official Hacker News search API by Algolia (`hn.algolia.com`). No login, no
  scraping of news.ycombinator.com pages.
- Points and comments are a snapshot at run time. Schedule the Actor (for example every hour) to
  follow a story's rise.
- The run fails with a clear message when nothing matches, so an empty run costs only the US$0.00005 start event.

### FAQ

**Can I monitor my brand?** Yes. Put your brand and product names in `queries`, set `sinceHours`
to 24 and schedule a daily run. Use an Apify integration (Slack, email, webhook) on `trending = true`.

**Why is a story with fewer points ranked above one with more?** Pulse measures speed. A young story
gaining points quickly outranks an old one that has stopped moving.

# Actor input Schema

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

One or more search terms. Each term is searched in story titles, URLs and text.

## `storyType` (type: `string`):

Limit to all stories, Show HN or Ask HN.

## `sinceHours` (type: `integer`):

Only stories posted within this many hours.

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

Skip stories below this score.

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

Stop after this many stories for each keyword.

## Actor input object example

```json
{
  "queries": [
    "AI agents"
  ],
  "storyType": "story",
  "sinceHours": 72,
  "minPoints": 0,
  "maxItems": 20
}
```

# Actor output Schema

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

Every scored row in the default dataset, overview table view.

## `allFields` (type: `string`):

Every row with all fields.

# 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 = {
    "queries": [
        "AI agents"
    ],
    "sinceHours": 72,
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("54m_music/hacker-news-pulse").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 = {
    "queries": ["AI agents"],
    "sinceHours": 72,
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("54m_music/hacker-news-pulse").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 '{
  "queries": [
    "AI agents"
  ],
  "sinceHours": 72,
  "maxItems": 20
}' |
apify call 54m_music/hacker-news-pulse --silent --output-dataset

```

## MCP server setup

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

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/QibMylg3uOhnwGysk/builds/t61GPBdQsB9pOiUMG/openapi.json
