HackerNews API
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.
Available Data
Example Response
{
"totalArticles": 100,
"articles": [
{
"title": "Tech Industry Sees Record Growth",
"source": {
"name": "TechNews",
"url": "https://technews.com"
},
"publishedAt": "2025-01-15T08:00:00Z",
"description": "The technology sector reported unprecedented growth...",
"image": "https://example.com/article-image.jpg",
"url": "https://technews.com/article/123"
}
]
} Field Reference
id The unique ID of the item on Hacker News title The headline of the story or Ask HN post url The external URL the story links to; absent for Ask HN posts score Current upvote count for the story by Username of the person who submitted the story descendants Total number of comments on the story Implementation Example
// ⚠️ Note: This URL may be a documentation page. Check official docs for actual API endpoint.
const url = "https://github.com/HackerNews/API";
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.
Common Errors & Troubleshooting
Matrix Score Breakdown
Fully tested on Apr 5, 2026
Technical Specifications
Related Tags
Similar APIs
View All →4chan
⭐ Beginner's PickThe 4chan API provides read-only, public access to boards, threads, and posts on 4chan with no authentication required.
aztro
aztro provides programmatic access to daily horoscope info for yesterday, today, and tomorrow via REST API.
Doge-Meme
Doge-Meme provides programmatic access to top meme posts from r/dogecoin which include 'meme' flair via REST API.
Fuck Off as a Service
⭐ Beginner's PickFuck Off as a Service (FOAAS) is a humorous REST API that returns creative dismissal messages in various formats.
Hashnode
⭐ Beginner's PickHashnode is a developer blogging platform whose public GraphQL API lets you query posts, publications, and author profiles without any authentication.