HackerNews API

Beginner's Pick Social / No Auth Required Beginner HTTPS
Free to Use
74 B
Measured Score 0 50 100 Speed 20/30 Consistency 20/20 Security 20/20 Browser access 10/15 Transparency 4/15 TESTED 2026-08-10

Overview

The Hacker News API gives you free, real-time access to the stories, comments, jobs, and polls from the popular tech news community. No authentication is required — you can start fetching top stories and their details with a simple GET request. It is an excellent beginner API for learning asynchronous data fetching since story items are retrieved individually by ID.

Beginner Tip

Start by fetching the topstories endpoint to get a list of up to 500 story IDs, then fetch individual items by ID. Keep in mind each story is a separate request, so use Promise.all() in JavaScript to fetch multiple items in parallel.

Measurement Record

What actually happened when we called this API from our own infrastructure. Every value below was recorded by the request, not copied from the provider's documentation.

Request
GET https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty
Result
HTTP 200 · application/json · 5,003 bytes
Response time
166 ms (median of 3) · fastest 161 ms
Transport
TLSv1.3 · TLS_AES_256_GCM_SHA384 · certificate issued by Google Trust Services
Browser CORS
Allowed — Access-Control-Allow-Origin: https://apisscore.com
Served by
nginx
Recorded
2026-08-10

Available Data

The kind of data this API exposes, based on its documentation. We could not call the endpoint to confirm the exact field names.

article title and content
publication source
published date
article URL
image URL
IP address information

Captured Response

Captured from a real request to https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty on 2026-08-10. Long arrays and nested objects are truncated to keep the shape readable.

JSON Response · Captured
[
  49241679
]

Implementation Example

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

How This API Fails

We deliberately sent this API a broken request and recorded exactly what came back on 2026-08-10. Knowing the shape of an error before you hit it makes error handling much easier to write.

HTTP 302 Requesting a path that does not exist text/html

Returned an HTML error page rather than JSON — worth knowing if your client assumes every response can be parsed as JSON.

Common Errors & Troubleshooting

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

Receiving only an array of numbers, not story data The top/new/beststories endpoints return only IDs, not full story objects
Take each ID from the array and make a separate GET request to /v0/item/{id}.json to retrieve the full story
null response for an item The item ID is valid but the item has been deleted or does not exist
Always null-check the response before accessing fields like item.title or item.url
Slow performance when fetching many stories Fetching stories sequentially one by one
Fetch multiple items in parallel using Promise.all() or equivalent concurrency patterns in your language

Measured Score Breakdown

Live HTTP request to the API endpoint

Speed 20/30
Consistency 20/20
Security 20/20
Browser access 10/15
Transparency 4/15
Endpoint Response Time 166ms

Fully tested on Aug 10, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS UNKNOWN
Category Social
Difficulty Beginner
Endpoint last called: 2026-08-10

Related Tags

Similar APIs

View All →