Skip to content
scrapeatlas.Dashboard

Search Hacker News

Try in Playground

Search Hacker News by relevance or by date. Use tags to select stories, comments, polls, Show HN, Ask HN, front-page items or an author; query is optional when tags or numericFilters select the results, so a tags-only request returns the current front page or one author’s items. Filter timestamps and counts with numericFilters, restrict matching to chosen attributes, disable typo tolerance for exact matching, and select a results page.

GET/v1/hackernews/searchx-api-key
x-api-keystringrequiredheader

Your ScrapeAtlas customer key. Create one on /account/ and set SCRAPEATLAS_API_KEY.

Query parameters
9
querystringquery

Free-text search term, 1–500 characters. Optional when tags or numericFilters is supplied. Quoted phrases and -exclusions are supported by the source index.

min 1 chars · max 500 chars

Exampleclaude code
tagsstringquery

Comma-separated source tags: story, comment, poll, pollopt, job, show_hn, ask_hn, launch_hn, front_page, author_<username> or story_<id>. Top-level commas are AND; a parenthesised group such as (story,comment) is OR. Defaults to story. At most 10 tags.

max 400 chars

Examplestory
numericFiltersstringquery

Comma-separated conditions on created_at_i, points or num_comments using <, <=, =, >= or > with an integer, for example created_at_i>1700000000,points>=100. At most 10 conditions. No filter by default.

max 400 chars

Examplecreated_at_i>1756684800
sortByenumquery

relevance (default) ranks by the source relevance score; date returns the newest matching items first.

one of: relevance, date

Exampledate
typoToleranceenumquery

false matches the query exactly; the source tolerates typos by default. Defaults to the source setting.

one of: true, false

restrictSearchableAttributesstringquery

Comma-separated attributes to match against: title, url, author, story_text or comment_text. At most 5. Defaults to all of them.

max 100 chars

includeChildrenenumquery

true adds the source children ID list to each hit, bounded at 5,000 IDs with children_limit partial coverage. Defaults to false.

one of: true, false

hitsPerPagestringquery

Hits per page, 1–100; defaults to 30. The response echoes the page size applied by the source.

Example30
pagestringquery

Zero-based page number, 0–999; defaults to 0. The response echoes the page returned by the source.

Example0
Response fields
36
requestIdstring

Request correlation identifier.

HTTP attempts, decoded bytes and duration for the operation, including the single shared retry.

accounting.upstreamRequestsinteger

Always included.

≥ 0

accounting.responseBytesinteger

Always included.

≥ 0

accounting.durationMsnumber

Always included.

≥ 0

successboolean

True when usable data is returned; inspect status and coverage for omissions.

statusenum

success, partial, failed, or challenged. HTTP 200 can be partial.

one of: success, partial

sourceUrlstring

Public Hacker News search, item or user URL for the request.

absolute HTTPS URL

fetchedAtstring

UTC retrieval time.

Complete means this bounded page or tree was returned without known omissions. It does not imply all matching items were enumerated.

coverage.sourcestring

Always included.

coverage.completeboolean

Always included.

coverage.warningsstring[]

Always included.

Ordered source hits: objectID, title, url, author, points, num_comments, story_id, story_title, story_url, story_text, comment_text, parent_id, created_at, created_at_i, updated_at, _tags and, with includeChildren, children. Absent source fields stay absent; source nulls are preserved.

up to 100 items

hits.objectIDstring

Always included.

hits.created_atstring

Always included.

hits.created_at_iinteger

Always included.

hits.updated_atstringoptional

Optional.

hits.authorstringnullableoptional

Optional.

hits.titlestringnullableoptional

Optional.

hits.urlstringnullableoptional

Optional.

hits.pointsintegernullableoptional

Optional.

hits.num_commentsintegernullableoptional

Optional.

hits.story_idintegernullableoptional

Optional.

hits.story_titlestringnullableoptional

Optional.

hits.story_urlstringnullableoptional

Optional.

hits.story_textstringnullableoptional

Optional.

hits.comment_textstringnullableoptional

Optional.

hits.parent_idintegernullableoptional

Optional.

hits.childreninteger[]optional

Optional.

up to 5000 items

hits._tagsstring[]

Always included.

up to 50 items

nbHitsinteger

Source total match count; approximate when exhaustiveNbHits is false.

≥ 0

pageinteger

Zero-based page number, 0–999; defaults to 0. The response echoes the page returned by the source.

≥ 0

nbPagesinteger

Source page count for the requested page size.

≥ 0

hitsPerPageinteger

Hits per page, 1–100; defaults to 30. The response echoes the page size applied by the source.

≥ 1

exhaustiveNbHitsboolean

Whether nbHits is exact.

HTTP 200 returns the success variant. Check status: partial means usable data with warnings, and failed or challenged requests carry a failure object described in Errors & responses.

Error codes
11
HTTPfailure.codeMeaning
200partialUsable data with comment_limit, depth_limit, children_limit or counts_unavailable warnings.
400invalid_requestMissing, duplicate, malformed or unsupported parameters, including a search that selects nothing.
401unauthorizedMissing or invalid worker API key.
404not_foundThe source reports a missing item or user.
429upstream_rate_limitedSource throttling; no automatic retry.
502upstream_challengedSource rejected the unauthenticated request.
502unsupported_pageMalformed, mismatched or non-JSON source data.
502response_too_large payload_too_complexResponse exceeded byte or parsing limits.
502unsafe_redirect request_limit upstream_errorBounded source retrieval could not complete.
503busyAll worker slots are occupied.
504timeoutTotal request deadline expired.