> ## 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 Comments API

> Extract every comment from a Reddit post: the full threaded discussion flattened to one row per comment, at any reply depth.

`POST /v1/data/reddit/comments/run`

**Pricing:** $0.005 per result ($5.00 per 1,000).

## Ways to call it

* **Post URL**: set `inputs`
* **Comment search**: set `subreddit`, `keyword` (optional: `maxResults`)

## Request

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

**inputs** `string`

Reddit post URL to fetch comments from (e.g. [https://www.reddit.com/r/technology/comments/1ub7r1y/](https://www.reddit.com/r/technology/comments/1ub7r1y/)...).

Format e.g. `https://www.reddit.com/r/technology/comments/1ub7r1y/morale_is_so_bad_at_mark_zuckerbergs_meta_even/`.

**maxResults** `integer`

Number of comments to return. Use 0 for all.

**includeComments** `boolean` (default: true)

Fetch the comment tree for each post. On by default for this agent.

**subreddit** `string[]`

Communities to search inside: a name (technology), r/name or the full URL. Reddit has no global comment index, so at least one is required.

**keyword** `string`

Text that must actually appear in the comment. Unlike the post search, every row returned genuinely contains it.

## Example

```bash cURL theme={null}
curl -X POST "https://api.mindcase.co/v1/data/reddit/comments/run?wait=true" \
  -H "Authorization: Bearer $MINDCASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "params": {
    "inputs": "https://www.reddit.com/r/technology/comments/1ub7r1y/morale_is_so_bad_at_mark_zuckerbergs_meta_even/",
    "maxResults": 50,
    "includeComments": true
  }
}'
```

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

r = requests.post(
    "https://api.mindcase.co/v1/data/reddit/comments/run",
    params={"wait": "true"},
    headers={"Authorization": f"Bearer {os.environ['MINDCASE_API_KEY']}"},
    json={"params": {
    "inputs": "https://www.reddit.com/r/technology/comments/1ub7r1y/morale_is_so_bad_at_mark_zuckerbergs_meta_even/",
    "maxResults": 50,
    "includeComments": True
}},
)
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/comments/run?wait=true", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MINDCASE_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ params: {
  "inputs": "https://www.reddit.com/r/technology/comments/1ub7r1y/morale_is_so_bad_at_mark_zuckerbergs_meta_even/",
  "maxResults": 50,
  "includeComments": true
} }),
});
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 |
| - | - | - |
| `commentUrl` | Comment URL | url |
| `commentId` | Comment ID | text |
| `comment` | Comment | text |
| `depth` | Depth | number |
| `author` | Author | text |
| `authorFlair` | Author Flair | text |
| `isOp` | Is OP | boolean |
| `upvotes` | Upvotes | number |
| `posted` | Posted | text |
| `edited` | Edited | text |
| `parentId` | Parent ID | text |
| `postId` | Post ID | text |
| `postUrl` | Post URL | url |
| `post` | Post | object |
| `subreddit` | Subreddit | text |

## Example response

Abridged: long text and lists are shortened.

```json theme={null}
{
  "job_id": "7f3a1c2e-0b9d-4c55-9a51-3f2e8d1b6a40",
  "agent": "reddit/comments",
  "status": "completed",
  "row_count": 1,
  "truncated": false,
  "data": [
    {
      "depth": 0,
      "author": "Prudent_Link6029",
      "upvotes": 9588,
      "parentId": "t3_1ub7r1y",
      "comment": " Virtual pizza in the metaverse should boost morale ",
      "commentId": "osu11ky",
      "posted": "2026-06-20T21:22:58Z",
      "post": {
        "Title": "Morale is so bad at Mark Zuckerberg's Meta even the company's own CTO admits it's 'probably the worst it's ever been'",
        "Author": "lurker_bee",
        "Upvotes": 35664,
        "Upvote Ratio": 0.97,
        "Subreddit": "technology",
        "Flair": "Business",
        "Body": null,
        "Comments": 1623,
        "URL": "https://www.reddit.com/r/technology/comments/1ub7r1y/morale_is_so_bad_at_mark_zuckerbergs_meta_even/",
        "Posted": "2026-06-20T21:15:05Z"
      },
      "isOp": false,
      "edited": null,
      "commentUrl": "https://www.reddit.com/r/technology/comments/1ub7r1y/morale_is_so_bad_at_mark_zuckerbergs_meta_even/osu11ky/",
      "postUrl": "https://www.reddit.com/r/technology/comments/1ub7r1y/morale_is_so_bad_at_mark_zuckerbergs_meta_even/",
      "subreddit": "technology",
      "authorFlair": null,
      "postId": "t3_1ub7r1y"
    }
  ]
}
```

## Related APIs

For the posts use [`reddit/posts`](https://docs.mindcase.co/apis/reddit/posts).


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