idstringआवश्यक
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.
आपका आउटपुट यहाँ दिखाई देगा
इनपुट पूरा करें, फिर Run पर क्लिक करें।
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.
बिल्डिंग शुरू करें
एकीकृत authentication और usage tracking के साथ Platform API endpoint.
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"
}'अपने SandBase API key को अपने सर्वर environment में सेट करें। Requests Bearer authentication का उपयोग करती हैं।
export SANDBASE_API_KEY="YOUR_API_KEY"अपना key सर्वर पर रखें। इसे browser code में expose न करें।
idstringआवश्यकHacker News story id, e.g. "47340079".
इस API के लिए सेव किया गया example response; इसे देखते समय कोई live request नहीं की जाती।
कोई सेव response प्रकाशित नहीं किया गया है। इसका response देखने के लिए Playground में API चलाएँ।
और जानें
| API | कीमत | प्रतिक्रिया |
|---|---|---|
Hacker News Storyयह API Hacker News | $0.0015 प्रति कॉल से | JSON |
Hacker News | $0.0015 प्रति कॉल से | JSON |
Hacker News | $0.0015 प्रति कॉल से | JSON |
Hacker News | $0.0015 प्रति कॉल से | JSON |
प्रश्न
https://api.sandbase.ai/v1/api/hacker-news/story पर Authorization header (Bearer) में अपनी SandBase API key और parameters को JSON body के रूप में भेजें। आप इस पेज के Playground में बिना code लिखे भी इसे आज़मा सकते हैं।
$0.0015 से प्रति call, आपकी SandBase balance से बिल किया जाएगा। आपसे केवल आपके किए गए calls के लिए शुल्क लिया जाता है; कोई subscription नहीं है।
आवश्यक: id (string)। Parameters table और इस पेज का Playground हर field सूचीबद्ध करते हैं।
एक JSON response जो उसी HTTP request में लौटाया जाता है (synchronous)। इस पेज का README एक sample response शामिल करता है।
नहीं। Hacker News Story SandBase के माध्यम से चलता है, इसलिए एक SandBase API key इस endpoint और catalog के हर अन्य API और model को कवर करती है। आपको अलग से Hacker News API access के लिए आवेदन करने की आवश्यकता नहीं है।