# Reddit API (`epctex/reddit-api`) Actor

Reddit data over a simple HTTP API: posts, comments and replies, users, subreddits and the new, hot, top and best feeds. Search by keyword, username, subreddit name or post ID. Always-on Standby Actor with JSON responses in seconds.

- **URL**: https://apify.com/epctex/reddit-api.md
- **Developed by:** [epctex](https://apify.com/epctex) (community)
- **Features:** Limited permissions, Multi-tenant, Server interface
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.70 / 1,000 post details

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Reddit API

Reddit API is an Apify actor that extracts posts, comments, comment replies, users, subreddits and the Reddit post feeds (new, hot, top, best) from Reddit.com by username, subreddit name, post ID or search keyword. It is priced per successful request, from $0.002 to $0.025 depending on the endpoint.

Reddit API exposes 16 endpoints, accepts up to 4 path/query parameters per endpoint, and bills one pay-per-event charge per successful request — the event depends on which endpoint you call — with no subscription and no monthly minimum on paid plans.

### How It Works

Reddit API runs as an [Apify Standby Actor](https://docs.apify.com/platform/actors/running/standby): an always-on HTTP server, not a classic Actor run. There is no run to start and no dataset to poll — you send a plain `GET` request to an endpoint and the JSON comes back in the response itself.

| | Classic dataset Actor | Reddit API (Standby) |
| --- | --- | --- |
| How you call it | Start a run, wait, then read the dataset | One `GET` request |
| Result | Items accumulate in a dataset | JSON in the HTTP response, synchronously |
| Billing | Per run or per dataset item | Per successful request, by endpoint |

Authenticate with your Apify API token as an `Authorization: Bearer <token>` header (the published OpenAPI spec declares bearer authentication). The token is only used to identify and bill the caller — it is **never forwarded** to the upstream Reddit data service.

### Who Uses Reddit API?

- **Brand, social listening and market research teams** search posts by keyword (`/search/post`) and filter by `sort` and `time` range to see what people say about a product or topic.
- **Community and growth teams** look up a subreddit (`/subreddit/{name}`) for fields such as `subscribers` and `activeUserCount`, find related communities with `/search/subreddit`, and read its posts (`/subreddit/{name}/posts`).
- **Trend and content tools** read the `new`, `hot`, `top` and `best` post feeds (`/posts/new`, `/posts/hot`, `/posts/top`, `/posts/best`) to surface what is trending.
- **Creator and user-research tools** pull a user's profile (`/user/{username}`) with karma figures, their posts, their comments, or both interleaved (`/user/{username}/overview`).
- **Moderation and sentiment tools** fetch a post's comments (`/post/{id}/comments`) and drill into a specific comment's replies (`/post/{id}/comments/{commentId}/replies`).
- **AI agents and chatbots** call it directly as a tool: plain JSON over HTTP with a published OpenAPI spec, so no Reddit developer account or OAuth setup is required.

### Endpoints & Parameters

All endpoints are `GET`. Base URL: `https://epctex--reddit-api.apify.actor` — see the note under [Request Example](#request-example).

Listing endpoints (feeds, subreddit posts, user posts, user comments and search) return up to 100 items per page and paginate with an opaque `cursor` taken from the previous response.

#### Users

| Endpoint | Field | Type | Description | Default |
| --- | --- | --- | --- | --- |
| `/search/user` | `keyword` | string | Keyword to search, e.g. `jake` | required |
| | `cursor` | string | Cursor for the pagination | — |
| `/user/{username}` | `username` | string (path) | Username of the user, e.g. `Emitsuu` | required |
| `/user/{username}/posts` | `username` | string (path) | Username of the user | required |
| | `sort` | `new`, `hot`, `top` | Sorting for the user's posts | — |
| | `cursor` | string | Cursor for the pagination | — |
| `/user/{username}/comments` | `username` | string (path) | Username of the user | required |
| | `sort` | `new`, `hot`, `top` | Sorting for the user's comments | — |
| | `cursor` | string | Cursor for the pagination | — |
| `/user/{username}/overview` | `username` | string (path) | Username of the user | required |
| | `sort` | `new`, `hot`, `top` | Sorting for the overview (posts and comments interleaved) | — |
| | `cursor` | string | Cursor for the pagination | — |

#### Subreddits

| Endpoint | Field | Type | Description | Default |
| --- | --- | --- | --- | --- |
| `/search/subreddit` | `keyword` | string | Keyword to search, e.g. `game` | required |
| | `cursor` | string | Cursor for the pagination | — |
| `/subreddit/{name}` | `name` | string (path) | Name of the subreddit, e.g. `game` | required |
| `/subreddit/{name}/posts` | `name` | string (path) | Name of the subreddit | required |
| | `sort` | `new`, `hot`, `top` | Sorting for the list | — |
| | `cursor` | string | Cursor for the pagination | — |

#### Posts

| Endpoint | Field | Type | Description | Default |
| --- | --- | --- | --- | --- |
| `/search/post` | `keyword` | string | Keyword to search, e.g. `game` | required |
| | `sort` | `relevance`, `hot`, `new`, `top`, `comments` | Sorting on the list | — |
| | `time` | `all`, `year`, `month`, `week`, `day`, `hour` | Time range for the results | — |
| | `cursor` | string | Cursor for the pagination | — |
| `/post/{id}` | `id` | string (path) | ID of the post, without the `t3_` prefix, e.g. `1c7tqrd` | required |
| | `includeComments` | `true`, `false` | Return the post's comments alongside it, saving a second request | — |
| `/post/{id}/comments` | `id` | string (path) | ID of the post, without the `t3_` prefix | required |
| | `sort` | `best`, `top`, `new`, `controversial`, `old`, `qa` | Sorting for the list | — |
| `/post/{id}/comments/{commentId}/replies` | `id` | string (path) | ID of the post, without the `t3_` prefix | required |
| | `commentId` | string (path) | Comment ID, e.g. `t1_1c7tqrd` | required |
| | `sort` | `best`, `top`, `new`, `controversial`, `old`, `qa` | Sorting for the list | — |

#### Feeds

| Endpoint | Field | Type | Description | Default |
| --- | --- | --- | --- | --- |
| `/posts/new` | `cursor` | string | Cursor for the pagination | — |
| `/posts/hot` | `cursor` | string | Cursor for the pagination | — |
| `/posts/top` | `cursor` | string | Cursor for the pagination | — |
| `/posts/best` | `cursor` | string | Cursor for the pagination | — |

All `cursor` parameters are optional; omit them to get the first page, and pass the `cursor` from a response back in to get the next one. A value outside a parameter's allowed list is rejected with `400` before it reaches the upstream service.

### Request Example

> **Standby base URL:** Apify Standby actors are reachable at `https://{apify-username}--{actor-name}.apify.actor`. This actor is published under the epctex account, so its Standby base URL is `https://epctex--reddit-api.apify.actor`, used in the examples below.

Get a user's profile:

```bash
curl "https://epctex--reddit-api.apify.actor/user/Emitsuu" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN"
```

Charges `user-profile` on success.

Search posts by keyword, newest first:

```bash
curl -G "https://epctex--reddit-api.apify.actor/search/post" \
  --data-urlencode "keyword=game" \
  --data-urlencode "sort=new" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN"
```

Charges `search-posts` on success.

Get a post's full detail:

```bash
curl "https://epctex--reddit-api.apify.actor/post/1c7tqrd" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN"
```

Charges `post-detail` on success.

### Pricing Model

Reddit API bills one pay-per-event charge per successful request, based on the endpoint called — regardless of how many posts, comments or users the response contains. A request charges only the called endpoint's event, once. The four post feeds (`/posts/new`, `/posts/hot`, `/posts/top`, `/posts/best`) share the `feed-posts` event. Prices range from $0.002 to $0.025.

| Endpoint | Event | Price |
| --- | --- | --- |
| `/search/user` | search-users | $0.025 |
| `/user/{username}` | user-profile | $0.002 |
| `/user/{username}/posts` | user-posts | $0.025 |
| `/user/{username}/comments` | user-comments | $0.025 |
| `/user/{username}/overview` | user-overview | $0.025 |
| `/search/subreddit` | search-subreddits | $0.025 |
| `/subreddit/{name}` | subreddit-detail | $0.002 |
| `/subreddit/{name}/posts` | subreddit-posts | $0.025 |
| `/search/post` | search-posts | $0.025 |
| `/post/{id}` | post-detail | $0.002 |
| `/post/{id}/comments` | post-comments | $0.025 |
| `/post/{id}/comments/{commentId}/replies` | comment-replies | $0.025 |
| `/posts/new` | feed-posts | $0.025 |
| `/posts/hot` | feed-posts | $0.025 |
| `/posts/top` | feed-posts | $0.025 |
| `/posts/best` | feed-posts | $0.025 |

| Status | Meaning | Charged? |
| --- | --- | --- |
| `200` | Successful response, contains `data` | Yes — the called endpoint's event |
| `400` | Bad request — a path or query param failed validation | No |
| `403` | Standby access disabled, or your access was restricted by the developer | No |
| `404` | Endpoint not matched, or nothing found upstream | No |
| `429` | Monthly free-request limit reached | No |
| `502` | Upstream (INFRA) request failed | No |
| `503` | Plan/quota could not be checked right now | No |

#### Cost examples

| Scenario | Requests | Cost |
| --- | --- | --- |
| Look up 1 user profile | 1 | $0.002 |
| Search a keyword, 1 page of posts | 1 | $0.025 |
| Look up 1 post, then 1 page of its comments | 2 | $0.002 + $0.025 = $0.027 |
| Look up a subreddit, then read 3 pages of its posts | 4 | $0.002 + 3 x $0.025 = $0.077 |
| Pull 10 pages of a user's comments | 10 | 10 x $0.025 = $0.25 |
| 1,000 post detail lookups | 1,000 | 1,000 x $0.002 = $2.00 |
| 1,000 keyword-search pages | 1,000 | 1,000 x $0.025 = $25.00 |

**Cost optimization tips:** don't retry on `400`/`403`/`404`/`429` — they're not charged but they also won't succeed on retry without changing the request; cache profile and subreddit lookups you don't expect to change between calls; every list endpoint is billed per page, not per item, so request only the pages you need; use `/post/{id}?includeComments=true` rather than a second request when you want a post's comments alongside it.

#### Demo Mode

Apify Free-plan users can try Reddit API without a subscription, capped at **10 requests per calendar month**. Once that limit is used up, every call answers `429` ("You have used all free requests for this month. Upgrade your Apify plan to keep going.") until the next month. A paid Apify plan removes the monthly cap entirely.

### Output Example

Every successful response wraps its payload as `{ "status": 200, "message": "OK", "data": ... }`.

A single user (`GET /user/{username}`):

```json
{
  "status": 200,
  "message": "OK",
  "data": {
    "type": "user",
    "id": "t2_iyrzi9oh",
    "name": "Popular-Recover8880",
    "createdAt": 1643007193,
    "awarderKarma": 94,
    "postKarma": 94,
    "commentKarma": 94,
    "totalKarma": 94,
    "iconImage": "https://www.redditstatic.com/avatars/defaults/v2/avatar_default_1.png",
    "snoovatarImage": "https://www.redditstatic.com/avatars/defaults/v2/avatar_default_1.png",
    "bannerImage": "https://www.redditstatic.com/avatars/defaults/v2/avatar_default_1.png",
    "title": "Title",
    "description": "Description",
    "hasVerifiedEmail": true,
    "isGold": false,
    "isMod": true,
    "isVerified": true,
    "isEmployee": false,
    "acceptsFollowers": true,
    "over18": true
  }
}
```

A single post (`GET /post/{id}`, shortened):

```json
{
  "status": 200,
  "message": "OK",
  "data": {
    "type": "post",
    "url": "https://www.reddit.com/r/memes/comments/t19inj/ukraine_got_chad_volodymyr_zelensky/",
    "id": "t3_t19inj",
    "title": "This is amazing",
    "text": "Sample text content of the post.",
    "numComments": 2804,
    "created": 1645810297000,
    "score": 229883,
    "upvoteRatio": 0.92,
    "isLocked": false,
    "isStickied": false,
    "isNSFW": false,
    "author": { "username": "I_AM_BATMAN_69", "id": "t2_4e3ddvkn", "isBlocked": false, "isDeleted": false, "authorFlair": "RIF Dev" },
    "subreddit": { "id": "t5_2qjpg", "name": "subreddit" },
    "...": "..."
  }
}
```

A paginated listing, e.g. `GET /search/user` (`cursor`/`results` wrapper used by the search, user, subreddit and comment listings):

```json
{
  "status": 200,
  "message": "OK",
  "data": {
    "cursor": "t2_1c7wuo5",
    "results": [
      { "type": "user", "id": "t2_iyrzi9oh", "name": "Popular-Recover8880", "totalKarma": 94, "...": "..." }
    ]
  }
}
```

The feed endpoints (`/posts/new`, `/posts/hot`, `/posts/top`, `/posts/best`) return `data` as a plain array of posts:

```json
{
  "status": 200,
  "message": "OK",
  "data": [
    { "type": "post", "id": "t3_t19inj", "title": "This is amazing", "score": 229883, "...": "..." }
  ]
}
```

A comment (`GET /post/{id}/comments`, one item of `data.results`, shortened):

```json
{
  "type": "comment",
  "id": "t1_kusnomt",
  "postId": "t3_1bdgjgf",
  "postTitle": "What does a k-hole mean?",
  "body": "Sample comment body text.",
  "score": 0,
  "parentId": "t1_kuo3qvh",
  "depth": 1,
  "hasReplies": true,
  "author": { "username": "GoldenChrysus", "id": "t2_hsofa", "isOP": false },
  "replies": [ { "...": "..." } ]
}
```

A subreddit (`GET /subreddit/{name}`, shortened):

```json
{
  "type": "subreddit",
  "id": "t5_2qhl2",
  "name": "cars",
  "prefixedName": "r/cars",
  "title": "r/Cars - For Car Enthusiasts",
  "subscribers": 94,
  "activeUserCount": 94,
  "url": "https://www.reddit.com/r/cars",
  "...": "..."
}
```

A resource that cannot be found is documented as a `404` with no `data` (not charged):

```json
{ "status": 404, "message": "Not found" }
```

### Limitations

- **Post IDs are passed without the `t3_` prefix** (e.g. `1c7tqrd`), while comment IDs keep theirs (e.g. `t1_1c7tqrd`) and cursors are opaque values such as `t3_1c7wuo5` taken from the previous response.
- **Cursor-based pagination only** — there is no page-number or offset parameter on any list endpoint; follow the `cursor` returned by the previous page.
- **The feed endpoints accept a `cursor` parameter**, but their documented response is a plain array of posts rather than the `cursor`/`results` wrapper, so the response does not document a cursor for the next page.
- **`/post/{id}/comments` can report `truncatedCount`** in its response, a number documented alongside the returned comments.
- **Sort values are limited to the lists above.** User posts, user comments, the user overview and subreddit posts accept `new`, `hot`, `top`; post comments and comment replies accept `best`, `top`, `new`, `controversial`, `old`, `qa`; anything else returns `400`.
- **Per-endpoint pricing, not per-field pricing.** Every endpoint charges a fixed event regardless of how many posts, comments or users a page contains, and each endpoint is billed as its own named event (the four feeds share one), with no volume discount within an endpoint.
- **No endpoint searches comments by keyword.** Search covers users, subreddits and posts.

### Which Reddit API Questions Come Up Most Often?

#### Does Reddit API need a Reddit account or API key?

No. You only need an Apify API token. Reddit API proxies a backend Reddit data service itself; it never asks you to log in to Reddit.

#### How much does it cost?

It costs from $0.002 to $0.025 per successful request, depending on the endpoint: $0.002 for post detail, user profile and subreddit detail, and $0.025 for searches, listings, the user overview, comments, replies and feeds. See the [Pricing Model](#pricing-model) table. Failed, invalid, rejected or not-found responses are never charged, and a request never charges more than one event.

#### Am I charged per post/comment/user, or per request?

Per request. A page with many results costs the same as a page with one for the same endpoint.

#### How do I get more than one page of results?

Pass the `cursor` from the previous response's `data.cursor` field as the `cursor` query parameter on the next call. Each page is a separate, separately-charged request.

#### Can I get a post and its comments in one request?

Yes: `/post/{id}?includeComments=true` returns the post's comments alongside it, saving a second request. It is still a single `post-detail` request.

#### What happens when I hit the free-plan limit?

Every call returns `429` with "You have used all free requests for this month. Upgrade your Apify plan to keep going." until the next calendar month, or until you move to a paid Apify plan.

#### Why did my request return `403`?

Either Standby access isn't available on your current Apify plan, or your access to this Actor has been specifically restricted by its developer.

#### Can I retry a `502` or `503`?

Yes. `502` means the request to the upstream data service failed; `503` means your plan/quota couldn't be checked. Neither is charged, and both are safe to retry after a short delay.

#### Can I use this from an AI agent or bot?

Yes. It's a plain HTTP JSON API with a published OpenAPI spec, so it fits LLM tool calls, bots, backends, and any no-code tool that can make HTTP requests.

### Contact

Reddit API is published by epctex. Visit [epctex.com](https://epctex.com) to see all available products. For custom integrations, reach out through the chat box on epctex.com. For support, contact business@epctex.com.

# Actor input Schema

## Actor input object example

```json
{}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("epctex/reddit-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("epctex/reddit-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call epctex/reddit-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,epctex/reddit-api"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/nIBRiA9CAZRlUP1pZ/builds/uoQu6hvPpVxg795ed/openapi.json
