Sand AISand AI MAGI-2MAGI-2 agora está na SandBase: vídeo em 1080p com áudio nativoExperimente agora

Hacker News Profile

Docs da 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.

Preço
A partir de $0.0015USD / chamada
Método
POST
Resposta
JSON
Parâmetros
1 obrigatórios · 0 opcionais

Playground

Entrada
Hacker News username, e.g. "pg".
SaídaPronto

Sua saída aparecerá aqui

Preencha as entradas e clique em Executar.

README da 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.

Explorar mais

APIs relacionadas

Todas as APIs
APIPreçoResposta
Hacker NewsA partir de $0.0015 por chamadaJSON
Hacker NewsA partir de $0.0015 por chamadaJSON
Hacker NewsA partir de $0.0015 por chamadaJSON
Hacker NewsA partir de $0.0015 por chamadaJSON

Perguntas

FAQ

Como eu uso a API Hacker News Profile?

Envie uma solicitação POST para https://api.sandbase.ai/v1/api/hacker-news/profile com sua chave de API da SandBase no cabeçalho Authorization (Bearer) e os parâmetros no corpo JSON. Você também pode testar no Playground desta página sem escrever código.

Quanto custa a API Hacker News Profile?

A partir de $0.0015 por chamada, cobrado do seu saldo SandBase. Você paga apenas pelas chamadas que fizer; não há assinatura.

Quais parâmetros a API Hacker News Profile aceita?

Obrigatórios: handle (string). A tabela de Parâmetros e o Playground nesta página listam todos os campos.

O que a API Hacker News Profile retorna?

Uma resposta JSON retornada na mesma solicitação HTTP (síncrona). O README desta página inclui um exemplo de resposta.

Preciso de uma conta de desenvolvedor Hacker News ou de uma chave de API?

Não. Hacker News Profile funciona via SandBase, então uma única chave de API da SandBase cobre este endpoint e todas as outras APIs e modelos do catálogo. Você não precisa solicitar acesso à API do Hacker News separadamente.