afterstring
Pagination cursor from a previous response's nextCursor. Omit for the first page.
https://api.sandbase.ai/v1/api/reddit/trending-postsGet currently trending Reddit posts across all subreddits with stable cursor pagination.
เอาต์พุตของคุณจะแสดงที่นี่
กรอกอินพุตให้ครบ แล้วคลิก Run
Returns a list of Reddit posts that are currently trending across all subreddits. Each post includes its title, subreddit, author, score, comment count, and link. The only inputs are an optional page size (limit) and an optional cursor (after).
score and numComments across calls.domain values to see which sites and image hosts get shared most.curl -X POST "https://api.sandbase.ai/v1/api/reddit/trending-posts" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"limit": 25}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
after | string | No | Pagination cursor from a previous response's nextCursor. Omit for the first page. |
limit | integer | No | Maximum number of trending posts to return (1-100, default 25). |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"data": {
"nextCursor": "t3_1xmlmgw",
"posts": [
{
"author": "Negative_1by12_aura",
"authorId": "2eyayz4qcy",
"createdUtc": 1793676776,
"domain": "i.redd.it",
"id": "1xmids8",
"isArchived": false,
"isLocked": false,
"nsfw": false,
"numComments": 801,
"permalink": "/r/interesting/comments/1xmids8/hiv_is_no_longer_a_terminal_disease/",
"score": 21475,
"selftext": ""
}
]
},
"found": true
}
| Field | Meaning |
|---|---|
data.posts[].id | Post ID without a prefix. Use it to look up the post in other APIs. |
data.posts[].title | Title of the post. |
data.posts[].subreddit | Name of the subreddit where the post was made. |
data.posts[].author / data.posts[].authorId | Username and ID of the post author. |
data.posts[].score / data.posts[].numComments | Post score and number of comments. |
data.posts[].upvoteRatio | Share of votes that are upvotes, as a decimal between 0 and 1 (for example 0.94). |
data.posts[].createdUtc | Creation time of the post as a Unix timestamp in seconds. |
data.posts[].permalink / data.posts[].url | permalink is the Reddit path of the post. url is the link the post points to, such as an image. |
data.posts[].isArchived / data.posts[].isLocked / data.posts[].nsfw | Boolean flags for archived posts, locked posts, and posts marked NSFW. |
data.nextCursor | Cursor for the next page. Pass it as after in the next request. |
after. For the next page, send the value of data.nextCursor as after.limit accepts 1 to 100 and defaults to 25.selftext is empty for link and image posts, so text only appears for text posts.Billed at the actual cost of each call, about $0.0003 for the request above. Failed calls are not charged.
เริ่มสร้าง
เอ็นด์พอยต์ของ Platform API ที่มีการยืนยันตัวตนและการติดตามการใช้งานแบบรวมศูนย์
curl -X POST "https://api.sandbase.ai/v1/api/reddit/trending-posts" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"limit": 25
}'ตั้งค่า SandBase API key ของคุณในสภาพแวดล้อมฝั่งเซิร์ฟเวอร์ คำขอจะใช้การยืนยันตัวตนแบบ Bearer
export SANDBASE_API_KEY="YOUR_API_KEY"เก็บ key ไว้บนเซิร์ฟเวอร์ อย่าเปิดเผยในโค้ดฝั่งเบราว์เซอร์
afterstringPagination cursor from a previous response's nextCursor. Omit for the first page.
limitintegerMaximum number of trending posts to return (1-100, default 25).
ค่าเริ่มต้น: 25
บันทึกตัวอย่างการตอบกลับสำหรับ API นี้; จะไม่มีการส่งคำขอจริงเมื่อเปิดดู
ยังไม่มีการเผยแพร่การตอบกลับที่บันทึกไว้ ให้รัน API ใน Playground เพื่อดูการตอบกลับ
สำรวจเพิ่มเติม
| API | ราคา | การตอบกลับ |
|---|---|---|
Reddit Trending PostsAPI นี้ Reddit | เริ่มต้นที่ $0.0003 ต่อครั้ง | JSON |
Reddit | $0.001 ต่อการเรียก | JSON |
Reddit | $0.001 ต่อการเรียก | JSON |
Reddit | $0.001 ต่อการเรียก | JSON |
Reddit | $0.001 ต่อการเรียก | JSON |
Reddit | $0.001 ต่อการเรียก | JSON |
คำถาม
ส่งคำขอ POST ไปที่ https://api.sandbase.ai/v1/api/reddit/trending-posts โดยใส่ SandBase API key ของคุณใน Authorization header (Bearer) และส่งพารามิเตอร์เป็น JSON body คุณยังสามารถลองใช้ได้ใน Playground บนหน้านี้โดยไม่ต้องเขียนโค้ด
เริ่มต้นที่ $0.0003 ต่อครั้ง คิดจากยอดคงเหลือ SandBase ของคุณ คุณจะถูกเรียกเก็บเฉพาะคำขอที่คุณส่งเท่านั้น ไม่มีค่าสมาชิกรายเดือน
ไม่ต้องระบุพารามิเตอร์ ตัวเลือก: after (string) และ limit (integer). ตาราง Parameters และ Playground ในหน้านี้แสดงทุกฟิลด์
การตอบกลับ JSON ที่ส่งกลับในคำขอ HTTP เดียวกัน (แบบซิงโครนัส) README บนหน้านี้มีตัวอย่างการตอบกลับ
ไม่จำเป็น Reddit Trending Posts ทำงานผ่าน SandBase ดังนั้น SandBase API key เดียวครอบคลุม endpoint นี้และทุก API กับโมเดลอื่นในแค็ตตาล็อก คุณไม่ต้องสมัครขอสิทธิ์เข้าถึง Reddit API แยกต่างหาก