# Hacker News Domain Stats

> Hacker News Domain Stats is a paid API for AI agents from hacker-news.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-11-02).

Returns story count, total points, total comments, and top stories for a given domain submitted to Hacker News within a specified date range.

## Facts

- Endpoint: GET https://hacker-news.x402tookit.com/hn-domain-stats?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/hacker-news-domain-stats-07661b2b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ITj-MIw2p5TsZ6gfrjk6j

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 hacker-news-domain-stats-07661b2b
```

Example prompt: How did github.com perform on Hacker News from January 1 to March 31 2025? Show me the top 5 stories, total points, and comment counts.

## When to prefer this

Use this endpoint when you need aggregated analytics (counts, total points, total comments) for all Hacker News submissions linking to a specific domain over a date window, especially when you want to measure a domain's overall community reception or compare performance across periods. Prefer this over the HN search endpoint when you want computed statistics rather than raw story lists, or over the date-based best-stories endpoint when you need domain-scoped rather than global rankings.

## Known failure modes

- Missing required parameters (domain, from, to) returns a validation error
- Date window exceeding 366 days may be rejected or return partial results
- Unknown or very obscure domains may return zero stories with empty topStories array
- Algolia HN Search API downtime may result in degraded or partial response with degraded flag set
- Invalid date format (not YYYY-MM-DD) causes a parse error
- top parameter outside 1-10 range may be clamped or rejected

## How this service works

Hacker News stories linking to a domain in a date window: count, total points and comments, and the top stories.

## Output

Returns an object with the queried domain and date window, story count, total points, total comments, average points per story, count of stories over 100 points, number of search matches, a summary verdict, and an array of top stories each containing title, author, score, comment count, post date, HN discussion URL, and the story URL. May include partial/degraded flags if data coverage is incomplete.

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "domain",
      "from",
      "to"
     ],
     "properties": {
      "to": {
       "type": "string",
       "description": "Last UTC day YYYY-MM-DD (inclusive, window up to 366 days)"
      },
      "top": {
       "type": "integer",
       "description": "Top stories to list, 1 to 10 (default 5)"
      },
      "from": {
       "type": "string",
       "description": "First UTC day YYYY-MM-DD"
      },
      "domain": {
       "type": "string",
       "description": "Domain such as github.com (subdomains included)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "to": {
       "type": [
        "null",
        "string"
       ]
      },
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "from": {
       "type": [
        "null",
        "string"
       ]
      },
      "domain": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "partial": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "avgPoints": {
       "type": [
        "null",
        "number"
       ]
      },
      "sourceUrl": {
       "type": [
        "null",
        "string"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": 
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/hacker-news-domain-stats-07661b2b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from hacker-news.x402tookit.com](https://www.zero.xyz/host/hacker-news.x402tookit.com/llms.txt)
