Hacker News Search

Search Hacker News stories and comments: title, link, points, author, comment count, date and text, by relevance or date.

Pay by wallet (x402) hacker-news-search

Example

Input
{
  "query": "deno 1.0",
  "limit": 3
}
Answer
{
  "sort": "relevance",
  "type": "story",
  "query": "deno",
  "results": [
    {
      "id": "23172483",
      "url": "https://deno.land/v1",
      "text": null,
      "type": "story",
      "title": "Deno 1.0",
      "author": 3803,
      "hn_url": "https://news.ycombinator.com/item?id=23172483",
      "points": 2081,
      "story_id": 23172483,
      "created_at": "2020-05-13T22:18:14Z",
      "num_comments": 583
    }
  ],
  "returned": 1,
  "total_results": 34746
}

Inputs

FieldTypeRequiredWhat it is
sortstringNorelevance (default) or date
typestringNostory (default), comment, or all
limitintegerNoResults to return, 1-30. Default: 10
querystringYesSearch terms. At least 2 characters.
since_daysintegerNoOnly items created within the last N days

Output fields

How reliably each field appears in a successful answer.

FieldTypeAppears
typestringAlways (present in every successful answer)
querystringAlways (present in every successful answer)
resultsarrayAlways (present in every successful answer)
returnednumberAlways (present in every successful answer)
total_resultsnumberAlways (present in every successful answer)
sort—Always (present in every successful answer)

How to call it

The same tool through each route. MCP clients reach it through Strale’s server at https://api.strale.io/mcp; the call below is what the agent sends.

# Needs an API key. max_price_cents caps what this call may cost.
curl -X POST https://api.strale.io/v1/do \
  -H "Authorization: Bearer $STRALE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "capability_slug": "hacker-news-search",
    "inputs": {
      "query": "deno 1.0",
      "limit": 3
    },
    "max_price_cents": 2
  }'

Limitations

  • Comment and story text is truncated at 500 characters

    Long self-posts and comments are clipped; the hn_url points at the full item.

    What to do instead: Fetch hn_url with url-to-text for the complete thread.

  • Search index, not the live site

    Algolia indexes items within minutes of posting, but points and comment counts can lag the live page.

Related tools