Stories
/api/hackernews/stories
A page of stories from the top, new, best, ask, show or jobs list
Scrappa's Hacker News API returns public Hacker News data as structured JSON. Read the top, new, best, ask, show and job story lists with pagination, open any item for its full nested comment tree, read user profiles with their submissions, and run full-text search over stories and comments with date range and sort controls. Scrappa is an independent service and is not affiliated with or endorsed by Hacker News or Y Combinator.
Try it now
Use the first endpoint in this API family with a Scrappa API key. Every account includes 500 free monthly credits, so you can validate the response shape before buying credits.
curl -X GET "https://scrappa.co/api/hackernews/stories?type=top&page=1&per_page=20" \
-H "Accept: application/json" \
-H "X-API-KEY: YOUR_API_KEY"
{
"search_parameters": {
"engine": "hackernews_stories",
"type": "top",
"page": 1,
"per_page": 20
},
"stories": [
"id": 50068437,
"title": "DishwasherBench – Can Frontier Models Stack a Dishwasher?",
"url": "https://github.com.composo-ai/DishwasherBench",
"score": 62,
"by": "mlukewizard",
"time": 1791879846,
"descendants": 30,
"kids": [50068920, 50068438, 50070342, 50069632, 50069250],
"type": "story",
"text": null,
"text_plain": null,
"parent": null,
"deleted": null,
"dead": null
}
],
"page": 1,
"per_page": 20,
"total": 500,
"has_more": true
}
Structured data for real applications. Here are some ideas.
Poll the top and new story lists to track launches, outages and discussions as they happen, with scores and comment counts already parsed.
Open any story for its full nested comment tree to analyse community reaction, recurring themes and voter sentiment.
Search stories and comments by keyword with date range and relevance or date sort to find tools, trends and first-hand writeups.
Read a user profile with karma, about text and submitted item ids to follow builders and recurring contributors.
Watch the ask, show and jobs lists for questions, project launches and hiring posts in your own pipeline.
Hacker News API alternative
The Hacker News API is built for news monitors, research tools and community analytics that need story lists, comment threads, user profiles and search in their own apps. Every endpoint reads public Hacker News data through the official APIs, so there is no HTML parsing and no fragile scraping logic to maintain. One call returns a page of stories, a full comment thread, a user profile or a search result page, and every response echoes your input in search_parameters.
Read a page of stories with /api/hackernews/stories across the top, new, best, ask, show and jobs lists.
Open any item with /api/hackernews/item for the full nested comment tree, each comment with a plain-text variant.
Search stories and comments with /api/hackernews/search: relevance or date sort, unix timestamp date bounds.
Read a user profile with /api/hackernews/user for karma, about text and submitted item ids.
Pass page and per_page explicitly. Pages are never fetched for you, so each page is one billable request.
Test the Hacker News API with 500 free monthly credits before scaling production traffic.
Call /api/hackernews/stories?type=top for the current front page, then type=new for the live feed. Each story carries score, author, time, descendant count and kid ids already parsed.
Open Hacker News Stories API docsPass an item id to /api/hackernews/item to get the story plus its full nested comment tree. Comments carry author, HTML text, a plain-text variant, creation time and parent id.
Open Hacker News Item API docsSearch stories and comments with /api/hackernews/search, sort by relevance or date, and narrow with unix timestamp date bounds. has_more comes from the upstream page count.
Open Hacker News Search API docsEverything you need in one API.
/api/hackernews/stories
A page of stories from the top, new, best, ask, show or jobs list
/api/hackernews/item
One item with its full nested comment tree
/api/hackernews/user
A public user profile with karma and submissions
/api/hackernews/search
Full-text search over stories and comments with date range and sort
Add community discussions and thread data alongside Hacker News stories and comments.
Read public posts and engagement when a Hacker News thread spills over into social discussion.
Fetch an arbitrary public URL as text, HTML or Markdown when a story links somewhere the structured endpoints do not cover.
See how Scrappa compares to the official API.
| Feature | Scrappa | HN Firebase / Algolia APIs (direct) |
|---|---|---|
| Nested comment trees in one response | Walk the kids tree yourself | |
| Stable field names with typed integers | Raw upstream shapes | |
| Failed requests are never charged | You manage quota and retries | |
| Price per 1k requests | From $0.20 | Free, but you build the wrapper |
No. Every endpoint reads public data through the official Firebase and Algolia APIs. There is no login, cookie or credential of any kind.
Firebase answers an unknown id with HTTP 200 and a null payload. This API maps that to a 404 with the hackernews_not_found error code so an unknown resource is never mistaken for an empty list.
Pages are 1-based and explicit. The stories endpoint slices the upstream id list and reports has_more from the remaining ids. The search endpoint converts to Algolia's 0-based page and reports has_more from the upstream page count. Pages are never fetched for you.
Failed requests are never charged, and the API never answers with HTTP 429. An upstream outage returns a retryable 503 that costs you nothing, and a shape change returns a non-retryable 500.
No. Scrappa is an independent service and is not affiliated with or endorsed by Hacker News or Y Combinator. The data returned is public Hacker News data, shaped as JSON for your own applications.