Sand AISand AI MAGI-2MAGI-2 が SandBase に登場しました: ネイティブ音声付き 1080p 動画今すぐ試す

Hacker News Profile

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.

料金
$0.0015 からUSD / 回
メソッド
POST
レスポンス
JSON
パラメータ
必須 1 件 · 任意 0 件

プレイグラウンド

入力
Hacker News username, e.g. "pg".
出力準備完了

出力はここに表示されます

入力を完了してから[実行]をクリックしてください。

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.

さらに探索

関連 APIs

すべての APIs
API価格レスポンス
Hacker News1回あたり $0.0015 からJSON
Hacker News1回あたり $0.0015 からJSON
Hacker News1回あたり $0.0015 からJSON
Hacker News1回あたり $0.0015 からJSON

質問

FAQ

Hacker News Profile API はどのように使いますか?

Authorization ヘッダー(Bearer)に SandBase API key を指定し、パラメータを JSON ボディで送信して https://api.sandbase.ai/v1/api/hacker-news/profile に POST リクエストを送ります。このページの Playground で、コードを書かずに試すこともできます。

Hacker News Profile API の料金はいくらですか?

1回あたり $0.0015 から、SandBase 残高から課金されます。課金対象はご利用分のみで、サブスクリプションはありません。

Hacker News Profile API はどのパラメータを受け付けますか?

必須: handle (string)。 このページの Parameters テーブルと Playground に、すべてのフィールドが一覧表示されています。

Hacker News Profile API は何を返しますか?

同じ HTTP リクエスト内で返される JSON レスポンスです(同期)。 このページの README にサンプルレスポンスがあります。

Hacker News の開発者アカウントまたは API key は必要ですか?

いいえ。Hacker News Profile は SandBase 経由で動作するため、SandBase の API key 1つでこのエンドポイントと、カタログ内の他のすべての API とモデルを利用できます。Hacker News の API アクセスを別途申請する必要はありません。