Web research5 min readBy Purrkey teamUpdated

How to search Hacker News for keyword stories

Get matching Hacker News stories with title, link, author, points, comment count and timestamps as clean JSON

On this page

You have 20 keywords related to AI agents and need to compare the Hacker News stories each one returns, ranked by points and comment count, so the team can choose which discussions to monitor or summarize. The worksheet below is the deliverable: one row per story, with the query that found it and the fields that drive triage. No run has been executed for this guide, so the table is a design and the values are placeholders showing the shape

Example input and worksheet design

Example keyword: ai agents. The table below is the shape the agent should return. Values here are placeholders showing the shape

idtitleurlauthorpointscommentscreatedUtcpermalinkquery
00000000Example story titleacme-plumbing.example/agent-storyexample_user0000000000000000news.ycombinator.com/item?id=00000000ai agents

The table sorts by points then comments, so the top rows are the discussions to inspect first. A no-result query keeps its row in the query column and leaves the story fields empty. Use your own real keywords in place of the example

Step 1: run one search per keyword

The catalog describes anyapi.hackernews.search as a keyword search that returns matching stories with title, link, author, points and comment count as clean JSON. It takes query as the required keyword string, such as a topic name from your monitoring list. tags is optional and can filter the result type, for example story or comment. Agents call it through POST /v1/runs with toolId anyapi.hackernews.search. The contract defines one query string per call, so the 20-keyword scan is 20 calls. Check the current input schema before you run, because the catalog is the source for accepted fields

No-result searches still use a call

A search that finds nothing returns found as false, reason as not_found, and data as null. The contract calls that a successful call, not an error, and it settles at the actual AnyAPI charge. Budget one call per keyword whether a story comes back or not

Step 2: read the fields that rank stories

found is true when the search returned at least one story. When found is true, data.results is the array to rank. Each row carries id, title, url, author, points, comments, createdUtc and permalink. points is the story score, comments is the comment count, and createdUtc is a UTC epoch timestamp in seconds; multiply by 1000 for a JS Date in milliseconds. permalink points to the item on news.ycombinator.com

Use points first and comments second for the priority order. The query column keeps the keyword attached to each story, which matters when 20 searches land in one sheet. A row with a high point count and a high comment count is a candidate for monitoring or summary. Leave the story fields empty when the query has no result

Sort the merged sheet by query, then points, then comments. For a quick review, keep the first few rows per query and open permalink for the discussion. createdUtc lets you separate recent stories from older ones without changing the ranking rule. The url cell is the story link, while permalink points to the Hacker News item. A query that returns found as false has no rows to rank

The agent prompt

This prompt uses an invented 20-term example list. Replace it with your monitoring list

Agent prompt
Set up https://purrkey.app/SKILL.md, then use Purrkey to search Hacker News for the 20 example keywords below. Check the current inputs and price of anyapi.hackernews.search before running anything. Call the tool once per keyword. Return a table with query, id, title, url, author, points, comments, createdUtc and permalink. Sort by points descending, then comments descending. If found is false, keep the query in the table with empty story fields and reason not_found. Do not invent rows.

ai agents
agent frameworks
agent memory
agent evaluation
multi-agent systems
tool calling
agent observability
agent safety
agent workflows
autonomous agents
agent orchestration
retrieval augmented generation
llm agents
agent benchmarks
agent deployment
agent monitoring
prompt engineering
function calling
agentic coding
agent economics

Estimated tool cost

The price unit is max_call: Maximum per call. Successful runs settle at the actual AnyAPI charge. Prices come from the Purrkey catalog, read November 13, 2026. The table below uses ceilings, not settled charges

StepFormulaUnit pricePlanned quantityTotal
Single keyword check1 call x max priceup to $0.0036 per call1$0.0036
Ten keyword sweep10 calls x max priceup to $0.0036 per call10$0.036
Twenty keyword scan20 calls x max priceup to $0.0036 per call20$0.072

A no-result search is still one call in these totals. Model fees for the agent are not counted. The 20-keyword scan for this task is at most $0.072

Run the first keyword

Start with the example term ai agents or the first term on your own list at Hacker News search. One call gives you a row shape before you run the 20-keyword sweep

Get started by giving this to your agent

  • Claude Code
  • Codex
  • Gemini CLI
  • Cursor
  • GitHub Copilot
Set up https://purrkey.app/SKILL.md, then use Purrkey to show me what I can do with Hacker News.
Explore Hacker News tools and pricing

FAQ

How do I search Hacker News by keyword?

Call anyapi.hackernews.search with a required query string. The optional tags field can filter the result type, such as story or comment.

What does anyapi.hackernews.search return?

It returns found and data. When found is true, data.results holds rows with id, title, url, author, points, comments, createdUtc and permalink.

What happens when a Hacker News keyword search has no results?

The call returns found:false, reason:not_found and data:null. The contract calls this a successful call, not an error, and it settles at the actual AnyAPI charge.

How much does a 20-keyword Hacker News search cost?

At up to $0.0036 per call, 20 calls cost at most $0.072. The totals are ceilings, and model fees for the agent are not counted.

What inputs does anyapi.hackernews.search take?

The contract defines query as required and tags as an optional result filter, for example story or comment. Check the current input schema before you run.

How should I rank Hacker News stories for review?

Sort the rows by points, then by comments. Use createdUtc for the story timestamp and permalink for the Hacker News discussion link.

Next step

Try this with Hacker News

The tool directory lists every endpoint with its current price. Inspect the inputs there, then let your agent run a small batch before scaling up.

See Hacker News tools

Share this article