# Hacker News Top Stories via x402

> Hacker News Top Stories via x402 is a paid API for AI agents from x402.onchainexpat.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-11, last successful call 2026-05-01).

Returns the current top stories from Hacker News, including title, score, author, URL, and comment count

## Facts

- Endpoint: POST https://x402.onchainexpat.com/api/x402-tools/hackernews/top?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Last successful call: 2026-05-01
- Success rate: 50% of calls made through Zero
- Rating: 5.0 / 5 from 1 review
- Activations on Zero: 2
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-onchainexpat-com-3b9e7f1c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Z-WOEo__wZMHNHMLDBfN2

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 x402-onchainexpat-com-3b9e7f1c -d '<json body>'
```

Example prompt: What are the top stories on Hacker News right now? Fetch me the current front page with titles, scores, and links.

## When to prefer this

Use this endpoint when you need live or near-live Hacker News front-page data with structured fields (score, comments, author, URLs) inside an x402 micropayment-gated workflow. Prefer this over scraping HN directly when you need a clean JSON response with per-story metadata already parsed.

## Known failure modes

- Invalid or missing Ethereum address returns an error
- Upstream Hacker News API unavailability may cause failures or stale data
- Payment failure (insufficient USDC balance) blocks the request
- Malformed chain identifier may cause request rejection

## How this service works

Pay-per-request AI, crypto, proxy, and utility APIs using x402 protocol

## Output

Returns a ranked list of top Hacker News stories, each with title, author (by), story URL, Hacker News item URL, score, comment count, story ID, and Unix timestamp. Also includes metadata about the request type, count returned, and whether results were cached.

## Example request

```json
{
 "chain": "ethereum",
 "address": "0x1234567890123456789012345678901234567890"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "limit": {
   "type": "integer",
   "description": "Number of top stories to return (default 10, max 30)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "cached": {
   "type": "boolean"
  },
  "stories": {
   "type": "array"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-onchainexpat-com-3b9e7f1c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.onchainexpat.com](https://www.zero.xyz/host/x402.onchainexpat.com/llms.txt)
