API
Every Reddit comment.
One HTTP call.
A simple Reddit comments API — send a thread URL, get a clean JSON tree with every comment, hierarchy preserved and "more replies" auto-expanded. Pro plans include 100 thread exports per month. cURL, JavaScript, Python, PHP, Go, and Java samples below.
No OAuth dance. No per-call price math. No comment forests to flatten yourself. If you'd rather not write a programmatic integration at all, the Chrome extension does the same job in one click on any Reddit page you have open.
Base URL
https://api.redditcommentexporter.com
Quota
100 / month
resets on the 1st UTC
Per export
5,000 cmts max
larger threads return truncated: true
Authentication
Generate a key on the . Plaintext is shown exactly once at creation. Pass it on every request:
Authorization: Bearer rce_live_<YOUR_KEY> Treat keys like passwords — keep them on a server you control, never ship them in client-side code. If a key leaks, revoke it immediately and create a new one.
Fetch thread comments
POST/v1/api/comments
Pulls every comment from a Reddit post — including nested replies and comments behind "load more" — and returns them as a recursive tree. Counts as one export against your monthly quota regardless of thread size.
Request body
-
urlrequired A reddit.com post URL.old.reddit.com,np.reddit.com, andwww.reddit.comvariants are all accepted. -
maxCommentsoptional Cap the number of comments returned. Defaults to 5,000, which is also the hard ceiling.
curl -X POST https://api.redditcommentexporter.com/v1/api/comments \
-H "Authorization: Bearer $RCE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.reddit.com/r/AskReddit/comments/abc123/example/"
}' const res = await fetch("https://api.redditcommentexporter.com/v1/api/comments", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.RCE_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
url: "https://www.reddit.com/r/AskReddit/comments/abc123/example/",
}),
});
const data = await res.json();
console.log(`Pulled ${data.meta.comments_returned} comments`); import os
import requests
resp = requests.post(
"https://api.redditcommentexporter.com/v1/api/comments",
headers={"Authorization": f"Bearer {os.environ['RCE_API_KEY']}"},
json={"url": "https://www.reddit.com/r/AskReddit/comments/abc123/example/"},
)
resp.raise_for_status()
data = resp.json()
print(f"Pulled {data['meta']['comments_returned']} comments") <?php
$ch = curl_init('https://api.redditcommentexporter.com/v1/api/comments');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RCE_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://www.reddit.com/r/AskReddit/comments/abc123/example/',
]),
]);
$res = curl_exec($ch);
$data = json_decode($res, true);
echo "Pulled {$data['meta']['comments_returned']} comments\n"; package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"os"
)
func main() {
body, _ := json.Marshal(map[string]string{
"url": "https://www.reddit.com/r/AskReddit/comments/abc123/example/",
})
req, _ := http.NewRequest("POST",
"https://api.redditcommentexporter.com/v1/api/comments",
bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("RCE_API_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
var out struct {
Meta struct {
CommentsReturned int `json:"comments_returned"`
} `json:"meta"`
}
json.NewDecoder(resp.Body).Decode(&out)
fmt.Printf("Pulled %d comments\n", out.Meta.CommentsReturned)
} import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class App {
public static void main(String[] args) throws Exception {
String body = """
{"url": "https://www.reddit.com/r/AskReddit/comments/abc123/example/"}
""";
HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://api.redditcommentexporter.com/v1/api/comments"))
.header("Authorization", "Bearer " + System.getenv("RCE_API_KEY"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> res = HttpClient.newHttpClient()
.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
}
} {
"post": {
"id": "abc123",
"title": "Example post title",
"author": "exampleuser",
"subreddit": "AskReddit",
"score": 12400,
"upvote_ratio": 0.94,
"num_comments": 832,
"created_utc": 1704067200,
"permalink": "/r/AskReddit/comments/abc123/example/",
"url": "https://www.reddit.com/r/AskReddit/comments/abc123/example/",
"selftext": ""
},
"comments": [
{
"id": "ed1czme",
"author": "sweatybeard",
"body": "Comment body text…",
"score": 12211,
"created_utc": 1546378524,
"parent_id": "t3_abc123",
"permalink": "/r/AskReddit/comments/abc123/example/ed1czme/",
"depth": 0,
"replies": []
}
],
"meta": {
"comments_returned": 832,
"truncated": false,
"upstream_calls": 4
},
"usage": {
"used": 12,
"limit": 100,
"monthKey": "2026-05",
"resetsAt": "2026-06-01T00:00:00.000Z"
}
}
Each comment carries an id, author,
body, score,
created_utc (Unix seconds), parent_id,
permalink, depth
(0 = top-level), and a replies array with the same shape.
Every X-RateLimit-* header on the response mirrors the values inside usage.
List your saved threads
GET/v1/api/threads
GET/v1/api/threads/{id}
Read-only access to threads you've saved through the extension. The list endpoint returns metadata; the detail endpoint returns the full payload. Does not count against your export quota.
curl https://api.redditcommentexporter.com/v1/api/threads \
-H "Authorization: Bearer $RCE_API_KEY" const res = await fetch("https://api.redditcommentexporter.com/v1/api/threads", {
headers: { "Authorization": `Bearer ${process.env.RCE_API_KEY}` },
});
const { threads } = await res.json(); import os, requests
resp = requests.get(
"https://api.redditcommentexporter.com/v1/api/threads",
headers={"Authorization": f"Bearer {os.environ['RCE_API_KEY']}"},
)
threads = resp.json()["threads"] <?php
$ch = curl_init('https://api.redditcommentexporter.com/v1/api/threads');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RCE_API_KEY'),
],
]);
$res = curl_exec($ch);
$threads = json_decode($res, true)['threads']; req, _ := http.NewRequest("GET",
"https://api.redditcommentexporter.com/v1/api/threads", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("RCE_API_KEY"))
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close() HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://api.redditcommentexporter.com/v1/api/threads"))
.header("Authorization", "Bearer " + System.getenv("RCE_API_KEY"))
.GET()
.build();
HttpResponse<String> res = HttpClient.newHttpClient()
.send(req, HttpResponse.BodyHandlers.ofString()); Errors
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_reddit_url | URL is missing or doesn't look like a Reddit post. |
| 401 | missing_api_key / invalid_api_key | Header missing, malformed, or the key has been revoked. |
| 403 | pro_plan_required | The key's owner is no longer on a Pro plan. |
| 404 | not_found | Thread ID doesn't match a saved thread of yours. |
| 429 | monthly_limit | Exhausted your monthly export quota. Resets on the 1st UTC. |
| 503 | upstream_busy | Transient — retry with exponential backoff. |
Need a higher quota or a use case the API doesn't cover yet? Email hello@redditcommentexporter.com.
# Reddit Comment Exporter API Base URL: `https://api.redditcommentexporter.com` Quota: 100 thread exports per month (resets on the 1st UTC). Hard cap of 5,000 comments per export. ## Authentication Generate an API key on the API keys tab at https://redditcommentexporter.com/api#keys. The plaintext is shown exactly once at creation and should be stored in a secrets manager. Pass the key on every request via an `Authorization` header: ```http Authorization: Bearer rce_live_<YOUR_KEY> ``` If a key leaks, revoke it immediately and generate a new one. Never ship API keys in client-side code.
# Reddit Comment Exporter API
Base URL: `https://api.redditcommentexporter.com`
Quota: 100 thread exports per month (resets on the 1st UTC). Hard cap of 5,000 comments per export.
## POST /v1/api/comments — Fetch thread comments
Pulls every comment from a Reddit post — including nested replies and comments behind "load more" — and returns them as a recursive tree. Counts as one export against your monthly quota regardless of thread size.
### Request body
- `url` (required) — A reddit.com post URL. `old.reddit.com`, `np.reddit.com`, and `www.reddit.com` variants are accepted.
- `maxComments` (optional) — Cap the number of comments returned. Defaults to 5,000, which is also the hard ceiling. Larger threads return the first 5,000 with `truncated: true`.
### Code examples
### cURL
```bash
curl -X POST https://api.redditcommentexporter.com/v1/api/comments \
-H "Authorization: Bearer $RCE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.reddit.com/r/AskReddit/comments/abc123/example/"
}'
```
### JavaScript
```javascript
const res = await fetch("https://api.redditcommentexporter.com/v1/api/comments", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.RCE_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
url: "https://www.reddit.com/r/AskReddit/comments/abc123/example/",
}),
});
const data = await res.json();
console.log(`Pulled ${data.meta.comments_returned} comments`);
```
### Python
```python
import os
import requests
resp = requests.post(
"https://api.redditcommentexporter.com/v1/api/comments",
headers={"Authorization": f"Bearer {os.environ['RCE_API_KEY']}"},
json={"url": "https://www.reddit.com/r/AskReddit/comments/abc123/example/"},
)
resp.raise_for_status()
data = resp.json()
print(f"Pulled {data['meta']['comments_returned']} comments")
```
### PHP
```php
<?php
$ch = curl_init('https://api.redditcommentexporter.com/v1/api/comments');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RCE_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://www.reddit.com/r/AskReddit/comments/abc123/example/',
]),
]);
$res = curl_exec($ch);
$data = json_decode($res, true);
echo "Pulled {$data['meta']['comments_returned']} comments\n";
```
### Go
```go
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"os"
)
func main() {
body, _ := json.Marshal(map[string]string{
"url": "https://www.reddit.com/r/AskReddit/comments/abc123/example/",
})
req, _ := http.NewRequest("POST",
"https://api.redditcommentexporter.com/v1/api/comments",
bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("RCE_API_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
var out struct {
Meta struct {
CommentsReturned int `json:"comments_returned"`
} `json:"meta"`
}
json.NewDecoder(resp.Body).Decode(&out)
fmt.Printf("Pulled %d comments\n", out.Meta.CommentsReturned)
}
```
### Java
```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class App {
public static void main(String[] args) throws Exception {
String body = """
{"url": "https://www.reddit.com/r/AskReddit/comments/abc123/example/"}
""";
HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://api.redditcommentexporter.com/v1/api/comments"))
.header("Authorization", "Bearer " + System.getenv("RCE_API_KEY"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> res = HttpClient.newHttpClient()
.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
}
}
```
### Response (200 OK)
```json
{
"post": {
"id": "abc123",
"title": "Example post title",
"author": "exampleuser",
"subreddit": "AskReddit",
"score": 12400,
"upvote_ratio": 0.94,
"num_comments": 832,
"created_utc": 1704067200,
"permalink": "/r/AskReddit/comments/abc123/example/",
"url": "https://www.reddit.com/r/AskReddit/comments/abc123/example/",
"selftext": ""
},
"comments": [
{
"id": "ed1czme",
"author": "sweatybeard",
"body": "Comment body text…",
"score": 12211,
"created_utc": 1546378524,
"parent_id": "t3_abc123",
"permalink": "/r/AskReddit/comments/abc123/example/ed1czme/",
"depth": 0,
"replies": []
}
],
"meta": {
"comments_returned": 832,
"truncated": false,
"upstream_calls": 4
},
"usage": {
"used": 12,
"limit": 100,
"monthKey": "2026-05",
"resetsAt": "2026-06-01T00:00:00.000Z"
}
}
```
Each comment carries: `id`, `author`, `body`, `score`, `created_utc` (Unix seconds), `parent_id`, `permalink`, `depth` (0 = top-level), and a `replies` array with the same shape. `X-RateLimit-*` response headers mirror the values inside `usage`.
# Reddit Comment Exporter API
Base URL: `https://api.redditcommentexporter.com`
Quota: 100 thread exports per month (resets on the 1st UTC). Hard cap of 5,000 comments per export.
## GET /v1/api/threads — List your saved threads
Read-only access to threads you've saved through the Chrome extension. The list endpoint returns metadata; the detail endpoint (`GET /v1/api/threads/{id}`) returns the full payload. Does **not** count against your export quota.
### Code examples
### cURL
```bash
curl https://api.redditcommentexporter.com/v1/api/threads \
-H "Authorization: Bearer $RCE_API_KEY"
```
### JavaScript
```javascript
const res = await fetch("https://api.redditcommentexporter.com/v1/api/threads", {
headers: { "Authorization": `Bearer ${process.env.RCE_API_KEY}` },
});
const { threads } = await res.json();
```
### Python
```python
import os, requests
resp = requests.get(
"https://api.redditcommentexporter.com/v1/api/threads",
headers={"Authorization": f"Bearer {os.environ['RCE_API_KEY']}"},
)
threads = resp.json()["threads"]
```
### PHP
```php
<?php
$ch = curl_init('https://api.redditcommentexporter.com/v1/api/threads');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RCE_API_KEY'),
],
]);
$res = curl_exec($ch);
$threads = json_decode($res, true)['threads'];
```
### Go
```go
req, _ := http.NewRequest("GET",
"https://api.redditcommentexporter.com/v1/api/threads", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("RCE_API_KEY"))
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
```
### Java
```java
HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://api.redditcommentexporter.com/v1/api/threads"))
.header("Authorization", "Bearer " + System.getenv("RCE_API_KEY"))
.GET()
.build();
HttpResponse<String> res = HttpClient.newHttpClient()
.send(req, HttpResponse.BodyHandlers.ofString());
```
### Response shape (list)
```json
{
"threads": [
{
"id": "uuid",
"postId": "abc123",
"postUrl": "https://www.reddit.com/r/.../comments/abc123/...",
"postTitle": "...",
"subreddit": "...",
"commentCount": 832,
"savedAt": "2026-05-06T12:00:00.000Z"
}
]
}
```
# Reddit Comment Exporter API
Base URL: `https://api.redditcommentexporter.com`
Quota: 100 thread exports per month (resets on the 1st UTC). Hard cap of 5,000 comments per export.
## Errors
All error responses are JSON of the shape `{"error": "<code>"}`.
| Status | Code | Meaning |
|---|---|---|
| 400 | `invalid_reddit_url` | URL is missing or doesn't look like a Reddit post. |
| 401 | `missing_api_key` / `invalid_api_key` | Header missing, malformed, or the key has been revoked. |
| 403 | `pro_plan_required` | The key's owner is no longer on a Pro plan. |
| 404 | `not_found` | Thread ID doesn't match a saved thread of yours. |
| 429 | `monthly_limit` | Exhausted your monthly export quota. Resets on the 1st UTC. `X-RateLimit-*` headers are present on every response. |
| 503 | `upstream_busy` | Transient — retry with exponential backoff. |