100 free credits — no credit card required.Start building
Logo
Hacker News logoHacker News API

Scrape Hacker News data with one API

Fetch public Hacker News search hits, stories, comment trees, and profiles as structured JSON with one SocialCrawl API key. Same Post, Comment, and Author schema as every other platform. Reads are priced in credits.

Hacker News logo
/v1/hackernews

4 active endpoints

  • GET /v1/hackernews/search
  • GET /v1/hackernews/story
  • GET /v1/hackernews/story/comments
  • GET /v1/hackernews/profile

What Hacker News endpoints does SocialCrawl ship?

Four live read endpoints for public Hacker News data. Keyword search, single stories, nested comment trees, and user profiles. Data API only. No voting, no submission, no private accounts.

Search

1 credit
/v1/hackernews/search

Stories matching a query: title, link, author, points, comment count, and post time. Optional tags can widen results to comments and other item types.

query, tags, numericFilters, hitsPerPage, page

Story

1 credit
/v1/hackernews/story

One story by id: title, link, author, points, comment count, and publish time. Discussion comes from story/comments.

id

/v1/hackernews/story/comments

Comment tree for one story: id, author, text, points, time posted, and nested replies.

id

Profile

1 credit
/v1/hackernews/profile

Public user profile: id, username, bio, karma, and account creation date. Follower and post counts are empty because HN does not expose them.

handle

Hacker News API4 endpoints supported
View docs

Returns Hacker News stories matching a query, each with title, link, author, points, comment count, and post time. Tags can widen it to comments.

Use it to find discussions by keyword, then pass a story id to the story endpoint for its details or its comments.

GET/v1/hackernews/search?query=claude+code

query · Free-text search term.

$ curl https://www.socialcrawl.dev/v1/hackernews/search?query=claude+code \
    -H "x-api-key: sc_YOUR_API_KEY"
— · idle
// Running this live needs your own API key — hit "Try it" to see an example response

How the Hacker News API works

Hacker News is a normal SocialCrawl social surface. You call GET /v1/hackernews/… with an API key, spend credits on live misses, and get a single JSON envelope back. No HN account. No second SDK.

Authenticate every call

Send your key in the x-api-key header. No Hacker News credentials. The same key works across the SocialCrawl catalog.

GET with query params

All Hacker News routes are GET. Pass query, id, tags, page, and filters as query strings. We validate formats before charging.

Pay in credits, not seats

Every Hacker News read costs 1 credit on a live miss. Cache hits cost 0. Empty or hard failures refund.

Read one JSON envelope

Every response is the same shape: success, data, credits_used, credits_remaining, request_id, cached. Search pages carry pagination fields when more hits remain.

The usual integration chain

Most products search first, open a story, then expand comments only when the thread matters.

01Search
GET /v1/hackernews/search?query=…&tags=story

PostList of matching stories with points and comment counts

Find discussions by keyword before you know story ids.

02Story
GET /v1/hackernews/story?id=…

Full Post for one story id

Search titles are not enough when you need the story record.

03Comments
GET /v1/hackernews/story/comments?id=…

CommentList with nested replies[]

Expand the thread only when the discussion is the product job.

04Profile
GET /v1/hackernews/profile?handle=…

Author-shaped user: karma, bio, created date

Resolve who posted once you care about the author.

request
GET /v1/hackernews/search
  ?query=launch+api
  &tags=story
Host: www.socialcrawl.dev
x-api-key: sc_your_api_key_here

# deepen a story
GET /v1/hackernews/story?id=8863
GET /v1/hackernews/story/comments?id=8863
response envelope
{
  "success": true,
  "data": {
    "items": [
      {
        "post": {
          "id": "8863",
          "url": "https://news.ycombinator.com/item?id=8863",
          "content": { "text": "Example title" },
          "engagement": { "likes": 1200, "comments": 318 },
          "ext": {
            "points": 1200,
            "author": "pg"
          }
        }
      }
    ]
  },
  "credits_used": 1,
  "credits_remaining": 9999,
  "request_id": "req_…",
  "cached": false
}

What lands in data

Field names match the rest of SocialCrawl where archetypes align. Stories and comments use the same leaves as other platforms.

Authorprofile

id, username, bio, url, ext (karma, created_at); followers and post counts empty on HN

