# Reddit API
> Real-time Reddit data as an API — subreddits, posts, comments, user profiles and search, returned as clean JSON. Pull a subreddit's info and its hot, new, top or rising posts; fetch a post together with its full comment tree; look up any user's profile, karma, submissions and comments; search posts across all of Reddit or within one subreddit; and list the trending posts and the most popular subreddits. Live data, paginated with Reddit cursors, with scores, upvote ratios, comment counts, flair, timestamps, thumbnails and media URLs. Ideal for social listening and brand monitoring, trend and sentiment dashboards, content aggregation, research and market intelligence, and bots. 11 data endpoints. Authenticated with an x-oanor-key; fair-use rate limits per plan.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/reddit-api/..."
```

## Pricing
- **Free** (Free) — 500 calls/Mo, 3 req/s
- **Starter** ($10/Mo) — 20,000 calls/Mo, 10 req/s
- **Pro** ($39/Mo) — 120,000 calls/Mo, 25 req/s
- **Mega** ($129/Mo) — 600,000 calls/Mo, 60 req/s

## Endpoints

### Subreddit

#### `GET /v1/subreddit/about` — Subreddit info

**Parameters:**
- `subreddit` (query, required, string) — Subreddit name (without r/) Example: `programming`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/reddit-api/v1/subreddit/about?subreddit=programming"
```

#### `GET /v1/subreddit/posts` — Subreddit posts

**Parameters:**
- `subreddit` (query, required, string) — Subreddit name Example: `worldnews`
- `sort` (query, optional, string) — hot, new, top, rising Example: `hot`
- `time` (query, optional, string) — For top: hour/day/week/month/year/all Example: `day`
- `limit` (query, optional, string) — Max posts (1–100) Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/reddit-api/v1/subreddit/posts?subreddit=worldnews&sort=hot&time=day&limit=10"
```

#### `GET /v1/subreddit/rules` — Subreddit rules

**Parameters:**
- `subreddit` (query, required, string) — Subreddit name Example: `AskReddit`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/reddit-api/v1/subreddit/rules?subreddit=AskReddit"
```

### Posts

#### `GET /v1/post/comments` — Post with comments

**Parameters:**
- `subreddit` (query, required, string) — Subreddit name Example: `IAmA`
- `post_id` (query, required, string) — Post id (base36) Example: `z1c9z`
- `limit` (query, optional, string) — Max comments Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/reddit-api/v1/post/comments?subreddit=IAmA&post_id=z1c9z&limit=10"
```

### Users

#### `GET /v1/user/about` — User profile

**Parameters:**
- `username` (query, required, string) — Reddit username (without u/) Example: `spez`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/reddit-api/v1/user/about?username=spez"
```

#### `GET /v1/user/comments` — User comments

**Parameters:**
- `username` (query, required, string) — Reddit username Example: `spez`
- `limit` (query, optional, string) — Max comments Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/reddit-api/v1/user/comments?username=spez&limit=10"
```

#### `GET /v1/user/posts` — User submissions

**Parameters:**
- `username` (query, required, string) — Reddit username Example: `spez`
- `sort` (query, optional, string) — new, hot, top Example: `new`
- `limit` (query, optional, string) — Max posts Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/reddit-api/v1/user/posts?username=spez&sort=new&limit=10"
```

### Search

#### `GET /v1/search/posts` — Search posts

**Parameters:**
- `query` (query, required, string) — Search query Example: `chatgpt`
- `subreddit` (query, optional, string) — Restrict to a subreddit
- `sort` (query, optional, string) — relevance, hot, top, new, comments Example: `relevance`
- `time` (query, optional, string) — hour/day/week/month/year/all Example: `all`
- `limit` (query, optional, string) — Max posts Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/reddit-api/v1/search/posts?query=chatgpt&sort=relevance&time=all&limit=10"
```

#### `GET /v1/search/subreddits` — Search subreddits

**Parameters:**
- `query` (query, required, string) — Search query Example: `python`
- `limit` (query, optional, string) — Max subreddits Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/reddit-api/v1/search/subreddits?query=python&limit=10"
```

### Popular

#### `GET /v1/popular/posts` — Trending posts

**Parameters:**
- `limit` (query, optional, string) — Max posts Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/reddit-api/v1/popular/posts?limit=10"
```

#### `GET /v1/popular/subreddits` — Popular subreddits

**Parameters:**
- `limit` (query, optional, string) — Max subreddits Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/reddit-api/v1/popular/subreddits?limit=10"
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/reddit-api/v1/meta"
```


---
Marketplace page: https://www.oanor.com/api/reddit-api
OpenAPI spec: https://www.oanor.com/api/reddit-api/openapi.json
