# Reddit User Posts API

> Returns a list of posts submitted by a specified Reddit user. Results can be sorted by new, top, hot, or controversial order with optional formatting.

Source: https://www.sandbase.ai/model/reddit/app/user-posts
API reference: https://www.sandbase.ai/model/reddit/app/user-posts/docs

## Facts

- Provider: Reddit
- Type: Data API
- Endpoint: `POST https://api.sandbase.ai/v1/api/reddit/app/user-posts`
- 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/user-posts` with `Authorization: Bearer $SANDBASE_API_KEY` and the parameters as a JSON body.

| Parameter | Type | Required | Allowed values |
| --- | --- | --- | --- |
| `username` | string | yes |  |
| `after` | string | no |  |
| `need_format` | boolean | no |  |
| `sort` | string | no |  |

## FAQ

### How do I use the Reddit User Posts API?

Send a POST request to https://api.sandbase.ai/v1/api/reddit/app/user-posts 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 User Posts 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 User Posts API accept?

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

### What does the Reddit User Posts API return?

A JSON response returned in the same HTTP request (synchronous). The README on this page includes a sample response.

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

No. Reddit User Posts 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 User Posts API

Retrieve submissions submitted by a specific account using the `username` parameter, with support for custom sort orders and pagination.

#### Use cases

- Analyze submission history and activity for a Reddit account.
- Display a profile feed of posts submitted by an author.
- Track top-rated or controversial submissions from specific users.

#### Request

```bash
curl -X POST "https://api.sandbase.ai/v1/api/reddit/app/user-posts" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"username": "spez"}'
```

#### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `username` | string | Yes | Reddit username |
| `sort` | string | No | Sort method, options: NEW (newest), TOP (top rated), HOT (hot), CONTROVERSIAL (controversial) |
| `after` | string | No | Pagination parameter for fetching next page |
| `need_format` | boolean | No | Whether to clean and format the data |

#### Example response

Real response for the request above, trimmed to the main fields. User names and long IDs are masked.

```json
{
  "postFeed": {
    "elements": {
      "edges": [
        {
          "node": {
            "__typename": "ProfilePost",
            "commentCount": 473,
            "id": "t3_1vgbkge",
            "isScoreHidden": false,
            "permalink": "/user/spez/comments/1vgbkge/modernizing_reddits_infrastructure_with_you/",
            "postTitle": "Modernizing Reddit’s infrastructure with you"
          }
        }
      ]
    }
  }
}
```

#### Notes

- `sort` options include NEW, TOP, HOT, and CONTROVERSIAL.
- Use `after` to retrieve the next page of user submissions.
- Set `need_format` to true to clean and format the output data.

#### 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.
