API · Hacker News
GET /hackernews/items/{id}
One Hacker News item: story, comment, job or poll.
| Request | GET /v1/hackernews/items/{id} |
| Operation id | hackernews.story.get |
| Cost | 1 credit, refunded if the call fails |
| Auth | API key: Authorization: Bearer <key> or x-api-key. |
One Hacker News item: story, comment, job or poll.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | An item id or its link (news.ycombinator.com/item?id=…). Example: 8863. |
Responses
| Status | Meaning | Schema |
|---|---|---|
200 | The item. | HackerNewsItem |
400 | Invalid input. Nothing was charged. | Error |
401 | Missing or invalid API key. | Error |
402 | Not enough credits, a spend cap was reached, or payment is required. | Error |
403 | The target is private, or the account is suspended. | Error |
404 | The item or user does not exist. | Error |
429 | Too many requests. Wait for Retry-After seconds. | Error |
503 | Hacker News is temporarily unavailable. Retryable; nothing was charged. | Error |
HackerNewsItem fields
| Field | Type | Description |
|---|---|---|
id | integer | |
type | "story" | "comment" | "job" | "poll" | "pollopt" | |
by | string | Author username. |
time | integer | Unix seconds. |
title | string | |
url | string | |
text | string | HTML. |
score | integer | |
descendants | integer | Total comment count. |
kids | integer[] | Direct reply ids, ranked. |
parent | integer | |
poll | integer | |
parts | integer[] | |
deleted | boolean | |
dead | boolean |
Errors use one shape everywhere; see Errors for every code and what to do.