reddit.com APIwww.reddit.com ↗
Fetch Reddit posts, full comment threads, and keyword search results from any subreddit. Covers scores, authors, threading depth, and pagination.
curl -X GET 'https://api.parse.bot/scraper/5c1e1643-5ce6-4086-9883-3886b0c0e506/get_post_comments?sort=top&limit=25&subreddit=AskReddit' \ -H 'X-API-Key: $PARSE_API_KEY'
Get a Reddit post and all its comments with scores, authors, and threading depth. Comments are flattened from the nested tree structure with depth indicators.
| Param | Type | Description |
|---|---|---|
| sort | string | Comment sort order: top, best, new, controversial, old, qa |
| limit | integer | Max number of top-level comments to fetch (up to 500) |
| post_id | string | Reddit post ID (the alphanumeric code from the URL) |
| subreddit | string | Subreddit name (without r/) |
{
"type": "object",
"fields": {
"post": "object with id, title, author, selftext, score, upvote_ratio, num_comments, created_utc, url, permalink, subreddit, link_flair_text, is_self",
"comments": "array of comment objects with id, author, body, score, created_utc, depth, parent_id, permalink, is_submitter",
"total_comments_fetched": "integer count of comments returned",
"more_comments_available": "integer count of additional comments not returned"
},
"sample": {
"data": {
"post": {
"id": "198xzca",
"url": "https://www.reddit.com/r/smallbusiness/comments/198xzca/whats_your_biggest_struggle_in_running_your_small/",
"score": 134,
"title": "What's your BIGGEST STRUGGLE in running your small business?",
"author": "OliDiscovers",
"is_self": true,
"selftext": "An aspiring entrepreneur here. 'Want to learn from your experiences guys. Thanks. ",
"permalink": "/r/smallbusiness/comments/198xzca/whats_your_biggest_struggle_in_running_your_small/",
"subreddit": "smallbusiness",
"created_utc": 1705502227,
"num_comments": 311,
"upvote_ratio": 0.9,
"link_flair_text": "Question"
},
"comments": [
{
"id": "kiaaosv",
"body": "Employees. It's always employees.",
"depth": 0,
"score": 390,
"author": "PopuluxePete",
"parent_id": "t3_198xzca",
"permalink": "/r/smallbusiness/comments/198xzca/whats_your_biggest_struggle_in_running_your_small/kiaaosv/",
"created_utc": 1705503239,
"is_submitter": false
}
],
"total_comments_fetched": 25,
"more_comments_available": 297
},
"status": "success"
}
}About the reddit.com API
This API exposes 3 endpoints for reading Reddit content: listing subreddit posts by category, searching posts by keyword, and fetching a full comment thread for any post. The get_post_comments endpoint returns a flattened comment tree with depth indicators, author attribution, scores, and a count of comments not fetched. All endpoints return structured post objects with upvote ratios, flair, and UTC timestamps.
Subreddit Feeds and Search
The list_posts endpoint retrieves posts from any subreddit in one of four categories: hot, new, top, or rising. The time_filter parameter (hour, day, week, month, year, all) applies only when category is set to top. Results paginate using an after cursor — each response returns the cursor value to pass into the next request, or null when no further pages exist. Up to 100 posts per page can be requested.
The search_posts endpoint accepts a query string and an optional subreddit to scope results. Sort options include relevance, hot, top, new, and comments. The same time_filter and after cursor pagination applies. Note that some sort and time_filter combinations may return fewer results depending on index availability. The response echoes back the query and subreddit used, which is useful when parallelizing requests.
Comment Threads
The get_post_comments endpoint takes a post_id (the alphanumeric code from a Reddit URL) and an optional subreddit. It returns the full post object alongside a flat array of comments. Each comment includes id, author, body, score, created_utc, depth (nesting level), parent_id, and an is_submitter flag indicating whether the commenter is the original poster. Sort options are top, best, new, controversial, old, and qa. The limit parameter controls how many top-level comments are fetched (up to 500). The response also reports more_comments_available — the count of comments that exist but were not returned.
Response Shape
Post objects across all three endpoints share a consistent shape: id, title, author, selftext, score, upvote_ratio, num_comments, created_utc, url, permalink, subreddit, and link_flair_text. This makes it straightforward to process results from list_posts and search_posts with the same parsing logic.
- Track score and upvote_ratio trends for posts in a subreddit over time using list_posts with the top category and time_filter.
- Build a keyword alert system by polling search_posts with a query and checking created_utc for new matches.
- Analyze community sentiment on a topic by collecting comment body and score fields from get_post_comments across multiple posts.
- Identify high-engagement threads by comparing num_comments and score fields from list_posts results.
- Map comment depth and parent_id fields from get_post_comments to reconstruct conversation threads for qualitative research.
- Aggregate link_flair_text values across subreddit posts to understand how content is categorized by moderators.
- Detect whether the original poster participates in their own thread using the is_submitter flag on comment objects.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 250 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Reddit have an official developer API?+
What does get_post_comments return when a post has more comments than the limit?+
more_comments_available to the count of comments that exist but were not fetched. The total_comments_fetched field tells you how many were actually returned. There is no cursor-based pagination for comments — to get deeper coverage, increase the limit parameter up to its maximum of 500.Can I retrieve posts or comments from a specific user's profile?+
list_posts, subreddit keyword search via search_posts, and post-level comment threads via get_post_comments. User profile pages, including a user's post history or comment history, are not covered. You can fork this API on Parse and revise it to add a user-profile endpoint.Does search_posts always return the expected number of results when combining sort and time_filter?+
sort=top with time_filter=hour — may return fewer results than the requested limit because Reddit's search index does not have full coverage for every combination. The count field in the response tells you how many posts were actually returned, and after will be null if no further pages are available.