# Show HN Launch Rank (`realai_pl/show-hn-launch-rank`) Actor

Current Show HN rank and discussion from the official Hacker News Firebase API.

- **URL**: https://apify.com/realai\_pl/show-hn-launch-rank.md
- **Developed by:** [Dawid Mańkowski](https://apify.com/realai_pl) (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 $1.00 / 1,000 delivered show hn launches

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
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

## Show HN Launch Momentum Monitor

Track how Show HN launches move, not just what is currently in the feed. The Actor reads the official Hacker News Firebase `showstories` order and compares each launch with its previous snapshot under the same `stateKey`.

### What it detects

Each delivered launch includes the current Show HN rank, score and comment count plus stateful deltas:

- `NEW_LAUNCH`
- `RANK_UP` / `RANK_DOWN`
- `SCORE_UP` / `SCORE_DOWN`
- `COMMENTS_UP` / `COMMENTS_DOWN`

`rankDelta` is positive when a launch moves **up** the Show HN list. For example, rank 18 -> rank 11 gives `rankDelta: 7`.

`momentumScore` is a transparent heuristic, not a prediction: `rankDelta * 2 + scoreDelta + commentsDelta * 2`. It makes repeated snapshots easier to sort by attention change. `rankVelocityPerHour` reports rank positions gained/lost per hour when at least one minute elapsed between snapshots.

### Source and coverage

Source: the official Hacker News Firebase API (`https://hacker-news.firebaseio.com/v0/`). Hacker News documents that `showstories` exposes up to 200 recent Show HN stories. `showRank` is the exact position in that source list before local filtering.

The Actor does not scrape Hacker News HTML and does not require a login, browser or proxy.

### Example: establish a baseline

```json
{
  "limit": 20,
  "scanLimit": 100,
  "minScore": 0,
  "minComments": 0,
  "emitMode": "all",
  "stateKey": "my-launch-watch"
}
```

The first run marks unseen launches as `NEW`. Run again with the same `stateKey` to get previous values and deltas.

### Example: deliver only useful monitoring events

```json
{
  "limit": 50,
  "scanLimit": 200,
  "emitMode": "new_or_changed",
  "stateKey": "my-launch-watch"
}
```

Unchanged launches are still used to refresh the stored snapshot but are suppressed before dataset delivery and pay-per-event billing.

### Filters

- `keyword`: case-insensitive match across title, Show HN text and submitted URL.
- `minScore`: minimum HN points.
- `minComments`: minimum discussion count.
- `limit`: maximum matching launches processed, up to 100.
- `scanLimit`: how many Show HN feed positions to inspect, up to 200.
- `emitMode`: `all`, `new`, `changed`, or `new_or_changed`.
- `stateKey`: independent state namespace for a schedule/watchlist.

`onlyNew` remains supported for backward compatibility. When enabled while `emitMode` is `all`, it behaves as `new`.

### Output

Core fields:

`id`, `showRank`, `title`, `text`, `url`, `domain`, `hnUrl`, `author`, `score`, `comments`, `publishedAt`, `collectedAt`.

Monitoring fields:

`changeType`, `changeTypes`, `previousRank`, `rankDelta`, `previousScore`, `scoreDelta`, `previousComments`, `commentsDelta`, `rankVelocityPerHour`, `momentumScore`, `firstSeenAt`, `lastSeenAt`.

The `RUN_SUMMARY` record reports fetched, delivered, suppressed, new, changed and unchanged counts plus the effective delivery mode.

### State semantics

Snapshots are isolated by Apify user plus `stateKey` and capped at 10,000 launch IDs. Use a different `stateKey` for a separate watchlist. Avoid concurrent runs sharing the same key because concurrent writes can race.

Older `SEEN_IDS` state from version 0.1 is recognized: an already-seen launch is migrated to a baseline instead of being falsely emitted as a brand-new launch after upgrading.

### Pricing

The PPE event `delivered-launch` remains **$0.001 per delivered row** ($1 per 1,000 delivered rows). Suppressed unchanged rows do not generate this event. Apify compute/storage consumption is separate from PPE delivery charges and depends on the run.

# Actor input Schema

## `keyword` (type: `string`):

Optional case-insensitive filter across the launch title, text and submitted URL.

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

Only include launches with at least this Hacker News score.

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

Only include launches with at least this many comments.

## `limit` (type: `integer`):

Maximum matching launches processed in this run, from 1 to 100.

## `scanLimit` (type: `integer`):

How many positions from the official Show HN feed to inspect before applying filters. Hacker News exposes up to 200 recent Show HN stories.

## `emitMode` (type: `string`):

Monitoring modes suppress unchanged rows before pay-per-event billing.

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

Backward-compatible option. When enabled with What to deliver = all, only new launch IDs are delivered.

## `stateKey` (type: `string`):

Reuse the same key on scheduled runs to compare each launch against its previous snapshot; use a different key for an independent watchlist.

## Actor input object example

```json
{
  "keyword": "",
  "minScore": 0,
  "minComments": 0,
  "limit": 20,
  "scanLimit": 100,
  "emitMode": "all",
  "onlyNew": false,
  "stateKey": "default"
}
```

# Actor output Schema

## `items` (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("realai_pl/show-hn-launch-rank").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("realai_pl/show-hn-launch-rank").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 realai_pl/show-hn-launch-rank --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,realai_pl/show-hn-launch-rank"
        }
    }
}
```

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/jrt6PGyoCqRAzWGP8/builds/ujp2zaj6xxLnMdAtl/openapi.json
