Endpoints
All 15 endpoints follow the same pattern: POST https://api.fetchlayer.dev/reddit/{endpoint} with a JSON body and Bearer auth header.
Search
Find content, communities, and users across Reddit.
/search Search https://api.fetchlayer.dev/reddit/search Posts matching a keyword — globally or within a subreddit
Search Reddit posts by keyword. Optionally narrow to a specific subreddit. Results include title, score, comment count, author, and permalink.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Search keyword or phrase. |
| subreddit | string | No | Limit search to a specific subreddit. |
| sort | string | No | Sort order. (default: relevance) |
| limit | number | No | Number of results (max 100). (default: 25) |
| time | string | No | Time filter: hour, day, week, month, year, all. (default: all) |
Example Request
{
"query": "developer tools",
"subreddit": "webdev",
"sort": "top",
"limit": 10
} Example Response
{
"results": [
{
"title": "What tools do you swear by?",
"subreddit": "webdev",
"author": "devuser",
"score": 3241,
"numComments": 418,
"url": "https://reddit.com/r/webdev/comments/...",
"createdUtc": 1718000000
}
]
} Response Fields
search
Posts matching a keyword — globally or within a subreddit
| Field | Type | Description |
|---|---|---|
| results[].title | string | Post title. |
| results[].subreddit | string | Subreddit name. |
| results[].author | string | Reddit username. |
| results[].score | number | Upvote score. |
| results[].numComments | number | Comment count. |
| results[].url | string | Permalink to the post. |
| results[].createdUtc | number | Unix timestamp of creation. |
/search-comments Search https://api.fetchlayer.dev/reddit/search-comments Comments matching a keyword — globally or within a subreddit
Search Reddit comments by keyword. Optionally narrow to a specific subreddit. Results include comment body, score, author, subreddit, and permalink.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Search keyword or phrase. |
| subreddit | string | No | Limit search to a specific subreddit. |
| sort | string | No | Sort order: relevance, new, comments, top. (default: relevance) |
| time | string | No | Time filter: hour, day, week, month, year, all. (default: all) |
| limit | number | No | Number of results (max 100). (default: 25) |
| pages | number | No | Number of pages to scrape. (default: 1) |
Example Request
{
"query": "mcp",
"sort": "top",
"time": "all",
"limit": 25
} Example Response
{
"results": [
{
"body": "MCP has been a game changer for my workflow.",
"subreddit": "programming",
"author": "devuser",
"score": 342,
"permalink": "/r/programming/comments/.../comment/...",
"createdUtc": 1718000000
}
]
} Response Fields
search-comments
Comments matching a keyword — globally or within a subreddit
| Field | Type | Description |
|---|---|---|
| results[].body | string | Comment text. |
| results[].subreddit | string | Subreddit name. |
| results[].author | string | Reddit username. |
| results[].score | number | Upvote score. |
| results[].permalink | string | Permalink to the comment. |
| results[].createdUtc | number | Unix timestamp of creation. |
/search-communities Search https://api.fetchlayer.dev/reddit/search-communities Find subreddits by keyword
Search for subreddits matching a keyword. Returns community name, subscriber count, and description.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Search keyword. |
| limit | number | No | Max results. (default: 25) |
Example Request
{
"query": "programming",
"limit": 5
} Example Response
{
"results": [
{
"name": "programming",
"title": "Programming",
"subscribers": 35000000,
"description": "Computer Programming"
}
]
} Response Fields
search-communities
Find subreddits by keyword
| Field | Type | Description |
|---|---|---|
| results[].name | string | Subreddit name. |
| results[].title | string | Subreddit display title. |
| results[].subscribers | number | Subscriber count. |
| results[].description | string | Short description. |
/search-users Search https://api.fetchlayer.dev/reddit/search-users Find Reddit users by name
Search for Reddit users by username. Useful for account lookup and verification.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Username to search for. |
| limit | number | No | Max results. (default: 10) |
Example Request
{
"query": "spez",
"limit": 5
} Example Response
{
"results": [
{
"username": "spez",
"totalKarma": 1500000,
"accountAgeDays": 6200
}
]
} Response Fields
search-users
Find Reddit users by name
| Field | Type | Description |
|---|---|---|
| results[].username | string | Username. |
| results[].totalKarma | number | Combined karma. |
| results[].accountAgeDays | number | Account age in days. |
Content
Retrieve posts, comments, and threaded discussions.
/post Content https://api.fetchlayer.dev/reddit/post Full post body + complete comment tree (paginated)
Retrieve a single post by its Reddit ID (t3_xxxxx) or full URL. Returns the post body, metadata, and paginated comments.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| postId | string | Yes | Reddit post ID (e.g. t3_abc123) or full URL. |
| sort | string | No | Comment sort order. (default: best) |
| limit | number | No | Max comments to return. (default: 100) |
| depth | number | No | How many levels of replies to include. (default: 3) |
Example Request
{
"postId": "t3_abc123",
"sort": "top",
"limit": 50
} Example Response
{
"post": {
"title": "Example post",
"selftext": "This is the post body...",
"author": "reddituser",
"score": 1500,
"upvoteRatio": 0.92,
"numComments": 87,
"url": "https://example.com",
"permalink": "/r/test/comments/abc123/example_post/",
"createdUtc": 1718000000,
"edited": false
},
"comments": [
{
"id": "c1",
"author": "user1",
"body": "Great post!",
"score": 42,
"replies": []
}
]
} Response Fields
post
Full post body + complete comment tree (paginated)
| Field | Type | Description |
|---|---|---|
| post.title | string | Post title. |
| post.selftext | string | Post body text (may be empty for link posts). |
| post.author | string | Author username. |
| post.score | number | Upvote score. |
| post.upvoteRatio | number | Upvote ratio (0–1). |
| post.numComments | number | Total comment count. |
| post.url | string | URL the post links to (if link post). |
| post.permalink | string | Reddit permalink. |
| post.createdUtc | number | Unix timestamp. |
| post.edited | boolean | Whether the post was edited. |
| comments[].id | string | Comment ID. |
| comments[].author | string | Comment author. |
| comments[].body | string | Comment text. |
| comments[].score | number | Comment score. |
| comments[].replies | array | Nested reply objects. |
Community
Subreddit metadata, posts, and discovery.
/community-posts Community https://api.fetchlayer.dev/reddit/community-posts Posts from any subreddit — hot, new, top, rising
Retrieve the current post feed for a subreddit. Supports sorting by hot, new, top, rising, and controversy.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| subreddit | string | Yes | Subreddit name (without r/). |
| sort | string | No | Feed sort order. (default: hot) |
| limit | number | No | Number of posts (max 100). (default: 25) |
| time | string | No | Time filter for top sort. (default: all) |
Example Request
{
"subreddit": "programming",
"sort": "top",
"limit": 10,
"time": "week"
} Example Response
{
"posts": [
{
"title": "Example programming post",
"author": "coder123",
"score": 2500,
"numComments": 320,
"permalink": "/r/programming/comments/xyz/",
"createdUtc": 1718000000
}
]
} Response Fields
community-posts
Posts from any subreddit — hot, new, top, rising
| Field | Type | Description |
|---|---|---|
| posts[].title | string | Post title. |
| posts[].author | string | Author username. |
| posts[].score | number | Upvote score. |
| posts[].numComments | number | Comment count. |
| posts[].permalink | string | Relative permalink. |
| posts[].createdUtc | number | Unix timestamp. |
/community-details Community https://api.fetchlayer.dev/reddit/community-details Subreddit metadata — subscribers, description, rules
Get detailed metadata about a subreddit including subscriber count, active users, description, rules, and moderation info.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| subreddit | string | Yes | Subreddit name (without r/). |
Example Request
{
"subreddit": "programming"
} Example Response
{
"name": "programming",
"title": "Programming",
"description": "Computer Programming",
"subscribers": 35000000,
"activeUsers": 45000,
"createdUtc": 1200000000,
"rules": [
{
"title": "No spam",
"description": "Self-promotion is not allowed."
}
]
} Response Fields
community-details
Subreddit metadata — subscribers, description, rules
| Field | Type | Description |
|---|---|---|
| name | string | Subreddit display name. |
| title | string | Subreddit title. |
| description | string | Sidebar/description text. |
| subscribers | number | Subscriber count. |
| activeUsers | number | Currently active users. |
| createdUtc | number | Creation timestamp. |
| rules | array | Array of rule objects with title and description. |
User
User profiles, posts, and comment history.
/user-profile User https://api.fetchlayer.dev/reddit/user-profile Karma, bio, account age, and public profile info
Retrieve public profile information for any Reddit user including karma breakdown, account age, and bio.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| username | string | Yes | Reddit username. |
Example Request
{
"username": "spez"
} Example Response
{
"username": "spez",
"totalKarma": 1500000,
"postKarma": 800000,
"commentKarma": 700000,
"accountAgeDays": 6200,
"createdUtc": 1150000000,
"isGold": true,
"isMod": true,
"description": "Reddit co-founder."
} Response Fields
user-profile
Karma, bio, account age, and public profile info
| Field | Type | Description |
|---|---|---|
| username | string | Username. |
| totalKarma | number | Combined karma. |
| postKarma | number | Post karma. |
| commentKarma | number | Comment karma. |
| accountAgeDays | number | Account age in days. |
| createdUtc | number | Account creation timestamp. |
| isGold | boolean | Has Reddit Premium. |
| isMod | boolean | Is a moderator anywhere. |
| description | string | User bio/about text. |
/user-posts User https://api.fetchlayer.dev/reddit/user-posts All public posts submitted by a user
Retrieve the public post history for a Reddit user. Supports pagination.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| username | string | Yes | Reddit username. |
| limit | number | No | Number of posts (max 100). (default: 25) |
| before | string | No | Pagination cursor (before). |
| after | string | No | Pagination cursor (after). |
Example Request
{
"username": "spez",
"limit": 10
} Example Response
{
"posts": [
{
"title": "Announcing new features",
"subreddit": "reddit",
"score": 5000,
"numComments": 800,
"permalink": "/r/reddit/comments/abc/",
"createdUtc": 1718000000
}
],
"after": "t3_next"
} Response Fields
user-posts
All public posts submitted by a user
| Field | Type | Description |
|---|---|---|
| posts[].title | string | Post title. |
| posts[].subreddit | string | Subreddit. |
| posts[].score | number | Score. |
| posts[].numComments | number | Comment count. |
| posts[].permalink | string | Relative permalink. |
| posts[].createdUtc | number | Unix timestamp. |
| after | string | Cursor for next page. |
| before | string | Cursor for previous page. |
/user-comments User https://api.fetchlayer.dev/reddit/user-comments Comment history for any public user
Retrieve the public comment history for a Reddit user. Supports pagination.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| username | string | Yes | Reddit username. |
| limit | number | No | Number of comments (max 100). (default: 25) |
| before | string | No | Pagination cursor (before). |
| after | string | No | Pagination cursor (after). |
Example Request
{
"username": "spez",
"limit": 10
} Example Response
{
"comments": [
{
"body": "Thanks for the feedback!",
"subreddit": "reddit",
"score": 250,
"postTitle": "Announcing new features",
"permalink": "/r/reddit/comments/abc/comment/xyz/",
"createdUtc": 1718000000
}
],
"after": "t1_next"
} Response Fields
user-comments
Comment history for any public user
| Field | Type | Description |
|---|---|---|
| comments[].body | string | Comment text. |
| comments[].subreddit | string | Subreddit. |
| comments[].score | number | Score. |
| comments[].postTitle | string | Parent post title. |
| comments[].permalink | string | Relative permalink. |
| comments[].createdUtc | number | Unix timestamp. |
| after | string | Cursor for next page. |
Discover
Trending content and community exploration.
/popular Discover https://api.fetchlayer.dev/reddit/popular r/popular — trending posts across Reddit right now
Get the current r/popular feed. See what's trending across all of Reddit in real time.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| limit | number | No | Number of posts (max 100). (default: 25) |
Example Request
{
"limit": 10
} Example Response
{
"posts": [
{
"title": "Trending post",
"subreddit": "popular",
"author": "user123",
"score": 10000,
"numComments": 2000,
"permalink": "/r/popular/comments/xyz/"
}
]
} Response Fields
popular
r/popular — trending posts across Reddit right now
| Field | Type | Description |
|---|---|---|
| posts[].title | string | Post title. |
| posts[].subreddit | string | Subreddit. |
| posts[].author | string | Author. |
| posts[].score | number | Score. |
| posts[].numComments | number | Comment count. |
| posts[].permalink | string | Permalink. |
/leaderboard Discover https://api.fetchlayer.dev/reddit/leaderboard Trending communities leaderboard
Get a leaderboard of trending communities by subscriber growth, activity, or other metrics.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| limit | number | No | Number of communities. (default: 25) |
Example Request
{
"limit": 10
} Example Response
{
"leaderboard": [
{
"rank": 1,
"name": "programming",
"subscribers": 35000000,
"growth": 2.5
}
]
} Response Fields
leaderboard
Trending communities leaderboard
| Field | Type | Description |
|---|---|---|
| leaderboard[].rank | number | Rank position. |
| leaderboard[].name | string | Subreddit name. |
| leaderboard[].subscribers | number | Subscriber count. |
| leaderboard[].growth | number | Growth percentage. |
/explore Discover https://api.fetchlayer.dev/reddit/explore Browse communities grouped by topic
Explore subreddits organized by topic/category. Returns a curated list of communities across different interests.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| category | string | No | Topic category filter. |
| limit | number | No | Max results. (default: 50) |
Example Request
{
"category": "technology",
"limit": 10
} Example Response
{
"categories": [
{
"name": "technology",
"communities": [
{
"name": "programming",
"subscribers": 35000000
}
]
}
]
} Response Fields
explore
Browse communities grouped by topic
| Field | Type | Description |
|---|---|---|
| categories[].name | string | Category name. |
| categories[].communities[].name | string | Subreddit name. |
| categories[].communities[].subscribers | number | Subscriber count. |
Utility
Helper endpoints for URL resolution and inspection.
/resolve-url-type Utility https://api.fetchlayer.dev/reddit/resolve-url-type Identify what a Reddit URL points to
Pass any Reddit URL and get back the resource type (post, comment, subreddit, user) and its ID. Useful for routing and validation.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | Full Reddit URL. |
Example Request
{
"url": "https://www.reddit.com/r/programming/comments/abc123/"
} Example Response
{
"type": "post",
"id": "t3_abc123",
"slug": "programming/comments/abc123"
} Response Fields
resolve-url-type
Identify what a Reddit URL points to
| Field | Type | Description |
|---|---|---|
| type | string | Resource type: post, comment, subreddit, user. |
| id | string | Resource ID (t3_, t1_, etc.). |
| slug | string | URL slug. |
/comment-permalinkContenthttps://api.fetchlayer.dev/reddit/comment-permalinkSingle comment with parent context and replies
Retrieve a specific comment by its ID, including parent post context and nested replies.
Parameters
stringnumberExample Request
Example Response
Response Fields
comment-permalink
Single comment with parent context and replies
stringstringstringnumbernumberarraystringstring