GroundsocialDocs

API · Hacker News

GET /hackernews/search

Search Hacker News stories or comments, by relevance or date.

RequestGET /v1/hackernews/search
Operation idhackernews.search.stories
Cost1 credit, refunded if the call fails
AuthAPI key: Authorization: Bearer <key> or x-api-key.

Search Hacker News stories or comments, by relevance or date.

Query parameters

NameTypeRequiredDescription
qstringyesSearch terms. Example: rust.
tagsstringnoAlgolia tags. Defaults to story.
numericFiltersstringnoe.g. points>100,created_at_i>1700000000
sort"relevance" | "date"norelevance (default) or date. One of relevance, date.
hitsPerPageintegernoHits per page, 1 to 1000. Defaults to 30.
pageinteger | nullnoPage number, 0 to 999 (0 is the first page). Defaults to 0.
sincestringnoOnly rows published on or after this date: YYYY-MM-DD (midnight UTC) or an ISO 8601 timestamp. Example: 2026-01-01.
untilstringnoOnly rows published on or before this date: YYYY-MM-DD (that whole UTC day) or an ISO 8601 timestamp. Example: 2026-12-31.

Responses

StatusMeaningSchema
200Matching items, with paging totals.HackerNewsSearch
400Invalid input. Nothing was charged.Error
401Missing or invalid API key.Error
402Not enough credits, a spend cap was reached, or payment is required.Error
403The target is private, or the account is suspended.Error
404The item or user does not exist.Error
429Too many requests. Wait for Retry-After seconds.Error
503Hacker News is temporarily unavailable. Retryable; nothing was charged.Error

HackerNewsSearch fields

FieldTypeDescription
hitsHackerNewsSearchHit[]
nbHitsinteger
pageinteger
nbPagesinteger
hitsPerPageinteger
querystring

Errors use one shape everywhere; see Errors for every code and what to do.