> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stophy.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Reddit search

> Read a Reddit search page with a q query as JSON with the reddit-search parser. $1 per 1,000 calls. Send the page to scrape.

Reads a Reddit search page with a q query, on reddit.com/search or inside a subreddit, and returns a list of posts as JSON.

## Make a request

Send the page's URL to [scrape](https://docs.stophy.dev/api-reference/endpoint/scrape.md) with a `json` format that names the parser. This parser works without an API key when you send no options, up to 10 calls a minute and 50 calls a day per IP address. See [Rate limits](https://docs.stophy.dev/production/rate-limits.md). To lift the limits, get an API key in the [Quickstart](https://docs.stophy.dev/quickstart).

```bash cURL theme={null}
curl -X POST https://api.stophy.dev/v1/scrape \
  -H "Authorization: Bearer $STOPHY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.reddit.com/search/?q=web+scraping&sort=top&t=year","formats":[{"type":"json","parser":"reddit-search"}]}'
```

```typescript TypeScript theme={null}
const response = await fetch("https://api.stophy.dev/v1/scrape", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.STOPHY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    url: "https://www.reddit.com/search/?q=web+scraping&sort=top&t=year",
    formats: [{ type: "json", parser: "reddit-search" }],
  }),
});
console.log(await response.json());
```

```python Python theme={null}
import os

import requests

response = requests.post(
    "https://api.stophy.dev/v1/scrape",
    headers={"Authorization": f"Bearer {os.environ['STOPHY_API_KEY']}"},
    json={
        "url": "https://www.reddit.com/search/?q=web+scraping&sort=top&t=year",
        "formats": [{"type": "json", "parser": "reddit-search"}],
    },
)
print(response.json())
```

## Read the response

The parser's data is in `data.json`. Its fields include `results`, `cursor`, `page` and `total`. This real response is cut to the first items.

```json theme={null}
{
  "success": true,
  "data": {
    "json": {
      "results": [
        {
          "id": "1vmwcb7",
          "url": "https://www.reddit.com/r/InterstellarKinetics/comments/1vmwcb7/breaking_trump_is_being_sued_by_the_intercept/",
          "title": "BREAKING: Trump Is Being Sued By The Intercept & Freedom Of The Press Foundation Over “Brazen” Scheme Charging Up To…",
          "text": "President Trump is being sued by nonprofit news groups The Intercept and the Freedom of the Press Foundation over…",
          "author": {
            "id": "0",
            "name": null,
            "handle": "example_user",
            "url": "https://example.com/example_user",
            "avatarUrl": null,
            "isVerified": null
          },
          "community": {
            "name": "InterstellarKinetics",
            "url": "https://www.reddit.com/r/InterstellarKinetics/"
          },
          "publishedAt": "2026-08-13T01:02:48.590Z",
          "likes": 5481,
          "comments": 59,
          "shares": null,
          "views": null,
          "media": [],
          "hashtags": [],
          "score": 5481,
          "upvotePercent": 99.4,
          "flair": "FINANCIAL FRONTIERS",
          "linkUrl": "https://arstechnica.com/tech-policy/2026/08/trump-sued-over-brazen-scheme-to-sell-truth-social-api-access-for-100k-a-mo…",
          "thumbnailUrl": "https://external-preview.redd.it/zQG3SjQ_AvJknEM2xFLmeX-acdp5CN8PUgwKe9A2X5s.jpeg?auto=webp&s=248d4f38ccc72103e0c836158…",
          "isNsfw": false,
          "isVideo": false,
          "isPinned": false,
          "videoHlsUrl": null,
          "videoDurationSeconds": null,
          "pollOptions": [],
          "pollTotalVotes": null,
          "pollEndsAt": null,
          "repostOfUrl": null
        }
      ],
      "cursor": "MjQ=",
      "page": null,
      "total": null
    },
    "metadata": {
      "sourceURL": "https://www.reddit.com/search/?q=web+scraping&sort=top&t=year",
      "url": "https://www.reddit.com/search/?q=web+scraping&sort=top&t=year",
      "statusCode": 200,
      "contentType": "application/json",
      "cacheState": "hit",
      "cachedAt": "2026-11-17T17:53:24.463Z",
      "scrapeId": "43e8aa9e-e4f3-443d-99cf-570cd13b6e0e",
      "creditsUsed": 1,
      "costUsd": 0.001
    }
  },
  "id": "43e8aa9e-e4f3-443d-99cf-570cd13b6e0e",
  "costUsd": 0.001,
  "creditsUsed": 1,
  "requestId": "43e8aa9e-e4f3-443d-99cf-570cd13b6e0e"
}
```

## Options

Send options in the `options` object of the `json` format.

| Option | What it does |
| - | - |
| `cursor` | The cursor from the previous response. Send it as is. |

It also takes `subreddit`.

## Price

\$1 per 1,000 calls. Works without an API key, within the free limits. See [Pricing](https://docs.stophy.dev/account/pricing.md).

## Limits and errors

* The URL must be a Reddit search page with a q query, on reddit.com/search or inside a subreddit. Add type=sr to the page for communities or type=user for people. Any other URL fails with `invalidRequest`.
* To read the next page, send the `cursor` from the response as the `cursor` option. Paging needs an API key.
* The answer comes back in `data.json`. If the page cannot be read, the call fails with an error code from [Errors](https://docs.stophy.dev/api-reference/errors.md).

## Related

* [Pre-built parsers](https://docs.stophy.dev/scrape/prebuilt-parsers) lists every parser.
* [Scrape](https://docs.stophy.dev/scrape/overview) has the options every scrape takes.
* [Reddit post](https://docs.stophy.dev/scrape/prebuilt-parsers/social/reddit-post.md)
* [Reddit subreddit](https://docs.stophy.dev/scrape/prebuilt-parsers/social/reddit-subreddit.md)
* [Reddit user](https://docs.stophy.dev/scrape/prebuilt-parsers/social/reddit-user.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.