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

# Reddit Posts API

> Extract Reddit posts from any subreddit, post, user, or feed, with an optional keyword search on top. Posts only (no comment tree).

`POST /v1/data/reddit/posts/run`

**Pricing:** $0.005 per result ($5.00 per 1,000). Every run adds a flat \$0.0005 fee, charged even when nothing is found.

## Request

Send the inputs under `params`. Only the keys below are accepted; any other key returns `422 invalid_params`.

**urls** `string`

Reddit URL to scrape posts from. Accepts a subreddit (r/technology or the full URL), a single post link, a user profile (returns that user's posts), or a listing feed. Leave it empty to search all of Reddit with Search Keyword.

Format e.g. `https://www.reddit.com/r/technology/`.

**keyword** `string`

Optional. A keyword to search Reddit posts for (e.g. 'gpt5'). Use on its own, or add it alongside the URLs above; both run together.

**maxResults** `integer`

Number of posts to return. Use 0 for all.

**sortBy** `string` (default: top)

Sort order for posts.

Allowed values: `top` (Top), `new` (Newest), `hot` (Hot), `relevance` (Relevance), `comments` (Most comments).

**timeRange** `string` (default: all)

Time window for posts. Only applies when Sort By is "Top" (Reddit ignores it for the other sorts). (Preset windows only; no custom date ranges.)

Allowed values: `all` (All time), `year` (Past year), `month` (Past month), `week` (Past week), `day` (Past 24 hours), `hour` (Past hour).

## Example

```bash cURL theme={null}
curl -X POST "https://api.mindcase.co/v1/data/reddit/posts/run?wait=true" \
  -H "Authorization: Bearer $MINDCASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "params": {
    "urls": "https://www.reddit.com/r/technology/",
    "sortBy": "top",
    "maxResults": 25,
    "timeRange": "week"
  }
}'
```

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

r = requests.post(
    "https://api.mindcase.co/v1/data/reddit/posts/run",
    params={"wait": "true"},
    headers={"Authorization": f"Bearer {os.environ['MINDCASE_API_KEY']}"},
    json={"params": {
    "urls": "https://www.reddit.com/r/technology/",
    "sortBy": "top",
    "maxResults": 25,
    "timeRange": "week"
}},
)
job = r.json()
rows = job.get("data", [])  # if job["status"] == "running", poll /v1/jobs/{job_id}/results
```

```javascript Node.js theme={null}
const r = await fetch("https://api.mindcase.co/v1/data/reddit/posts/run?wait=true", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MINDCASE_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ params: {
  "urls": "https://www.reddit.com/r/technology/",
  "sortBy": "top",
  "maxResults": 25,
  "timeRange": "week"
} }),
});
const job = await r.json();
const rows = job.data ?? []; // if job.status === "running", poll /v1/jobs/{job_id}/results
```

## Response fields

Each row in `data` is one result, keyed by these fields.

| Field | Name | Type |
| - | - | - |
| `type` | Type | text |
| `redditUrl` | Reddit URL | url |
| `redditId` | Reddit ID | text |
| `title` | Title | text |
| `body` | Body | text |
| `subreddit` | Subreddit | text |
| `flair` | Flair | text |
| `author` | Author | text |
| `authorFlair` | Author Flair | text |
| `upvotes` | Upvotes | number |
| `upvoteRatio` | Upvote Ratio | number |
| `commentCount` | Comment Count | number |
| `gallery` | Gallery | image |
| `externalLink` | External Link | url |
| `over18` | Over 18 | boolean |
| `posted` | Posted | text |
| `edited` | Edited | text |

## Example response

Abridged: long text and lists are shortened.

```json theme={null}
{
  "job_id": "7f3a1c2e-0b9d-4c55-9a51-3f2e8d1b6a40",
  "agent": "reddit/posts",
  "status": "completed",
  "row_count": 1,
  "truncated": false,
  "data": [
    {
      "redditId": "t3_1vq1845",
      "author": "marketrent",
      "upvotes": 17603,
      "commentCount": 1366,
      "gallery": [],
      "flair": "Society",
      "over18": false,
      "posted": "2026-08-16T16:17:34Z",
      "edited": null,
      "subreddit": "technology",
      "upvoteRatio": 0.94,
      "redditUrl": "https://www.reddit.com/r/technology/comments/1vq1845/bernie_sanders_calls_out_sergey_brin_for_spending/",
      "body": null,
      "externalLink": "https://www.yahoo.com/news/politics/articles/bernie-sanders-calls-sergey-brin-120113695.html",
      "authorFlair": null,
      "title": "Bernie Sanders calls out Sergey Brin for spending over $100 million to defeat California’s billionaire tax — ‘If California passes its one-time 5% wealth tax...",
      "type": "Post"
    }
  ]
}
```

## Related APIs

For the comment thread use [`reddit/comments`](https://docs.mindcase.co/apis/reddit/comments); for a user's karma and bio use [`reddit/profiles`](https://docs.mindcase.co/apis/reddit/profiles).


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