Sand AISand AI MAGI-2MAGI-2 kini tersedia di SandBase: video 1080p dengan audio nativeCoba sekarang

Hacker News Profile

Dokumentasi 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.

Harga
Dari $0.0015USD / panggilan
Metode
POST
Respons
JSON
Parameter
1 wajib · 0 opsional

Playground

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

Output Anda akan muncul di sini

Lengkapi input, lalu klik Run.

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.

Jelajahi lebih lanjut

API Terkait

Semua APIs
APIHargaRespons
Hacker NewsDari $0.0015 per panggilanJSON
Hacker NewsDari $0.0015 per panggilanJSON
Hacker NewsDari $0.0015 per panggilanJSON
Hacker NewsDari $0.0015 per panggilanJSON

Pertanyaan

FAQ

Bagaimana cara menggunakan API Hacker News Profile?

Kirim permintaan POST ke https://api.sandbase.ai/v1/api/hacker-news/profile dengan kunci API SandBase Anda di header Authorization (Bearer) dan parameter sebagai body JSON. Anda juga dapat mencobanya di Playground di halaman ini tanpa menulis kode.

Berapa biaya API Hacker News Profile?

Mulai dari $0.0015 per panggilan, ditagihkan dari saldo SandBase Anda. Anda hanya dikenai biaya untuk panggilan yang Anda lakukan; tidak ada langganan.

Parameter apa yang diterima API Hacker News Profile?

Wajib: handle (string). Tabel Parameters dan Playground di halaman ini mencantumkan setiap field.

Apa yang dikembalikan API Hacker News Profile?

Respons JSON yang dikembalikan dalam permintaan HTTP yang sama (sinkron). README di halaman ini menyertakan contoh respons.

Apakah saya memerlukan akun developer atau kunci API Hacker News?

Tidak. Hacker News Profile berjalan melalui SandBase, jadi satu kunci API SandBase mencakup endpoint ini dan setiap API serta model lain di katalog. Anda tidak perlu mendaftar akses API Hacker News secara terpisah.