Hacker News hub

Hacker News Search API

Full-text search across stories, comments, Ask HN, Show HN, jobs, and polls — with filters brand and launch monitors actually use.

GET /v1/hackernews/search

1 credit per successful request.

About this endpoint

Brand mentions, launch threads, and Show HN products still move markets on Hacker News. Keyword monitoring that scrapes the site HTML for every phrase does not scale, and wiring a separate search client yourself means yet another envelope and billing path beside Reddit or Web rows.

`GET /v1/hackernews/search` is the dedicated search route. Pass a `query` (required unless `frontPageOnly`, `domain`, or `url` covers the request), send `x-api-key`, and read `data.hits` with page metadata under `data.page`. Optional filters include `type` (story, comment, ask_hn, show_hn, launch_hn, job, poll, or all), `sort` (popularity or date), `dateRange`, `author`, `domain`, `url`, and `minPoints`. Page with zero-based `page` and `pageSize` (up to 1,000 accessible hits).

Credit pricing for this operation comes from the API registry and appears on this page, and `meta.creditsCharged` is the billing source of truth. For ranked digests without a keyword, use the feeds route; for a known item id, use stories or items instead.

Hacker News Search API FAQ

How do I search Hacker News via API?

Call GET /v1/hackernews/search with your Social Fetch API key in the x-api-key header. Pass a query string, or use frontPageOnly, domain, or url when those filters replace a free-text query. Read data.hits and data.page. Full parameters are in the API docs linked from this page.

How many credits does Hacker News search cost?

Pricing is documented on the operation in the API registry (shown on this page). Confirm on every response with meta.creditsCharged — that field is the billing source of truth.

What filters does Hacker News search support?

Optional type (all, story, comment, ask_hn, show_hn, launch_hn, job, poll), sort (popularity or date), dateRange (24h, week, month, year, all), author, domain, url, minPoints, frontPageOnly, and search-field toggles such as searchStoryText, searchAuthor, prefix, and typoTolerance. Keep filter values identical across pages.

How does pagination work on Hacker News search?

Use zero-based page and pageSize query params. data.page reports returned, hasMore, nextPage, totalHits, and maxAccessibleHits (capped at 1,000). When hasMore is true, request the next page index with the same filters.

Search vs feeds vs story lookup?

Use search for keyword, author, domain, or URL discovery. Use GET /v1/hackernews/feeds/{feed} for ranked digests (top, new, best, ask, show, jobs). Use GET /v1/hackernews/stories/{id} when you already know the story id.

Do I need a Hacker News account?

No. Social Fetch authenticates with your Social Fetch API key only. You do not pass HN credentials for this public search route.

Can I use this for brand or launch monitoring?

Yes. Teams poll search for product names, competitor domains, and minPoints thresholds, then fan out to story or comment routes when a hit needs a full thread. Persist meta.requestId when you need to debug an empty page.