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
| Field | Type | Required | What it is |
|---|---|---|---|
sort | string | No | relevance (default) or date |
type | string | No | story (default), comment, or all |
limit | integer | No | Results to return, 1-30. Default: 10 |
query | string | Yes | Search terms. At least 2 characters. |
since_days | integer | No | Only items created within the last N days |
Output fields
How reliably each field appears in a successful answer.
| Field | Type | Appears |
|---|---|---|
type | string | Always (present in every successful answer) |
query | string | Always (present in every successful answer) |
results | array | Always (present in every successful answer) |
returned | number | Always (present in every successful answer) |
total_results | number | Always (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
}' {
"tool": "strale_execute",
"arguments": {
"slug": "hacker-news-search",
"inputs": {
"query": "deno 1.0",
"limit": 3
},
"max_price_cents": 2
}
} import { Strale } from "straleio";
const strale = new Strale({ apiKey: process.env.STRALE_API_KEY! });
const result = await strale.do({
capability_slug: "hacker-news-search",
inputs: {
"query": "deno 1.0",
"limit": 3
},
max_price_cents: 2,
}); import os
from straleio import Strale, DoRequest
strale = Strale(api_key=os.environ["STRALE_API_KEY"])
result = strale.do(DoRequest(
capability_slug="hacker-news-search",
inputs={
"query": "deno 1.0",
"limit": 3,
},
max_price_cents=2,
)) # No account. The first request answers 402 with the price in USDC;
# an x402 client pays it from your wallet and repeats the request.
curl -i -X POST https://api.strale.io/x402/v2/hacker-news-search \
-H 'Content-Type: application/json' \
-d '{
"query": "deno 1.0",
"limit": 3
}' 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
- Academic Paper Search €0.03
- arXiv Search €0.02
- Clinical Trials Search €0.03
- DOI Resolver €0.02
- Job Board Search €0.20
- Paper Details €0.02