PostList / Postsearch, story

items[].post with id, url, content.text (title), engagement (points, comments), author, published_at, ext

CommentListstory/comments

items[] with author, content.text, engagement, published_at, replies[] for nested discussion

Search hitsenvelope fields

raw Algolia-style hits in list form: objectID, title, url, author, points, num_comments, tags

Inside the gateway

Same request lifecycle as every other /v1 platform endpoint. Hacker News is not a sidecar.

  1. 01

    Edge receives the call

    Next.js catch-all routes into the Hono social API. We mint a request_id, authenticate the key, then enforce rate limit (600/min) and concurrency (50 in flight per key).

  2. 02

    Validate, then debit

    Registry lookup finds hackernews/search (or story, comments, profile). Required params run first. Invalid input returns 400 with no charge. Valid calls debit 1 credit atomically before upstream work.

  3. 03

    Cache or fetch

    A deterministic cache key is built from platform + resource + params. Hit: return immediately, credits_used = 0. Miss: HN Algolia public API via the Hacker News fetcher. Retries on 5xx/network with a circuit breaker if the source is unhealthy.

  4. 04

    Normalize and return

    Upstream JSON is mapped to Author / Post / PostList / CommentList where field maps apply, validated against the canonical Zod schema, then wrapped in the success envelope and logged for billing audit.

Billing rules that matter in production

  • Standard live miss: 1 credit
  • Search, story, comments, profile: all 1 credit
  • No advanced tier on this platform
  • No premium tier on this platform
  • Cache hit: 0 credits
  • Empty / hard fail: auto-refund
  • Bad params: 400, never charged
  • No credits: 402, never charged
  • Disabled routes: 503, never charged

How we get the data

Hacker News is public-read discussion data. We normalize it into the SocialCrawl schema so your code does not learn Algolia-only hit shapes.

What Hacker News is for this API

Public stories, comments, and user profiles. Read-only surface for research, monitoring, and product jobs. No voting and no submission.

How SocialCrawl reaches it

Public HN Algolia API (hn.algolia.com) behind the SocialCrawl gateway. The platform fetcher composes search and item URLs from query params and ids.

What leaves our edge

A unified JSON envelope: success, data, credits_used, request_id, cached. Stories become Post objects. Comments share CommentList leaves with nested replies.

What we do not ship live

No write endpoints. No private messages. No follower graph (HN does not expose one). Prefer the registry docs for the live inventory.

field map sketch
HN userauthor.*title, url, author, points, comment count
story title + url + textpost.content.text + ext.*comment text, author, points, nested replies
nested comment treeCommentList + replies[]username, bio, karma, account created_at

What this API is used for

The jobs this API is most often used for.

4active Hacker News endpoints in the registry
1 creditflat 1 credit per live miss

Tech discussion search and thread monitoring

Callers concentrate on keyword search, story detail, and story to comments chains. Profiles show up when author context matters. HN search, story, nested comments, and profiles on the shared schema with credit pricing. No HN account and no second client library.

Search and story calls are typically a few seconds on live miss. Large comment trees can take longer than single-story reads.

Use case examples

Common ways teams put this data to work, and the stack each one tends to run.

Tech monitors

Python, cron, Slack bots

Poll search for fixed keywords. Open story plus comments when points or comment velocity jumps.

Research notebooks

Node, notebooks, BI loads

Keyword search across HN, then expand story body and comment trees for product, brand, and competitor language.

Backend product jobs

Go, workers, Explorer

Wire search to story to comments into pipelines. Cache hits keep recurring runs cheap. Same key as the rest of SocialCrawl.

Call it in two lines

Every Hacker News route is one credit per live call. Cache hits are free.

curl "https://www.socialcrawl.dev/v1/hackernews/search?query=launch+api&tags=story" \
  -H "x-api-key: sc_your_api_key_here"
curl "https://www.socialcrawl.dev/v1/hackernews/story/comments?id=8863" \
  -H "x-api-key: sc_your_api_key_here"
Hacker News logoHacker News on SocialCrawl

Same key as the rest of the catalog

Endpoints

What data does the Hacker News API return?

Every endpoint returns structured JSON in a unified envelope. Computed fields such as engagement rate and content category are included only where the endpoint supports them and the required source inputs are present.

