Hacker News user API
A Hacker News user: karma, account age, about text and their latest submissions.
GET /v1/hackernews/users/{username}1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/hackernews/users/pg",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "id": "pg", "created": 1160418092, "karma": 157316, "about": "Bug fixer.", "submitted": [ 39667625, 37278578, "… 98 more" ], "submitted_count": 15565}Parameters
| Name | Type | Description |
|---|---|---|
usernamepath · required | string | Username, case-sensitive. Example: pg. |
Response fields
200 with a HackerNewsUser, in Hacker News’s own items and search hits.
| Field | Type | Description |
|---|---|---|
id | string | |
created | integer | Unix seconds. |
karma | integer | |
about | string | HTML. |
submitted | integer[] | Ids of the user’s stories, polls and comments, newest first (up to 100 here). |
submitted_count | integer | How many items the user submitted in all. |
Status codes
| Status | Meaning |
|---|---|
200 | The user. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | The item or user does not exist. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | Hacker News is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
Questions
Are usernames case-sensitive?
Yes, as on Hacker News.
Hacker News is a trademark of Y Combinator. We are not affiliated with or endorsed by Y Combinator.