handlestringобязательно
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.
Ваш результат появится здесь
Заполните входные данные, затем нажмите «Запустить».
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.
Начните разработку
Конечная точка платформенного API с единообразной аутентификацией и учётом использования.
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"
}'Укажите свой ключ SandBase API в окружении сервера. Запросы используют аутентификацию Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Храните ключ на сервере. Не раскрывайте его в коде браузера.
handlestringобязательноHacker News username, e.g. "pg".
Сохранённый пример ответа для этого API; при просмотре живой запрос не выполняется.
Сохранённый ответ не опубликован. Запустите API в Playground, чтобы посмотреть его ответ.
Посмотреть больше
| API | Цена | Ответ |
|---|---|---|
Hacker News ProfileЭтот API Hacker News | От $0.0015 за запрос | JSON |
Hacker News | От $0.0015 за запрос | JSON |
Hacker News | От $0.0015 за запрос | JSON |
Hacker News | От $0.0015 за запрос | JSON |
Вопросы
Отправьте POST-запрос на https://api.sandbase.ai/v1/api/hacker-news/profile, указав ключ SandBase API в заголовке Authorization (Bearer), а параметры — в теле JSON. Вы также можете попробовать это в Playground на этой странице без написания кода.
От $0.0015 за вызов, списывается с баланса SandBase. Оплата взимается только за сделанные вызовы; подписка не требуется.
Обязательные: handle (string). В таблице Parameters и в Playground на этой странице перечислены все поля.
JSON-ответ, возвращаемый в том же HTTP-запросе (синхронно). В README на этой странице приведен пример ответа.
Нет. Hacker News Profile работает через SandBase, поэтому один API key SandBase покрывает этот endpoint и все остальные API и модели в каталоге. Вам не нужно отдельно запрашивать доступ к API Hacker News.