querystringwajib
Search keyword, e.g. "ai".
https://api.sandbase.ai/v1/api/hacker-news/searchSearch Hacker News by keyword - matching stories with title, link, author, points, and comment count as clean JSON.
Output Anda akan muncul di sini
Lengkapi input, lalu klik Run.
Returns Hacker News items that match a keyword. Each result has the title, link, author, points, comment count, and creation time. The only required input is query.
tags to look only at stories or only at comments.curl -X POST "https://api.sandbase.ai/v1/api/hacker-news/search" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "ai"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Search keyword, e.g. "ai". |
tags | string | No | Optional result filter, e.g. "story" or "comment". |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"data": {
"results": [
{
"author": "usefulposter",
"comments": 1668,
"createdUtc": 1773257369,
"id": "47340079",
"permalink": "https://news.ycombinator.com/item?id=47340079",
"points": 4229,
"title": "Don't post generated/AI-edited comments. HN is for conversation between humans",
"url": "https://news.ycombinator.com/newsguidelines.html#generated"
}
]
},
"found": true
}
| Field | Meaning |
|---|---|
data.results[].title | Title of the Hacker News post. |
data.results[].url | Link the post points to. This is the external page or guideline the author shared. |
data.results[].permalink | Link to the item's discussion page on Hacker News. |
data.results[].id | Hacker News item ID, returned as a string. |
data.results[].author | Hacker News username of the person who posted the item. |
data.results[].points | Score of the post. |
data.results[].comments | Number of comments on the post. |
data.results[].createdUtc | Creation time as a Unix timestamp in seconds. |
found | true when the search returned results. |
tags to a value such as story or comment to filter the result type.id value from a result as the input for Hacker News Story to get one post, or Hacker News Story Comments to read its discussion.author to Hacker News Profile to look up that user.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/search" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "ai"
}'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.
querystringwajibSearch keyword, e.g. "ai".
tagsstringOptional result filter, e.g. "story" or "comment".
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 SearchAPI 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/search 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: query (string). Opsional: tags (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 Search 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.