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.
出力はここに表示されます
入力を完了してから[実行]をクリックしてください。
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.
開発を始める
統一認証と使用状況の追跡を備えたプラットフォーム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キーをサーバー環境に設定してください。リクエストはBearer認証を使用します。
export SANDBASE_API_KEY="YOUR_API_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の保存済みサンプルレスポンスです。表示時にライブリクエストは行われません。
保存済みレスポンスはまだ公開されていません。PlaygroundでAPIを実行し、レスポンスを確認してください。
さらに探索
| API | 価格 | レスポンス |
|---|---|---|
Reddit Trending Postsこの API Reddit | 1回あたり $0.0003 から | JSON |
Reddit | $0.001 / 回 | JSON |
Reddit | $0.001 / 回 | JSON |
Reddit | $0.001 / 回 | JSON |
Reddit | $0.001 / 回 | JSON |
Reddit | $0.001 / 回 | JSON |
質問
Authorization ヘッダー(Bearer)に SandBase API key を指定し、パラメータを JSON ボディで送信して https://api.sandbase.ai/v1/api/reddit/trending-posts に POST リクエストを送ります。このページの Playground で、コードを書かずに試すこともできます。
1回あたり $0.0003 から、SandBase 残高から課金されます。課金対象はご利用分のみで、サブスクリプションはありません。
必須パラメータはありません。 任意: after (string) と limit (integer)。 このページの Parameters テーブルと Playground に、すべてのフィールドが一覧表示されています。
同じ HTTP リクエスト内で返される JSON レスポンスです(同期)。 このページの README にサンプルレスポンスがあります。
いいえ。Reddit Trending Posts は SandBase 経由で動作するため、SandBase の API key 1つでこのエンドポイントと、カタログ内の他のすべての API とモデルを利用できます。Reddit の API アクセスを別途申請する必要はありません。