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

Reddit Search Posts API Documentation

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

Reddit Search Posts API searches Reddit posts by keyword. Choose the sort (relevance, hot, top, new or comments) and a time window t. Set subreddit to search one community only. Every returned post matches the subreddit and the time window you asked for. Adult posts are left out unless nsfw=true.

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 Search Posts API Documentation 1 credit/request

Endpoint

Request preview
GET
https://scrappa.co/api/reddit/search/posts
Auth header
x-api-key
Cost
1 credit/request
query = coffee shops
Response preview
200 OK
{
    "data": {
        "sort": "top",
        "time": null,
        "posts": [
            {
                "id": "1xdv3e5",
                "url": "https://www.reddit.com/gallery/1xdv3e5",
                "flair": {
                    "text": "Discussion \ud83d\udde3\ufe0f",
                    "text_color": "dark",
                    "background_color": "#ffd635"
                },
                "score": 46921,
...

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.

6 optional filters available.

query string Required

Search text, up to 512 characters. Example: openai.

Example value coffee shops
sort string Optional

relevance (default), hot, top, new or comments. Example: top.

Example value relevance
t string Optional

Time window: hour, day, week, month, year or all. Items outside the window are never returned. Example: week.

Example value example
subreddit string Optional

Only posts of this subreddit, without r/. Example: programming.

Example value example
nsfw boolean Optional

true to include adult posts (default false). Example: false.

Example value true
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": "top",
        "time": null,
        "posts": [
            {
                "id": "1xdv3e5",
                "url": "https://www.reddit.com/gallery/1xdv3e5",
                "flair": {
                    "text": "Discussion \ud83d\udde3\ufe0f",
                    "text_color": "dark",
                    "background_color": "#ffd635"
                },
                "score": 46921,
                "title": "Hacker reverse engineers his Samsung TV and finds on-board AI listening for sounds of dog and baby, proceeds to get his account suspended...",
                "video": null,
                "author": "JarPicklez",
                "awards": [],
                "domain": "reddit.com",
                "locked": false,
                "gallery": [
                    {
                        "id": "tc7ye5jtbbxh1",
                        "url": "https://preview.redd.it/tc7ye5jtbbxh1.jpeg?width=640&format=pjpg&auto=webp&s=401810280387183901e497762e8487a7902d3cd4",
                        "link": null,
                        "width": 640,
                        "height": 1013,
                        "caption": null,
                        "mime_type": "image/jpeg"
                    }
                ],
                "over_18": false,
                "spoiler": false,
                "archived": false,
                "fullname": "t3_1xdv3e5",
                "selftext": "This is wild ",
                "stickied": false,
                "edited_at": null,
                "permalink": "https://www.reddit.com/r/antiai/comments/1xdv3e5/hacker_reverse_engineers_his_samsung_tv_and_finds/",
                "post_type": "gallery",
                "subreddit": "antiai",
                "created_at": "2026-10-24T00:50:17+00:00",
                "created_utc": 1792803017,
                "preview_url": null,
                "author_flair": null,
                "num_comments": 1743,
                "subreddit_id": "t5_37shj",
                "upvote_ratio": 0.98,
                "distinguished": null,
                "thumbnail_url": null,
                "num_crossposts": 26,
                "author_fullname": "t2_2o5c37a5k3",
                "crosspost_parent": null,
                "is_original_content": false,
                "removed_by_category": null,
                "subreddit_subscribers": 394165,
                "total_awards_received": 0
            }
        ],
        "query": "openai",
        "subreddit": null,
        "pagination": {
            "after": null,
            "limit": 3,
            "has_more": true,
            "next_after": "t3_1xhv532"
        }
    },
    "meta": {
        "billable": true,
        "endpoint_family": "search_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": {
        "query": [
            "The query field is required."
        ]
    },
    "message": "The request validation failed"
}
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": "search_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.