# Reddit Search Posts API Documentation

<p><strong>Reddit Search Posts API</strong> searches Reddit posts by keyword. Choose the sort (<code>relevance</code>, <code>hot</code>, <code>top</code>, <code>new</code> or <code>comments</code>) and a time window <code>t</code>. Set <code>subreddit</code> to search one community only. Every returned post matches the subreddit and the time window you asked for. Adult posts are left out unless <code>nsfw=true</code>.</p><p>Each post has id, fullname, title, selftext (<code>null</code> for link posts), author, subreddit, score, upvote_ratio, num_comments, awards, flair, created_at and created_utc, permalink, url, domain, <code>post_type</code> (text, link, image, gallery, video or crosspost), the flags over_18, spoiler, stickied, locked and archived, <code>removed_by_category</code>, <code>thumbnail_url</code>, <code>gallery</code>, <code>video</code> and <code>crosspost_parent</code>. Deleted authors and removed posts show Reddit's own marker such as <code>[deleted]</code>.</p><p>Every list has <code>pagination</code> with <code>limit</code>, <code>after</code>, <code>next_after</code> and <code>has_more</code>. Pass <code>next_after</code> as <code>after</code> 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.</p>

- **Documentation:** [https://scrappa.co/docs/reddit-api/reddit_search_posts](https://scrappa.co/docs/reddit-api/reddit_search_posts)
- **API group:** Reddit API
- **Endpoint:** `GET https://scrappa.co/api/reddit/search/posts`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `query` | string | Yes | Search text, up to 512 characters. Example: openai. |
| `sort` | string | No | relevance (default), hot, top, new or comments. Example: top. |
| `t` | string | No | Time window: hour, day, week, month, year or all. Items outside the window are never returned. Example: week. |
| `subreddit` | string | No | Only posts of this subreddit, without r/. Example: programming. |
| `nsfw` | boolean | No | true to include adult posts (default false). Example: false. |
| `after` | string | No | Cursor from pagination.next_after of the previous page. Example: t3_1xhv532. |
| `limit` | integer | No | Items per page, 1 to 100 (default 25). Example: 25. |

## Example response

```json
{
    "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

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required parameter or a value is invalid. This response is not billable. |
| 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. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
