idstringจำเป็น
Hacker News story id, e.g. "47340079".
https://api.sandbase.ai/v1/api/hacker-news/story-commentsList the comments on a Hacker News story by id - text, author, and timestamp as clean JSON.
เอาต์พุตของคุณจะแสดงที่นี่
กรอกอินพุตให้ครบ แล้วคลิก Run
Returns the comments on a Hacker News story as a flat list. Each comment has its author, text, timestamp, and the id of the item it replies to. You send the story id as input.
id and parentId of each comment.author.curl -X POST "https://api.sandbase.ai/v1/api/hacker-news/story-comments" \
-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": {
"comments": [
{
"author": "fcpguru",
"createdUtc": 1773257417,
"id": "47340089",
"parentId": "47340079",
"permalink": "https://news.ycombinator.com/item?id=47340089",
"postId": "47340079",
"text": "i agree but how is this ever going to be enforced verified? https://proofofhuman…"
}
]
},
"found": true
}
| Field | Meaning |
|---|---|
data.comments[].id | Id of the comment, as a string. |
data.comments[].author | Hacker News username of the person who wrote the comment. |
data.comments[].text | Text of the comment. |
data.comments[].createdUtc | Time the comment was posted, as a Unix timestamp in seconds. |
data.comments[].parentId | Id of the item this comment replies to. It equals the story id for top-level comments and another comment's id for replies. |
data.comments[].postId | Id of the story the comment belongs to. |
data.comments[].permalink | Link to the comment on news.ycombinator.com. |
found | true when the story was found. A lookup that finds nothing returns found: false. |
id is the number in the story URL, for example item?id=47340079.parentId, so group by parentId to build the thread tree.Billed at the actual cost of each call, about $0.0015 for the request above. Failed calls are not charged.
เริ่มสร้าง
เอ็นด์พอยต์ของ Platform API ที่มีการยืนยันตัวตนและการติดตามการใช้งานแบบรวมศูนย์
curl -X POST "https://api.sandbase.ai/v1/api/hacker-news/story-comments" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "47340079"
}'ตั้งค่า SandBase API key ของคุณในสภาพแวดล้อมฝั่งเซิร์ฟเวอร์ คำขอจะใช้การยืนยันตัวตนแบบ Bearer
export SANDBASE_API_KEY="YOUR_API_KEY"เก็บ key ไว้บนเซิร์ฟเวอร์ อย่าเปิดเผยในโค้ดฝั่งเบราว์เซอร์
idstringจำเป็นHacker News story id, e.g. "47340079".
บันทึกตัวอย่างการตอบกลับสำหรับ API นี้; จะไม่มีการส่งคำขอจริงเมื่อเปิดดู
ยังไม่มีการเผยแพร่การตอบกลับที่บันทึกไว้ ให้รัน API ใน Playground เพื่อดูการตอบกลับ
สำรวจเพิ่มเติม
| API | ราคา | การตอบกลับ |
|---|---|---|
Hacker News Story CommentsAPI นี้ 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/story-comments โดยใส่ SandBase API key ของคุณใน Authorization header (Bearer) และส่งพารามิเตอร์เป็น JSON body คุณยังสามารถลองใช้ได้ใน Playground บนหน้านี้โดยไม่ต้องเขียนโค้ด
เริ่มต้นที่ $0.0015 ต่อครั้ง คิดจากยอดคงเหลือ SandBase ของคุณ คุณจะถูกเรียกเก็บเฉพาะคำขอที่คุณส่งเท่านั้น ไม่มีค่าสมาชิกรายเดือน
ที่ต้องระบุ: id (string). ตาราง Parameters และ Playground ในหน้านี้แสดงทุกฟิลด์
การตอบกลับ JSON ที่ส่งกลับในคำขอ HTTP เดียวกัน (แบบซิงโครนัส) README บนหน้านี้มีตัวอย่างการตอบกลับ
ไม่จำเป็น Hacker News Story Comments ทำงานผ่าน SandBase ดังนั้น SandBase API key เดียวครอบคลุม endpoint นี้และทุก API กับโมเดลอื่นในแค็ตตาล็อก คุณไม่ต้องสมัครขอสิทธิ์เข้าถึง Hacker News API แยกต่างหาก