Hacker News search API
Full-text search over Hacker News stories (or comments, polls, Show HN, Ask HN) by relevance or date, with numeric filters on points, comments and time, as Hacker News’s own search hits.
GET /v1/hackernews/search1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/hackernews/search?q=sqlite&sort=date&hitsPerPage=50",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "hits": [ { "objectID": "50657159", "_tags": [ "story", "author_HarsH_1849", "… 2 more" ], "author": "HarsH_1849", "created_at": "2026-11-26T16:59:24Z", "created_at_i": 1795712364, "title": "Show HN: Dev-Mem – Local-first SQLite knowledge graph for AI coding agents", "url": "https://github.com/HarsH-1877/Dev-Mem", "points": 1, "num_comments": 0, "story_id": 50657159, "updated_at": "2026-11-26T17:01:50Z" }, { "objectID": "50657069", "_tags": [ "story", "author_HarsH_1877", "… 2 more" ], "author": "HarsH_1877", "created_at": "2026-11-26T16:51:34Z", "created_at_i": 1795711894, "title": "Show HN: Dev-Mem – Local-first SQLite knowledge graph for AI coding agents", "url": "https://github.com/HarsH-1877/Dev-Mem", "points": 7, "num_comments": 0, "story_id": 50657069, "updated_at": "2026-11-26T22:51:59Z" }, "… 48 more" ], "nbHits": 4671, "page": 0, "nbPages": 20, "hitsPerPage": 50, "query": "sqlite", "exhaustive": { "nbHits": false, "typo": false }, "exhaustiveNbHits": false, "exhaustiveTypo": false, "params": "query=sqlite&tags=story&hitsPerPage=50&page=0&advancedSyntax=true&analyticsTags=backend", "processingTimeMS": 23, "processingTimingsMS": { "_request": { "queue": 1, "roundTrip": 15 }, "afterFetch": { "format": { "highlighting": 2, "total": 3 } }, "fetch": { "query": 8, "scanning": 12, "total": 21 }, "total": 23 }, "serverTimeMS": 28}Parameters
| Name | Type | Description |
|---|---|---|
qquery · required | string | Search terms. Example: rust. |
tagsquery | string | Algolia tags. Defaults to story. |
numericFiltersquery | string | e.g. points>100,created_at_i>1700000000 |
sortquery | "relevance" | "date" | relevance (default) or date. One of relevance, date. |
hitsPerPagequery | integer | Hits per page, 1 to 1000. Defaults to 30. |
pagequery | integer | null | Page number, 0 to 999 (0 is the first page). Defaults to 0. |
sincequery | string | Only rows published on or after this date: YYYY-MM-DD (midnight UTC) or an ISO 8601 timestamp. Example: 2026-01-01. |
untilquery | string | Only rows published on or before this date: YYYY-MM-DD (that whole UTC day) or an ISO 8601 timestamp. Example: 2026-12-31. |
Response fields
200 with a HackerNewsSearch, in Hacker News’s own items and search hits.
| Field | Type | Description |
|---|---|---|
hits | HackerNewsSearchHit[] | |
nbHits | integer | |
page | integer | |
nbPages | integer | |
hitsPerPage | integer | |
query | string |
Status codes
| Status | Meaning |
|---|---|
200 | Matching items, with paging totals. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | The item or user does not exist. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | Hacker News is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
Questions
How far back does it go?
To the first story in 2006. Pages are 0-based, up to 1,000 hits each.
Hacker News is a trademark of Y Combinator. We are not affiliated with or endorsed by Y Combinator.