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.
Output Anda akan muncul di sini
Lengkapi input, lalu klik 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.
Mulai membangun
Endpoint API platform dengan autentikasi dan pelacakan penggunaan terpadu.
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
}'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.
afterstringPagination cursor from a previous response's nextCursor. Omit for the first page.
limitintegerMaximum number of trending posts to return (1-100, default 25).
Default: 25
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 |
|---|---|---|
Reddit Trending PostsAPI ini Reddit | Dari $0.0003 per panggilan | JSON |
Reddit | $0.001 per panggilan | JSON |
Reddit | $0.001 per panggilan | JSON |
Reddit | $0.001 per panggilan | JSON |
Reddit | $0.001 per panggilan | JSON |
Reddit | $0.001 per panggilan | JSON |
Pertanyaan
Kirim permintaan POST ke https://api.sandbase.ai/v1/api/reddit/trending-posts 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.0003 per panggilan, ditagihkan dari saldo SandBase Anda. Anda hanya dikenai biaya untuk panggilan yang Anda lakukan; tidak ada langganan.
Tidak ada parameter yang wajib. Opsional: after (string) dan limit (integer). 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. Reddit Trending Posts 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 Reddit secara terpisah.