Sand AISand AI MAGI-2MAGI-2 artık SandBase'de: yerel sesli 1080p videoŞimdi deneyin

Hacker News Profile

API dokümanları
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.

Fiyat
Başlangıç fiyatı $0.0015USD / çağrı
Yöntem
POST
Yanıt
JSON
Parametreler
1 gerekli · 0 isteğe bağlı

Oynatma Alanı

Girdi
Hacker News username, e.g. "pg".
ÇıktıHazır

Çıktınız burada görünecek

Girdileri tamamlayın, ardından Çalıştır'a tıklayın.

API README

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.

Daha fazlasını keşfedin

İlgili APIs

Tüm APIs
APIFiyatYanıt
Hacker NewsKullanım başına $0.0015'den itibarenJSON
Hacker NewsKullanım başına $0.0015'den itibarenJSON
Hacker NewsKullanım başına $0.0015'den itibarenJSON
Hacker NewsKullanım başına $0.0015'den itibarenJSON

Sorular

SSS

Hacker News Profile API'sini nasıl kullanırım?

SandBase API anahtarınızı Authorization başlığında (Bearer) ve parametreleri JSON gövdesi olarak ile https://api.sandbase.ai/v1/api/hacker-news/profile adresine bir POST isteği gönderin. Ayrıca bu sayfadaki Playground’da kod yazmadan da deneyebilirsiniz.

Hacker News Profile API'sinin fiyatı nedir?

çağrı başına $0.0015'dan başlayan, SandBase bakiyenizden tahsil edilir. Yalnızca yaptığınız çağrılar için ücretlendirilirsiniz; abonelik yoktur.

Hacker News Profile API'si hangi parametreleri kabul eder?

Gerekli: handle (string). Parametreler tablosu ve bu sayfadaki Playground, tüm alanları listeler.

Hacker News Profile API'si ne döndürür?

Aynı HTTP isteğinde döndürülen bir JSON yanıtı (senkron). Bu sayfadaki README'de örnek bir yanıt yer alır.

Bir Hacker News geliştirici hesabına veya API anahtarına ihtiyacım var mı?

Hayır. Hacker News Profile, SandBase üzerinden çalışır; bu nedenle tek bir SandBase API anahtarı bu uç noktayı ve katalogdaki diğer tüm API'leri ve modelleri kapsar. Hacker News API erişimi için ayrıca başvuru yapmanız gerekmez.