# Reddit App Post Comments API

> Returns comment trees for a specific Reddit post by its ID. Supports comment sorting by hot, new, top, best, or controversial, with optional pagination via a cursor.

Source: https://www.sandbase.ai/apis/reddit/app/post-comments
API reference: https://www.sandbase.ai/apis/reddit/app/post-comments/docs

## Facts

- Provider: Reddit
- Type: Data API
- Endpoint: `POST https://api.sandbase.ai/v1/api/reddit/app/post-comments`
- Price: $0.0015 per call
- Free allowance: 100 calls per organization per UTC day, shared across eligible APIs
- Capabilities: api, reddit
- Billing: pay per use from one SandBase balance; no provider account or subscription needed

## Call it

`POST https://api.sandbase.ai/v1/api/reddit/app/post-comments` with `Authorization: Bearer $SANDBASE_API_KEY` and the parameters as a JSON body.

| Parameter | Type | Required | Allowed values |
| --- | --- | --- | --- |
| `post_id` | string | yes |  |
| `after` | string | no |  |
| `need_format` | boolean | no |  |
| `sort_type` | string | no |  |

## FAQ

### How do I use the Reddit App Post Comments API?

Send a POST request to https://api.sandbase.ai/v1/api/reddit/app/post-comments with your SandBase API key in the Authorization header (Bearer) and the parameters as a JSON body. You can also try it in the Playground on this page without writing code.

### How much does the Reddit App Post Comments API cost?

$0.0015 per call. Every organization gets 100 free calls per UTC day, shared across eligible SandBase APIs including this one; after that each call is billed at this price from your SandBase balance. There is no subscription.

### What parameters does the Reddit App Post Comments API accept?

Required: post_id (string). Optional: after (string), need_format (boolean) and sort_type (string). The Parameters table and the Playground on this page list every field.

### What does the Reddit App Post Comments API return?

A JSON response returned in the same HTTP request (synchronous).

### Do I need a Reddit developer account or API key?

No. Reddit App Post Comments runs through SandBase, so one SandBase API key covers this endpoint and every other API and model in the catalog. You do not need to apply for Reddit API access separately.

## README

### Reddit App Post Comments API

Retrieve discussion comments for a Reddit submission using `post_id`. Configure comment order with `sort_type` and page through comment trees using `after`.

#### Use cases

- Retrieve top discussion threads and reply trees under a Reddit submission.
- Analyze audience sentiment and reactions across community discussions.
- Extract recent community feedback by sorting comments by new.

#### Request

```bash
curl -X POST "https://api.sandbase.ai/v1/api/reddit/app/post-comments" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"post_id": "t3_1ojnvca"}'
```

#### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `post_id` | string | Yes | Post ID, format like "t3_XXXXXX" |
| `after` | string | No | Pagination parameter for fetching the next page, can be found in the last comment node in commentForest, e.g., $.data.postInfoById.commentForest.trees[-1].more… |
| `sort_type` | string | No | Sort method, supports HOT, NEW, TOP, BEST, CONTROVERSIAL |
| `need_format` | boolean | No | Whether to clean and format the data |

#### Notes

- `post_id` expects an identifier formatted like t3_XXXXXX.
- Supported `sort_type` options include HOT, NEW, TOP, BEST, and CONTROVERSIAL.
- Pagination uses the `after` cursor obtained from the last comment node in the comment forest.

#### Related APIs

- [Reddit Subreddit Mute Status](/model/reddit/app/check-subreddit-muted): Checks whether a specified Reddit subreddit is muted by the current account using its ID.
- [Reddit App Comment Replies](/model/reddit/app/comment-replies): Returns replies and nested sub-comments under a Reddit post comment using a continuation cursor.
- [Reddit Community Highlights](/model/reddit/app/community-highlights): Returns featured highlight content for a designated Reddit community, such as popular posts and announcements, by subreddit ID.
