# Hacker News Story & Comment Search

> Hacker News Story & Comment Search 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).

Search Hacker News stories or comments by keyword query with optional date range filtering, sorted by relevance or date.

## Facts

- Endpoint: GET https://hacker-news.x402tookit.com/hn-search?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-story-comment-search-cdf7f046
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_zUUU5eMJGpqRH0hF5APju

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-story-comment-search-cdf7f046
```

Example prompt: Search Hacker News for stories about 'WebAssembly' from January 2024 to March 2024, sorted by relevance, and show me the top 10 results.

## When to prefer this

Choose this endpoint when you need full-text search across Hacker News content with keyword queries, especially when you need date-range filtering or the ability to search comments as well as stories. Prefer this over the 'top/new/best stories' endpoint when you want relevance-ranked results for a specific topic rather than time-based front-page rankings, and over the 'domain links' endpoint when you're searching by topic rather than by source domain.

## Known failure modes

- Missing required 'query' parameter returns an error
- Date range with 'from' after 'to' may return empty results or an error
- Limit outside 1–20 range may be rejected or clamped
- Very broad queries may return degraded/partial results (degraded flag set to true)
- No results found returns empty results array with totalMatches: 0
- Network or upstream Algolia API failure returns a non-200 response

## How this service works

Search Hacker News stories or comments by query with optional date range, sorted by relevance or date.

## Output

Returns a list of up to 20 matching Hacker News stories or comments, each with title, URL, author, point score, comment count, post date, and a link to the HN discussion thread. Also includes metadata such as total match count, the applied query/date filters, sort order, and an optional summary or verdict about the results.

## 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": [
      "query"
     ],
     "properties": {
      "to": {
       "type": "string",
       "description": "Last UTC day YYYY-MM-DD (inclusive)"
      },
      "from": {
       "type": "string",
       "description": "First UTC day YYYY-MM-DD"
      },
      "sort": {
       "type": "string",
       "description": "relevance (default) or date (newest first)"
      },
      "tags": {
       "type": "string",
       "description": "story (default) or comment"
      },
      "limit": {
       "type": "integer",
       "description": "Results 1 to 20 (default 10)"
      },
      "query": {
       "type": "string",
       "description": "Search text, e.g. rust async"
      }
     }
    }
   },
   "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"
       ]
      },
      "kind": {
       "type": [
        "null",
        "string"
       ]
      },
      "sort": {
       "type": [
        "null",
        "string"
       ]
      },
      "query": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "results": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "object",
        "properties": {
         "by": {
          "type": [
           "null",
           "string"
          ]
         },
         "id": {
          "type": [
           "null",
           "number"
          ]
         },
         "url": {
          "type": [
           "null",
        
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/hacker-news-story-comment-search-cdf7f046/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)
