MarkdownCopies this page as Markdown, ready to paste into an AI assistant.
Reddit API
11 Reddit endpoints behind one key, priced in credits per call and routed to the cheapest healthy source.
On this page
Social · 11 endpoints · from 2 credits per call
Endpoints
- POSTReddit Post
/v1/run/reddit.postOne Reddit post by URL: title, body, author, subreddit, score, upvote ratio, comment count and flags.2 creditsper call - POSTReddit Post Comments
/v1/run/reddit.post_commentsComments of a Reddit post by URL, flattened depth-first with parent ids, scores and timestamps, cursor paged.2 creditsper call - POSTReddit Search
/v1/run/reddit.searchSearch Reddit posts across all subreddits by query, with sort order and time window, cursor paged.2 creditsper call - POSTReddit Subreddit Details
/v1/run/reddit.subreddit_detailsMetadata of one subreddit: description, icon, creation date, weekly active users and advertiser category.2 creditsper call - POSTReddit Subreddit Posts
/v1/run/reddit.subreddit_postsPosts of one subreddit listing (hot, new or top with a time window), cursor paged.2 creditsper call - POSTReddit Subreddit Search
/v1/run/reddit.subreddit_searchSearch posts inside one subreddit by query, sort order and time window, cursor paged.2 creditsper call - POSTReddit Trending Posts
/v1/run/reddit.trending_postsCurrently popular posts across Reddit (the r/popular feed), cursor paged.2 creditsper call - POSTReddit User Posts
/v1/run/reddit.user_postsPosts submitted by one Reddit user, sorted by new, top, hot or controversial, cursor paged.2 creditsper call - POSTReddit Community and User SearchPlanned
/v1/run/reddit.search_accountsFind Reddit communities (subreddits) or users by keyword.Planned - POSTReddit Post TranscriptPlanned
/v1/run/reddit.post_transcriptSpoken-word transcript of a Reddit video post, from its post URL or v.redd.it link.Planned - POSTReddit User CommentsPlanned
/v1/run/reddit.user_commentsComments written by a Reddit user, with the parent post title and subreddit, cursor paged.Planned
Calling them
Every endpoint on this page is one POST to https://api.primaryapi.com/v1/run/{sku} with your API key and a JSON body. Responses share one envelope, so code written for one endpoint handles the others. For example, reddit.post:
curl -sS -X POST "https://api.primaryapi.com/v1/run/reddit.post" \
-H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://www.reddit.com/r/webscraping/comments/1flgwup/after_2_months_learning_scraping_im_sharing_what_i/"}'const res = await fetch('https://api.primaryapi.com/v1/run/reddit.post', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.PRIMARYAPI_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
url: 'https://www.reddit.com/r/webscraping/comments/1flgwup/after_2_months_learning_scraping_im_sharing_what_i/',
}),
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.code}: ${body.error}`);
// found:false is a successful answer ("does not exist"), not an error
console.log(body.output.found ? body.output.data : body.output.reason, body.credits);import os
import requests
res = requests.post(
"https://api.primaryapi.com/v1/run/reddit.post",
headers={"Authorization": f"Bearer {os.environ['PRIMARYAPI_API_KEY']}"},
json={
"url": "https://www.reddit.com/r/webscraping/comments/1flgwup/after_2_months_learning_scraping_im_sharing_what_i/",
},
timeout=60,
)
body = res.json()
if not res.ok:
raise RuntimeError(f"{body['code']}: {body['error']}")
# found=False is a successful answer ("does not exist"), not an error
print(body["output"]["data"] if body["output"]["found"] else body["output"]["reason"], body["credits"])New to PrimaryAPI? Start with the Quickstart, then read Making requests.