handlestringwajib
Hacker News username, e.g. "pg".
https://api.sandbase.ai/v1/api/hacker-news/profileGet a Hacker News user's public profile by username - karma, bio, and account details as clean JSON.
Output Anda akan muncul di sini
Lengkapi input, lalu klik Run.
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.
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.
| Name | Type | Required | Description |
|---|---|---|---|
handle | string | Yes | Hacker News username, e.g. "pg". |
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
}
| Field | Meaning |
|---|---|
found | true when the username exists. A lookup with no match still succeeds and returns found: false. |
data.username | The Hacker News username of the profile. |
data.karma | The karma score of the user. |
data.bio | The text the user wrote in the profile's about field. |
pg.found before you read data, because a missing user returns found: false.Billed at the actual cost of each call, about $0.0015 for the request above. Failed calls are not charged.
Mulai membangun
Endpoint API platform dengan autentikasi dan pelacakan penggunaan terpadu.
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"
}'Atur SandBase API key Anda di environment server Anda. Permintaan menggunakan autentikasi Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Simpan key Anda di server. Jangan tampilkan di kode browser.
handlestringwajibHacker News username, e.g. "pg".
Contoh respons yang disimpan untuk API ini; tidak ada permintaan langsung yang dibuat saat melihatnya.
Belum ada respons tersimpan yang dipublikasikan. Jalankan API di Playground untuk melihat responsnya.
Jelajahi lebih lanjut
| API | Harga | Respons |
|---|---|---|
Hacker News ProfileAPI ini Hacker News | Dari $0.0015 per panggilan | JSON |
Hacker News | Dari $0.0015 per panggilan | JSON |
Hacker News | Dari $0.0015 per panggilan | JSON |
Hacker News | Dari $0.0015 per panggilan | JSON |
Pertanyaan
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.
Mulai dari $0.0015 per panggilan, ditagihkan dari saldo SandBase Anda. Anda hanya dikenai biaya untuk panggilan yang Anda lakukan; tidak ada langganan.
Wajib: handle (string). Tabel Parameters dan Playground di halaman ini mencantumkan setiap field.
Respons JSON yang dikembalikan dalam permintaan HTTP yang sama (sinkron). README di halaman ini menyertakan contoh respons.
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.