Sand AISand AI MAGI-2MAGI-2 è ora su SandBase: video in 1080p con audio nativoProvalo ora

Hacker News Profile

Documentazione API
https://api.sandbase.ai/v1/api/hacker-news/profile

Get a Hacker News user's public profile by username - karma, bio, and account details as clean JSON.

Prezzo
Da $0.0015USD / chiamata
Metodo
POST
Risposta
JSON
Parametri
1 obbligatori · 0 opzionali

Playground

Input
Hacker News username, e.g. "pg".
OutputPronto

Il tuo output apparirà qui

Completa gli input, poi fai clic su Esegui.

README API

Hacker News Profile API

Returns the public profile of a Hacker News user: the username, karma score, and bio. It needs one input, the Hacker News username as handle.

Use cases

  • Check the karma of a Hacker News account before you trust or rank its comments.
  • Show an author's bio and karma next to their posts in a dashboard.
  • Confirm that a Hacker News username exists before you run further lookups.
  • Track the karma of a set of well-known users over time.

Request

curl -X POST "https://api.sandbase.ai/v1/api/hacker-news/profile" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"handle": "pg"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
handlestringYesHacker News username, e.g. "pg".

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "data": {
    "bio": "Bug fixer.",
    "karma": 157316,
    "username": "pg"
  },
  "found": true
}

Response fields

FieldMeaning
foundtrue when the username exists. A lookup with no match still succeeds and returns found: false.
data.usernameThe Hacker News username of the profile.
data.karmaThe karma score of the user.
data.bioThe text the user wrote in the profile's about field.

Notes

  • Pass the username exactly as it appears on Hacker News, for example pg.
  • Check found before you read data, because a missing user returns found: false.
  • To find stories and comments on Hacker News, use Hacker News Search.
  • To read a specific story and its discussion, call Hacker News Story or Hacker News Story Comments.

Pricing

Billed at the actual cost of each call, about $0.0015 for the request above. Failed calls are not charged.

Esplora altro

API correlate

Tutte le API
APIPrezzoRisposta
Hacker NewsDa $0.0015 per chiamataJSON
Hacker NewsDa $0.0015 per chiamataJSON
Hacker NewsDa $0.0015 per chiamataJSON
Hacker NewsDa $0.0015 per chiamataJSON

Domande

FAQ

Come uso l'API Hacker News Profile?

Invia una richiesta POST a https://api.sandbase.ai/v1/api/hacker-news/profile con la tua chiave API di SandBase nell'header Authorization (Bearer) e i parametri nel body JSON. Puoi anche provarla nel Playground di questa pagina senza scrivere codice.

Quanto costa l'API Hacker News Profile?

A partire da $0.0015 per chiamata, addebitato dal tuo saldo SandBase. Paghi solo le chiamate che effettui; non c'è alcun abbonamento.

Quali parametri accetta l'API Hacker News Profile?

Richiesti: handle (string). La tabella dei parametri e il Playground di questa pagina elencano tutti i campi.

Cosa restituisce l'API Hacker News Profile?

Una risposta JSON restituita nella stessa richiesta HTTP (sincrona). Il README di questa pagina include una risposta di esempio.

Mi serve un account sviluppatore o una chiave API Hacker News?

No. Hacker News Profile funziona tramite SandBase, quindi una sola chiave API SandBase copre questo endpoint e tutte le altre API e modelli del catalogo. Non è necessario richiedere separatamente l'accesso alle API Hacker News.