Hacker News
App · News · 3 actions
Read Hacker News: pull the Top, New, Best, Ask HN, Show HN, and Jobs story feeds, fetch any item or comment by id, and look up a user's profile.
Actions
| Action | What it does |
|---|---|
| Get item | Fetch a single Hacker News item (a story, comment, job, or poll) by its numeric id. |
| Get stories | Fetch a Hacker News story feed (Top, New, Best, Ask HN, Show HN, or Jobs) as full story records. |
| Get user | Fetch a Hacker News user's public profile by username: their karma, account age, about text, and submitted-item ids. |
Get item
Fetch a single Hacker News item (a story, comment, job, or poll) by its numeric id. A full news.ycombinator.com item URL is also accepted.
Inputs
- Item ID
item_idtextRequired - The numeric id of the item. Accepts a bare id or a full news.ycombinator.com/item?id=… URL.
Outputs
itemobject
Example output
{
"item": {
"by": "dhouston",
"dead": false,
"deleted": false,
"descendants": 71,
"hn_url": "https://news.ycombinator.com/item?id=8863",
"id": 8863,
"kids": [
8952,
9224,
8917
],
"parent": null,
"parts": [],
"poll": null,
"score": 104,
"text": null,
"time": 1175714200,
"time_iso": "2007-04-04T19:16:40+00:00",
"title": "My YC app: Dropbox - Throw away your USB drive",
"type": "story",
"url": "http://www.getdropbox.com/u/2/screencast.html"
}
}Get stories
Fetch a Hacker News story feed (Top, New, Best, Ask HN, Show HN, or Jobs) as full story records. Returns the stories in the feed's own ranking order.
Inputs
- Feed
story_typetext - Which story feed to pull. Defaults to Top stories.One of:
top(Top stories),new(New stories),best(Best stories),ask(Ask HN),show(Show HN),job(Jobs). - Number of stories
limitnumber - How many stories to return (1–100). Defaults to 10. Each story is fetched individually, so larger values take longer.From 1 to 100.
Outputs
result_countnumberresultsliststory_typetext
Example output
{
"result_count": 1,
"results": [
{
"by": "dhouston",
"dead": false,
"deleted": false,
"descendants": 71,
"hn_url": "https://news.ycombinator.com/item?id=8863",
"id": 8863,
"kids": [
8952,
9224,
8917
],
"parent": null,
"parts": [],
"poll": null,
"score": 104,
"text": null,
"time": 1175714200,
"time_iso": "2007-04-04T19:16:40+00:00",
"title": "My YC app: Dropbox - Throw away your USB drive",
"type": "story",
"url": "http://www.getdropbox.com/u/2/screencast.html"
}
],
"story_type": "top"
}Get user
Fetch a Hacker News user's public profile by username: their karma, account age, about text, and submitted-item ids. Usernames are case-sensitive.
Inputs
- Username
usernametextRequired - The case-sensitive username. Accepts a bare handle or a full news.ycombinator.com/user?id=… URL.
Outputs
userobject
Example output
{
"user": {
"about": "Bug fixer.",
"created": 1160418092,
"created_iso": "2006-10-09T18:21:32+00:00",
"hn_url": "https://news.ycombinator.com/user?id=pg",
"id": "pg",
"karma": 157316,
"submitted": [
39667625,
37278578,
37278345
],
"submitted_count": 3
}
}