Reddit API
The Reddit API lets you search Reddit posts or retrieve a full post with its threaded comments. Both endpoints return structured JSON with subreddit, author, score, flair, awards, and media fields. Use it to power discussion-aware agents, brand monitoring, sentiment analysis, or RAG pipelines that need community-sourced context.
Endpoints
| Endpoint | Credits | Description |
|---|---|---|
POST /api/v1/reddit/search | 2 | Search Reddit posts by query, sort, and pagination cursor |
POST /api/v1/reddit/post | 2 | Get a full post with threaded comments by Reddit post URL |
Authentication
| Header | Value | Required |
|---|---|---|
Authorization | Bearer YOUR_API_KEY | Yes |
Content-Type | application/json | Yes |
Post Search
POST https://api.scavio.dev
/api/v1/reddit/searchSearch Reddit posts across all of Reddit. Returns post metadata including title, URL, subreddit, author, timestamp, and NSFW flag. Supports pagination via a cursor token.
Request Body
| Parameter | Type | Default | Description |
|---|---|---|---|
query | string | -- | Required. Search query (1-500 chars). |
sort | string | relevance | Sort order. One of: relevance, hot, top, new, comments |
cursor | string | -- | Pagination token from the previous response's nextCursor field. |
Example
curl -X POST 'https://api.scavio.dev
/api/v1/reddit/search' \
-H 'Authorization: Bearer sk_live_your_key' \
-H 'Content-Type: application/json' \
-d '{
"query": "best python web frameworks 2026",
"sort": "new"
}'Response Example
{
"data": {
"searchQuery": "best python web frameworks 2026",
"totalResults": 14,
"nextCursor": "eyJjYW5kaWRhdGVzX3JldH...",
"posts": [
{
"position": 0,
"id": "t3_1smb9du",
"title": "FastAPI vs Django in 2026 -- what the teams are actually using",
"url": "https://www.reddit.com/r/Python/comments/1smb9du/fastapi_vs_django/",
"subreddit": "Python",
"author": "python_dev",
"timestamp": "2026-04-15T16:34:40.389000+0000",
"nsfw": false
}
]
},
"response_time": 5200,
"credits_used": 2,
"credits_remaining": 498
}Pagination
To fetch the next page, pass the nextCursor value from the previous response as the cursor parameter in your next request. When nextCursor is null, there are no more results.
Post Detail
POST https://api.scavio.dev
/api/v1/reddit/postFetch a full Reddit post by its URL, including the post body, metadata, and full threaded comment tree. Comments include a depth field you can use to reconstruct the thread hierarchy.
Request Body
| Parameter | Type | Default | Description |
|---|---|---|---|
url | string | -- | Required. Full Reddit post URL (e.g. https://www.reddit.com/r/Python/comments/1smb9du/fastapi_vs_django/). |
Example
curl -X POST 'https://api.scavio.dev
/api/v1/reddit/post' \
-H 'Authorization: Bearer sk_live_your_key' \
-H 'Content-Type: application/json' \
-d '{
"url": "https://www.reddit.com/r/Python/comments/1smb9du/fastapi_vs_django/"
}'Response Example
{
"data": {
"post": {
"id": "t3_1smb9du",
"title": "FastAPI vs Django in 2026 -- what the teams are actually using",
"body": "After a year of running both in production...",
"url": "https://www.reddit.com/r/Python/comments/1smb9du/fastapi_vs_django/",
"contentUrl": "https://www.reddit.com/r/Python/comments/1smb9du/fastapi_vs_django/",
"subreddit": "Python",
"author": "python_dev",
"score": 842,
"upvoteRatio": 0.97,
"numComments": 214,
"timestamp": "2026-04-15T16:34:40.389000+0000",
"flair": "Discussion",
"nsfw": false,
"awards": []
},
"comments": [
{
"id": "t1_lxs9a0k",
"author": "senior_py",
"body": "We moved to FastAPI for the API surface and kept Django for admin...",
"score": 312,
"depth": 0,
"timestamp": "2026-04-15T17:02:11.000000+0000",
"parentId": "t3_1smb9du"
},
{
"id": "t1_lxsa1b2",
"author": "django_dev",
"body": "Django ORM is still unmatched for anything with relational depth.",
"score": 178,
"depth": 1,
"timestamp": "2026-04-15T17:15:42.000000+0000",
"parentId": "t1_lxs9a0k"
}
]
},
"response_time": 8900,
"credits_used": 2,
"credits_remaining": 496
}Reconstructing the Comment Tree
Comments are returned as a flat array in traversal order. Use the depth field (0-indexed) for visual indentation, or reconstruct the full tree via each comment's parentId. Top-level replies have parentId equal to the post id (e.g. t3_…); nested replies have parentId equal to another comment id (e.g. t1_…).
url vs contentUrl
url is the canonical Reddit permalink for the post. contentUrl is the URL Reddit renders in the post body -- for link posts this will be the external article, for self/text posts it is the same as url, and for image/video posts it is the media URL on i.redd.it or v.redd.it.
Response Format
Both endpoints return a consistent response wrapper:
| Field | Type | Description |
|---|---|---|
data | object | null | The response payload. null if the request failed upstream. Search returns {searchQuery, totalResults, nextCursor, posts}; post returns {post, comments}. |
response_time | number | Server-side response time in milliseconds |
credits_used | number | Number of credits consumed (always 2 for Reddit endpoints) |
credits_remaining | number | Credits remaining in your current billing period |
Error Responses
| Status | Description |
|---|---|
400 | Invalid request body -- missing query / url, bad cursor, or unsupported sort value |
401 | Unauthorized -- missing or invalid API key |
429 | Rate or usage limit exceeded for your plan |
502 | Upstream error -- retry after a short delay |
503 | Upstream unavailable -- retry later |
504 | Upstream timeout -- Reddit requests can take 5-15 seconds; retry with a longer client timeout |
See Errors for the full error reference and retry best practices.
Related
- Quickstart -- get your API key and make your first request
- Google Search API -- search Google with structured SERP data
- YouTube API -- search videos, extract metadata and transcripts
- Amazon API -- search Amazon products across 12 marketplaces
- Walmart API -- search Walmart products with fulfillment filters
- Rate Limits -- limits per plan tier