APIs / Social media / Hacker News
1 credit per call4 endpointsChecked working 6 Dec 2026
Hacker News API
Hacker News API for story and comment search, top, new, best, Ask, Show and job lists, and items with comments as JSON. 1 credit per call.
curl "https://api.perceptlayer.com/v1/hacker-news/search?query=dishwasher&type=story" \
-H "X-API-Key: $API_KEY"Playground
Run this API
curl "https://api.perceptlayer.com/v1/hacker-news/search?query=dishwasher&type=story" \
-H "X-API-Key: $API_KEY"Hacker News · 4 endpoints
Endpoints
Every endpoint takes the same key. Open one for its parameters, the fields it returns and an example request.
| Endpoint | Required parameters | Returns | Cost |
|---|---|---|---|
GET/v1/hacker-news/item | id+1 optionalNeeds terms | idtitleurlscorebycreated_at+4 more | 1 credit |
GET/v1/hacker-news/search | query+6 optionalNeeds terms | resultsnb_hitsnb_pages | 1 credit |
GET/v1/hacker-news/stories | none+3 optionalNeeds terms | idtitleurlscorebycreated_at+3 more | 1 credit |
GET/v1/hacker-news/user | id+1 optionalNeeds terms | idcreated_atkarmasubmitted | 1 credit |
Overview
About the Hacker News API
What you can get
The Hacker News API returns public Hacker News data as JSON through 4 endpoints. All of them are restricted endpoints: the restricted-endpoint terms apply, and they don't permit collecting personal data without a lawful basis or using it to contact people.
- Search:
searchtakes aquery, withtype(story or comment),sort(relevance or date),page,per_page,date_fromanddate_to. - Lists:
storiestakestype(top, new, best, ask, show or jobs), withpageandper_page. - Items:
itemtakes anid, withcomments. - Users:
usertakes anid, withsubmissions.
How a call works
Search stories: GET /v1/hacker-news/search?query=dishwasher&type=story with your key in the X-API-Key header, or read the front page with GET /v1/hacker-news/stories?type=top. Every successful call costs 1 credit; failed calls cost nothing.
More social media APIs
Use cases
Track mentions of your product or a topic in stories and comments
Use the Hacker News API to track mentions of your product or a topic in stories and commentsFollow the front page or Show HN lists
Use the Hacker News API to follow the front page or Show HN listsRead the discussion under a launch
Use the Hacker News API to read the discussion under a launchCollect job posts for hiring research
Use the Hacker News API to collect job posts for hiring researchFAQ
Questions
Do I need a Hacker News account?
No. You call this Hacker News API with your Perceptlayer key in the `X-API-Key` header, with no Hacker News login. You do need to accept the restricted-endpoint terms first.
How much does the Hacker News API cost?
Each successful call costs one credit. New accounts get free credits to start, and credit packs bring the price down as you scale.
What format are responses in?
Every endpoint returns JSON, with no HTML parsing on your side.
Is this the official Hacker News API?
No. Perceptlayer is an independent service and is not affiliated with Hacker News. It returns Hacker News data as JSON with a Perceptlayer key, so there is no Hacker News developer account, app review or partner approval to get first. It only reads data: if Hacker News has an official API and you need to act on your own Hacker News account, such as posting, managing orders or reading private data, use that one.
Should I build a Hacker News scraper instead?
You can, but a Hacker News scraper is code you maintain: page changes break it, requests get blocked, and Hacker News's terms govern how you collect data. The Hacker News API gives you 4 endpoints of named JSON fields for 1 credit per successful call, and failed calls cost nothing. A scraper makes sense only for data these endpoints don't return, so check the response in the playground on this page first. Some of these endpoints return social or personal data and need the restricted-endpoint terms; collect only what you have a lawful basis for.
Try the Hacker News API with 100 free credits
No credit card. Failed calls are never billed.