Social Dash Scraper
Documentation v0.1OpenAPI

Developer communities API

Hacker News

Live private service · production acceptance passed

Search Hacker News stories and comments, retrieve a story, read its full comment tree, and look up user profiles.

Four authenticated endpoints read Hacker News through its public Algolia search index and the official Firebase API. Responses preserve source field names and nulls, return whole comment trees within explicit bounds, and report coverage on every request.

Base URLhttp://localhost:3015

Local development example. Replace with your service origin.

Search Hacker News

GET/v1/hackernews/search

Search the public Hacker News index by relevance. Results default to stories; use tags to select comments, polls, Show HN, Ask HN, front-page items or one author, and numericFilters to bound created_at_i, points or num_comments. Each request returns one page of at most 100 hits with source paging metadata. The source exposes at most 1,000 hits per query.

Query parameters

FieldTypeDescription
querystringRequired free-text search term, 1–500 characters.
tagsstringComma-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.
numericFiltersstringComma-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.
hitsPerPagestringHits per page, 1–100; defaults to 30. The response echoes the page size applied by the source.
pagestringZero-based page number, 0–999; defaults to 0. The response echoes the page returned by the source.

Response fields

FieldTypeDescription
requestIdstringRequest correlation identifier.
accountingobjectHTTP attempts, decoded bytes and duration for the operation, including the single shared retry.
successbooleanTrue when usable data is returned; inspect status and coverage for omissions.
statusstringsuccess, partial, failed, or challenged. HTTP 200 can be partial.
sourceUrlstringPublic Hacker News search, item or user URL for the request.
fetchedAtstringUTC retrieval time.
coverageobjectComplete means this bounded page or tree was returned without known omissions. It does not imply all matching items were enumerated.
hitsarrayOrdered 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 and _tags. Absent source fields stay absent; source nulls are preserved. Highlight markup and child ID lists are not returned.
nbHitsintegerSource total match count; approximate when exhaustiveNbHits is false.
pageintegerZero-based page number, 0–999; defaults to 0. The response echoes the page returned by the source.
nbPagesintegerSource page count for the requested page size.
hitsPerPageintegerHits per page, 1–100; defaults to 30. The response echoes the page size applied by the source.
exhaustiveNbHitsbooleanWhether nbHits is exact.

Nested fields and every response variant are in the OpenAPI specification.

Get a Hacker News story

GET/v1/hackernews/story

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. The item type is returned; comment IDs are accepted and return that comment. Use the comments endpoint for the nested discussion.

Query parameters

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

Response fields

FieldTypeDescription
idintegerRequired numeric Hacker News item ID, as shown after item?id= on news.ycombinator.com.
created_atstringSource creation timestamp.
created_at_iintegerSource creation Unix time in seconds.
typestringSource item type: story, comment, poll, pollopt or job.
authorstring | nullSubmitting username, or null when the source withholds it.
titlestring | nullStory title; null for comments.
urlstring | nullSubmitted external link; null for self posts and comments.
textstring | nullSelf-post or comment HTML text; null when absent.
pointsinteger | nullSource score; null for comments.
parent_idinteger | nullParent item ID; null for top-level stories.
story_idinteger | nullID of the containing story.
optionsarrayPoll option items when the source provides them.
requestIdstringRequest correlation identifier.
accountingobjectHTTP attempts, decoded bytes and duration for the operation, including the single shared retry.
successbooleanTrue when usable data is returned; inspect status and coverage for omissions.
statusstringsuccess, partial, failed, or challenged. HTTP 200 can be partial.
sourceUrlstringPublic Hacker News search, item or user URL for the request.
fetchedAtstringUTC retrieval time.
coverageobjectComplete means this bounded page or tree was returned without known omissions. It does not imply all matching items were enumerated.
childrenarrayDirect child comment IDs in source order, at most 5,000.

Nested fields and every response variant are in the OpenAPI specification.

Get a Hacker News story’s comments

GET/v1/hackernews/story/comments

