API · Reddit
Posts in a subreddit, by hot, new, top, rising or controversial.
GET /v1/reddit/subreddits/{name}/posts
| |
|---|
| Request | GET /v1/reddit/subreddits/{name}/posts |
| Operation id | reddit.subreddit.posts |
| Cost | 1 credit, refunded if the call fails |
| Auth | API key: Authorization: Bearer <key> or x-api-key. |
Posts in a subreddit, by hot, new, top, rising or controversial.
| Name | Type | Required | Description |
|---|
name | string | yes | Subreddit name, with or without "r/". "all" and "popular" also work for posts. Example: typescript. |
| Name | Type | Required | Description |
|---|
sort | "hot" | "new" | "top" | "rising" | "controversial" | no | Listing order. Default hot. One of hot, new, top, rising, controversial. |
t | "hour" | "day" | "week" | "month" | "year" | "all" | no | Time window for top and controversial. Default day. One of hour, day, week, month, year, all. |
limit | integer | no | Items per page, 1 to 100. Default 25. |
after | string | no | Cursor: the previous page's data.after. Omit for the first page. |
| Status | Meaning | Schema |
|---|
200 | A page of posts. | LinkListing |
400 | Invalid input. Nothing was charged. | Error |
401 | Missing or invalid API key. | Error |
402 | Not enough credits, a spend cap was reached, or payment is required. | Error |
403 | The target is private, or the account is suspended. | Error |
404 | The subreddit, post or user does not exist. | Error |
429 | Too many requests. Wait for Retry-After seconds. | Error |
503 | Reddit is temporarily unavailable. Retryable; nothing was charged. | Error |
| Field | Type | Description |
|---|
kind | "Listing" | |
data | object | |
Errors use one shape everywhere; see Errors for every code and what to do.