Skip to content
scrapeatlas.Dashboard

Get a Hacker News story

Try in Playground

Retrieve one Hacker News item by numeric ID: title, submitted URL, author, points, self-post text, poll options and creation time, with the IDs of its direct child comments. Set includeCounts to add the live score and total comment count from the official API. The item type is returned; comment IDs are accepted and return that comment. Use the comments endpoint for the nested discussion.

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

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

Query parameters
2
idstringrequiredquery

Required numeric Hacker News item ID, as shown after item?id= on news.ycombinator.com.

Example8863
includeCountsenumquery

true adds score and descendants from the official item resource in a second source read. Defaults to false.

one of: true, false

Exampletrue
Response fields
28
idinteger

Required numeric Hacker News item ID, as shown after item?id= on news.ycombinator.com.

≥ 1

created_atstring

Source creation timestamp.

created_at_iinteger

Source creation Unix time in seconds.

typestring

Source item type: story, comment, poll, pollopt or job.

min 1 chars

authorstringnullable

Submitting username, or null when the source withholds it.

titlestringnullable

Story title; null for comments.

urlstringnullable

Submitted external link; null for self posts and comments.

textstringnullable

Self-post or comment HTML text; null when absent.

pointsintegernullable

Search-index score; null for comments. It can lag the live score.

parent_idintegernullable

Parent item ID; null for top-level stories.

story_idintegernullable

ID of the containing story.

optionsJSON[]

Poll option items when the source provides them.

up to 100 items

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.

scoreintegernullableoptional

Live score from the official API; null when it does not serve the item. Present only with includeCounts.

descendantsintegernullableoptional

Total comment count from the official API, including replies at every depth; null when it does not serve the item. Present only with includeCounts.

childreninteger[]

Direct child comment IDs in source order, at most 5,000.

up to 5000 items

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.