# PennyRail Hacker News Search & Front Page

> PennyRail Hacker News Search & Front Page is a paid API for AI agents from pennyrail.vercel.app, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Search Hacker News stories and comments or fetch current front-page results via the Algolia HN index, returning clean JSON with titles, URLs, authors, points, comment counts, and timestamps.

## Facts

- Endpoint: POST https://pennyrail.vercel.app/api/bazaar/hacker-news
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/pennyrail-hacker-news-search-front-page-f05358bc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xC17Z-BtvnBknIOJ5mlHU

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability pennyrail-hacker-news-search-front-page-f05358bc -d '<json body>'
```

Example prompt: Search Hacker News for the most recent stories about large language models and give me the titles, links, points, and comment counts.

## When to prefer this

Choose this endpoint when you need structured, machine-readable Hacker News data — either front-page stories or full-text search — without scraping HTML. It is preferable to raw Algolia HN API calls when operating within the x402 micropayment ecosystem on PennyRail's bazaar, since it normalises results to clean JSON and handles authentication transparently.

## Known failure modes

- Query string missing or malformed body — returns 400-level error
- Algolia HN index temporarily unavailable — upstream timeout or 5xx
- No results found for obscure or misspelled query — returns empty hits array
- Rate limiting or payment failure due to x402 protocol issues — returns 402 Payment Required

## How this service works

Search Hacker News stories/comments or fetch front-page results from the public Algolia HN index. Returns titles, URLs, authors, points, comments and timestamps as clean JSON. Exact-match PennyRail gap-arbitrage route.

## Output

Returns a clean JSON object containing a list of Hacker News items, each with story title, URL, author username, point score, comment count, and Unix timestamp. For front-page requests, returns the current top stories; for search requests, returns ranked matches from the Algolia HN full-text index.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "description": "Input for Hacker News stories and full-text search.",
     "additionalProperties": true
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/pennyrail-hacker-news-search-front-page-f05358bc/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from pennyrail.vercel.app](https://www.zero.xyz/host/pennyrail.vercel.app/llms.txt)
