Skip to content
Scrappa Get API key
Reddit API 1 credit/request

Reddit Subreddit Posts API Documentation

GET https://scrappa.co/api/reddit/subreddit/posts

Reddit Subreddit Posts API lists the posts of one subreddit. Sort by hot (default), new, top, rising or controversial. The time window t only works with top and controversial; with another sort the request fails with 422. A subreddit that does not exist, is private or is banned returns 404.

Each post has id, fullname, title, selftext (null for link posts), author, subreddit, score, upvote_ratio, num_comments, awards, flair, created_at and created_utc, permalink, url, domain, post_type (text, link, image, gallery, video or crosspost), the flags over_18, spoiler, stickied, locked and archived, removed_by_category, thumbnail_url, gallery, video and crosspost_parent. Deleted authors and removed posts show Reddit's own marker such as [deleted].

Every list has pagination with limit, after, next_after and has_more. Pass next_after as after to read the next page. A page is never another page's data under a new label. Reddit ends every list after about 1000 items.

Reddit Subreddit Posts API Documentation 1 credit/request

Endpoint

Request preview
GET
https://scrappa.co/api/reddit/subreddit/posts
Auth header
x-api-key
Cost
1 credit/request
subreddit = example
Response preview
200 OK
{
    "data": {
        "sort": "hot",
        "time": null,
        "posts": [],
        "subreddit": "singularity",
        "pagination": {
            "after": null,
            "limit": 2,
            "has_more": true,
            "next_after": "t3_1xi16s3"
        }
    },
    "meta": {
...

Parameters

Start with the required fields, then add optional filters only when your use case needs them.

Runnable path

1 required parameter needed before sending a request.

4 optional filters available.

subreddit string Required

Subreddit name without r/. Example: programming.

Example value example
sort string Optional

hot (default), new, top, rising or controversial. Example: top.

Example value relevance
t string Optional

Time window: hour, day, week, month, year or all. Only with sort top or controversial. Items outside the window are never returned. Example: week.

Example value example
after string Optional

Cursor from pagination.next_after of the previous page. Example: t3_1xhv532.

Example value example
limit integer Optional

Items per page, 1 to 100 (default 25). Example: 25.

Example value 10

Response Schema

Example response fields are illustrative; inspect the JSON before integrating.

Example response fields

Scan these fields before integrating.

data meta success
JSON Response
200 OK
{
    "data": {
        "sort": "hot",
        "time": null,
        "posts": [],
        "subreddit": "singularity",
        "pagination": {
            "after": null,
            "limit": 2,
            "has_more": true,
            "next_after": "t3_1xi16s3"
        }
    },
    "meta": {
        "billable": true,
        "endpoint_family": "subreddit_posts"
    },
    "success": true
}

Errors

Handle these documented responses before retrying or showing customer-facing failures.

422

Validation Error

A required parameter or a value is invalid. This response is not billable.

{
    "errors": {
        "subreddit": [
            "The subreddit field is required."
        ]
    },
    "message": "The request validation failed"
}
404

Not Found

The subreddit, post or user does not exist, is private or is banned. This response is not billable.

{
    "meta": {
        "billable": false,
        "retryable": false,
        "endpoint_family": "subreddit_posts"
    },
    "error": {
        "code": "NOT_FOUND",
        "message": "The requested resource was not found."
    },
    "success": false
}
503

Upstream Unavailable

Reddit could not be reached or returned data that does not match the request. This response is not billable and is retryable.

{
    "meta": {
        "billable": false,
        "retryable": true,
        "endpoint_family": "subreddit_posts"
    },
    "error": {
        "code": "UPSTREAM_UNAVAILABLE",
        "message": "Reddit could not be reached. Please retry shortly."
    },
    "success": false
}

Generate Code with AI

Copy a ready-made prompt with all the endpoint details, parameters, and example responses. Paste it into ChatGPT, Claude, or any AI assistant to instantly generate working code.

Try It Live

Test this endpoint in our interactive playground with real data.