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.

Hacker News
GET/v1/hacker-news/search?query=dishwasher&type=story
curl "https://api.perceptlayer.com/v1/hacker-news/search?query=dishwasher&type=story" \
  -H "X-API-Key: $API_KEY"
cURL1 credit per successful call
Run this call below or from your dashboard to see a live response.

Playground

Run this API

cURLshell
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.

Note
Endpoints marked “Needs terms” return personal or social data. They work once you accept the restricted-endpoint terms in your dashboard.
EndpointRequired parametersReturnsCost
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: search takes a query, with type (story or comment), sort (relevance or date), page, per_page, date_from and date_to.
  • Lists: stories takes type (top, new, best, ask, show or jobs), with page and per_page.
  • Items: item takes an id, with comments.
  • Users: user takes an id, with submissions.

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.

Social mediaJSONRESTMCPSome endpoints need terms

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 comments

Follow the front page or Show HN lists

Use the Hacker News API to follow the front page or Show HN lists

Read the discussion under a launch

Use the Hacker News API to read the discussion under a launch

Collect job posts for hiring research

Use the Hacker News API to collect job posts for hiring research

FAQ

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.