Comparison

How does SocialCrawl compare to Official HN Firebase API + Algolia for Hacker News data?

Same Hacker News data, two very different paths. Auth, rate limits, schema, and cost — side by side.

Authentication

SocialCrawl
One x-api-key shared across 48 platforms
Official HN Firebase API + Algolia
No key needed, but two separate APIs to learn

Setup

SocialCrawl
One GET request in the same envelope as your other sources
Official HN Firebase API + Algolia
Firebase for items, Algolia for search: two clients, two response shapes

Rate limits

SocialCrawl
Handled upstream as part of the service
Official HN Firebase API + Algolia
Generous but unspecified; you build your own backoff

Response schema

SocialCrawl
Unified data.items shape shared with Reddit, GitHub, and X
Official HN Firebase API + Algolia
Firebase returns raw items one ID at a time; Algolia uses its own hit format

Pricing

SocialCrawl
1 credit per call; 100 free credits, no card
Official HN Firebase API + Algolia
Free

Data coverage

SocialCrawl
Search, story, full threaded comment tree, and profile in four calls
Official HN Firebase API + Algolia
Full item coverage, but comment trees mean one request per comment ID
FAQ

Have a question? We got answers

Find answers to frequently asked questions about SocialCrawl's API, pricing, and capabilities.

Contact us
What is the Hacker News API on SocialCrawl?
SocialCrawl wraps the Algolia-powered Hacker News Search API behind 4 endpoints (search, story, story comments, and profile) under one x-api-key. You call HN alongside Reddit, GitHub, X, and 47 other sources with one schema, no separate Algolia endpoint wrangling.
What Hacker News endpoints does SocialCrawl offer?
4 endpoints: Search, Story, Story Comments, and Profile.
Is the Hacker News API free, and do I need an Algolia key?
Hacker News data is public and free at the source, so SocialCrawl is not selling locked data, and no, you do not need an Algolia account or key. The value is one key plus one unified schema across 48 sources, so HN fits the same pipeline as every other platform.
How much does the Hacker News API cost on SocialCrawl?
Every Hacker News endpoint costs 1 credit on the standard tier. New accounts get 100 free credits with no credit card required, which is enough to test all 4 endpoints and build a small ingestion run before you ever pay.
Why use the SocialCrawl Hacker News API?
It is built for developers running tech-trend monitoring, dev-sentiment tracking, and Show HN or launch tracking who already pull Reddit, GitHub, or X through SocialCrawl. One key and one schema keep HN in the same pipeline instead of a separate Algolia integration.
What does each Hacker News response include?
Stories return title, URL, points, author, comment count, and item ID. Comments return body, author, parent, and the threaded reply tree. Profiles return karma, created date, and about text. All four normalize into the SocialCrawl data.items schema.
What is the best Hacker News scraper API?
For most pipelines, SocialCrawl is the practical pick: 4 endpoints covering search, stories, full comment trees, and profiles at 1 credit per call, with 100 free credits to start. The official Firebase API is free but item-by-item, so a 300-comment thread takes 300 requests. SocialCrawl returns the whole tree in one.
Is there a Hacker News data API?
Yes, and it is free at the source: Hacker News runs an official Firebase API and Algolia powers HN search, both without a key. SocialCrawl does not gate that data; it wraps both into 4 endpoints under one x-api-key so search, stories, full comment trees, and profiles land in the same schema as Reddit, GitHub, and X, with a 300-comment thread returned in one call instead of hundreds.
Is scraping Hacker News data legal?
SocialCrawl returns publicly available Hacker News data and does not access private or login-gated content. Whether scraping fits your project depends on your use case and jurisdiction — you are responsible for complying with Hacker News's terms of service and applicable data-protection laws such as GDPR and CCPA. This is general information, not legal advice.
Hacker News scraping API vs the official Hacker News API — what's the difference?
With SocialCrawl there is no app review or approval queue — sign up and call Hacker News endpoints immediately with a single x-api-key. Responses share one unified schema with every other SocialCrawl platform, and credit-based pricing replaces per-platform quotas. Official APIs are still the right choice for posting and other write actions: SocialCrawl is read-only data.

Ask AI about SocialCrawl

Read the Hacker News API reference in the docs

🤖 AI agent or LLM? Read this page as markdown