100 free credits. No credit card required. Get a key

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 failure
import 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

NameTypeDescription
usernamepath · requiredstringUsername, case-sensitive. Example: pg.
Response fields

200 with a HackerNewsUser, in Hacker News’s own items and search hits.

FieldTypeDescription
idstring
createdintegerUnix seconds.
karmainteger
aboutstringHTML.
submittedinteger[]Ids of the user’s stories, polls and comments, newest first (up to 100 here).
submitted_countintegerHow many items the user submitted in all.
Status codes
StatusMeaning
200The user.
400Invalid input. Nothing was charged.
401Missing or invalid API key.
402Not enough credits, a spend cap was reached, or payment is required.
403The target is private, or the account is suspended.
404The item or user does not exist.
429Too many requests. Wait for Retry-After seconds.
503Hacker 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.