idstringobbligatorio
Hacker News story id, e.g. "47340079".
https://api.sandbase.ai/v1/api/hacker-news/storyGet a Hacker News story by id - title, link, author, points, and comment count as clean JSON.
Il tuo output apparirà qui
Completa gli input, poi fai clic su Esegui.
Returns the details of one Hacker News story: title, linked URL, author, points, and comment count. It needs the story id as input.
points and comments change by calling the API on a schedule.curl -X POST "https://api.sandbase.ai/v1/api/hacker-news/story" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id": "47340079"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Hacker News story id, e.g. "47340079". |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"data": {
"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.title | Title of the story as posted on Hacker News. |
data.url | Link the story points to. It can be an external page or a Hacker News page. |
data.permalink | Link to the story's discussion page on Hacker News. |
data.author | Username of the person who submitted the story. |
data.points | Number of points the story has. |
data.comments | Number of comments on the story. |
data.createdUtc | Time the story was created, as a Unix timestamp in seconds (UTC). |
data.id | The story id as a string. |
found | true when the story was found. false when no story matches the id. |
id from the item?id= part of a Hacker News story link, for example 47340079 in https://news.ycombinator.com/item?id=47340079.outputs[0].data. A missing story returns found: false instead of an error.data.author to Hacker News Profile.Billed at the actual cost of each call, about $0.0015 for the request above. Failed calls are not charged.
Inizia a costruire
Endpoint API della piattaforma con autenticazione unificata e tracciamento dell'utilizzo.
curl -X POST "https://api.sandbase.ai/v1/api/hacker-news/story" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "47340079"
}'Imposta la tua SandBase API key nell'ambiente del server. Le richieste usano l'autenticazione Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Conserva la tua key sul server. Non esporla nel codice del browser.
idstringobbligatorioHacker News story id, e.g. "47340079".
Risposta di esempio salvata per questa API; durante la visualizzazione non viene eseguita alcuna richiesta live.
Nessuna risposta salvata è stata pubblicata. Esegui l'API in Playground per ispezionarne la risposta.
Esplora altro
| API | Prezzo | Risposta |
|---|---|---|
Hacker News StoryQuesta API Hacker News | Da $0.0015 per chiamata | JSON |
Hacker News | Da $0.0015 per chiamata | JSON |
Hacker News | Da $0.0015 per chiamata | JSON |
Hacker News | Da $0.0015 per chiamata | JSON |
Domande
Invia una richiesta POST a https://api.sandbase.ai/v1/api/hacker-news/story con la tua chiave API di SandBase nell'header Authorization (Bearer) e i parametri nel body JSON. Puoi anche provarla nel Playground di questa pagina senza scrivere codice.
A partire da $0.0015 per chiamata, addebitato dal tuo saldo SandBase. Paghi solo le chiamate che effettui; non c'è alcun abbonamento.
Richiesti: id (string). La tabella dei parametri e il Playground di questa pagina elencano tutti i campi.
Una risposta JSON restituita nella stessa richiesta HTTP (sincrona). Il README di questa pagina include una risposta di esempio.
No. Hacker News Story funziona tramite SandBase, quindi una sola chiave API SandBase copre questo endpoint e tutte le altre API e modelli del catalogo. Non è necessario richiedere separatamente l'accesso alle API Hacker News.