The posts Reddit’s own model relates to a post, from any community: title, community, score, comments, created time, type, plus subreddits, the communities they come from. Always at most 25 posts, no paging. Billed 1 request, +1 per post detailed with with_details=true.
HTTP Request
GET /post/related
Cost (in requests): 1; +1 per post detailed. Every successful answer reports its cost in data.billed_requests.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
post_id | string | No | - | Post id, with or without the t3_ prefix (e.g. z1c9z or t3_z1c9z). Give this or url. |
url | string | No | - | A Reddit post or comment URL (https://www.reddit.com/r/IAmA/comments/z1c9z/..., redd.it/z1c9z), or the permalink path returned by this API. Alternative to the id. |
include_nsfw | boolean | No | true | Default true: 18+ posts included; pass false to drop them. |
with_details | boolean | No | false | Adds the full post card per post (left out without it): url, domain, author, upvote_ratio, flair, body_text, body_media, media (video renditions, poster), poll, thumbnail_url and the other post-card keys. A post whose details could not be read keeps the basic row. Billed: +1 request per post detailed. |
include_html | boolean | No | false | Adds body_html (the rendered HTML body) to every post and comment. Default: left out; body_text carries the same text. |
Response
Real response to GET /post/related?post_id=t3_1xj9fse (arrays trimmed to 2 items, long texts cut with …).
| |
Response Fields
| Field | Type | Description |
|---|---|---|
status | boolean | true when the request succeeded |
request_id | string | Unique request identifier |
data | object | Related posts; null with error.code not_found when the post does not exist. |
data.post_id | string | The post the list is for (t3_…). |
data.items | array of objects | Up to 25 related posts in Reddit’s order (position keeps Reddit’s numbering: the slot of the ad Reddit shows is a gap). |
data.items[].post_id | string | Post fullname, e.g. t3_z1c9z. |
data.items[].title | string | Post title; null when Reddit shows only its removal placeholder ([ Removed by moderator ]…). |
data.items[].type | string | text, link, image, gif, gallery, video, poll, crosspost, embed, game. A text post with inline images is text (its images in body_media). Only with with_details=true on /post/batch and /answers. |
data.items[].permalink | string | Reddit path, e.g. /r/IAmA/comments/z1c9z/i_am_barack_obama/ (Reddit’s relative value; post_url is the same thread as a full link). Either form can be passed back as url. |
data.items[].post_url | string | Absolute link of the post’s Reddit thread (https://www.reddit.com + permalink), ready to open. |
data.items[].subreddit | string | Subreddit name without r/. |
data.items[].subreddit_id | string | Subreddit id (t5_…). |
data.items[].score | integer | Net upvotes at fetch time. |
data.items[].comments_count | integer | Comment count reported by Reddit. |
data.items[].created_at | string | ISO-8601 UTC creation time, microsecond precision. Left out on /media/search and on /answers without with_details. |
data.items[].is_nsfw | boolean | Marked NSFW. |
data.items[].is_archived | boolean | Archived (no new votes or comments). Only with with_details=true on the routes that have it (always on /post/search). Left out on /media/search. |
data.items[].position | integer | Rank in the feed or the search results, 1-based and counted across pages (feeds keep Reddit’s gaps where ads were). |
data.items[].recommendation_source | string | Why Reddit placed the post in a Reddit-wide feed, e.g. popular or global_good_visits (informational). Present only on feeds that report it. |
data.subreddits | array of objects | The communities of items, most posts first. |
data.subreddits[].name | string | Subreddit name without r/. |
data.subreddits[].subreddit_id | string | Subreddit id (t5_…). |
data.subreddits[].posts_count | integer | Related posts of this answer in the community. |
data.billed_requests | integer | Requests billed for this call (also sent as Requests in the X-RapidAPI-Billing header when it is not RapidAPI’s default of 1). |
request_params | object | Echo of the parameters you sent |
Error Responses
Invalid input returns HTTP 400, not billed. error is a plain string that names the parameter:
| |
| Status Code | Cause | Description |
|---|---|---|
| 400 | Invalid or missing parameter | Plain-English message per field. Not billed |
200 with status: false | Item not available | error.code is not_found, deleted (post removed or deleted). data is null. Billed 1 request |
| 503 | Reddit temporarily unreachable | "error": "Service temporarily unavailable". Not billed, retry later |
Code Examples
| |
| |
| |
Related Endpoints
- Post Status : Check whether up to 200 posts are live, removed or deleted
- Post Archive : Reddit’s dated archive: top posts of a day, month or year since 2008
- Related Videos : Videos Reddit suggests after a video post