Retrieve the complete nested comment tree of a Hacker News item in one request. Each comment keeps its source fields and its own children. The source serves the whole thread at once, so there is no cursor; at most 5,000 comment nodes are returned, and larger threads are truncated with explicit partial coverage. Deleted comments appear with null author and text.

Query parameters

FieldTypeDescription
idstringRequired numeric Hacker News item ID; a comment ID returns that comment’s subtree.

Response fields

FieldTypeDescription
requestIdstringRequest correlation identifier.
accountingobjectHTTP attempts, decoded bytes and duration for the operation, including the single shared retry.
successbooleanTrue when usable data is returned; inspect status and coverage for omissions.
statusstringsuccess, partial, failed, or challenged. HTTP 200 can be partial.
sourceUrlstringPublic Hacker News search, item or user URL for the request.
fetchedAtstringUTC retrieval time.
coverageobjectComplete means this bounded page or tree was returned without known omissions. It does not imply all matching items were enumerated.
idintegerRequired numeric Hacker News item ID; a comment ID returns that comment’s subtree.
typestringSource type of the requested item.
commentCountintegerNumber of comment nodes returned across all levels.
commentsarrayNested source comment nodes: id, author, text, created_at, created_at_i, parent_id, story_id, points, type and children, recursively, in source order.

Nested fields and every response variant are in the OpenAPI specification.

Get a Hacker News profile

GET/v1/hackernews/profile

Retrieve a public Hacker News user from the official API by case-sensitive username: karma, account creation time, the about text when present, and the count of submitted items. Hacker News has no follower, following or verification concepts, so none are invented.

Query parameters

FieldTypeDescription
handlestringRequired case-sensitive Hacker News username: 2–15 letters, digits, underscores or hyphens, as shown after user?id= on news.ycombinator.com.

Response fields

FieldTypeDescription
requestIdstringRequest correlation identifier.
accountingobjectHTTP attempts, decoded bytes and duration for the operation, including the single shared retry.
successbooleanTrue when usable data is returned; inspect status and coverage for omissions.
statusstringsuccess, partial, failed, or challenged. HTTP 200 can be partial.
sourceUrlstringPublic Hacker News search, item or user URL for the request.
fetchedAtstringUTC retrieval time.
coverageobjectComplete means this bounded page or tree was returned without known omissions. It does not imply all matching items were enumerated.
idstringSource username.
createdintegerAccount creation Unix time in seconds.
karmaintegerCurrent source karma.
aboutstringProfile about text in source HTML; omitted when the user has none.
submittedCountintegerNumber of item IDs in the source submitted list. The IDs themselves are not returned.

Nested fields and every response variant are in the OpenAPI specification.

Coverage & limits

  • Independent, stateless worker: four concurrent operations; 20-second total deadline; at most two upstream HTTP attempts per operation with one transient retry. No automatic retry for challenges or HTTP 429.
  • Fixed public HTTPS origins only: hn.algolia.com for search and items, hacker-news.firebaseio.com for users. No login, cookies, browser, proxy, outbound link visits, media downloads or result storage. The service API key is never forwarded.
  • At most 8 MiB decoded JSON, depth 128 and 400,000 nodes per source response. Oversize or malformed responses fail explicitly.
  • Search: one source page of 1–100 hits, default 30, pages 0–999; the source caps every query at 1,000 hits. Tags default to story. Relevance ordering is the source’s. Highlight markup and hit child ID lists are not returned.
  • Story and comments: one source thread read each. Comment trees return up to 5,000 nodes, then comment_limit partial coverage; story child ID lists truncate at 5,000 with children_limit. A story’s num_comments in search can exceed the returned tree because the source counts removed comments.
  • Profiles: the official API’s id, created, karma and about are preserved; the unbounded submitted list is replaced by submittedCount. Usernames are case-sensitive; a different case is a missing user.
  • Source caching and live counters can affect freshness. Sampled search, story, comment-tree and profile reads returned real data during local and production acceptance. No credit balances, billing or caching controls are provided.

Errors & partial results

HTTPCode / statusMeaning
200partialUsable data with comment_limit or children_limit warnings.
400invalid_requestMissing, duplicate, malformed or unsupported parameters.
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.