/v1/reddit/search
Search
Search Reddit for posts or comments. Search does not return upvote ratios or subscriber counts. Use /v1/reddit/post for a post's upvote_ratio.
| Credit cost | Default: 1 credit How charges are determinedCost is decided per call, not per endpoint: the same operation can cost different amounts depending on what it returns. A call that fails costs 0 credits. A result served from cache costs 0 credits. `default` is the cost when no rule matches. Rules are evaluated in order and the first whose conditions all hold wins. A `when` condition is one of: `param` (the request parameter is true), `outcome` (the classifier's outcome), `empty` / `nonEmpty` (a response field is empty and absent, or a non-empty array or string), `flag` (a response field is exactly true). A cost of `{ perStartedMinute: n, of: [fields] }` is n x max(1, ceil(seconds / 60)), so even a short result bills at least one minute. |
|---|---|
| Cache support | Not specified in the published contract. |
| Pagination | No explicit pagination metadata in the published contract. Consult the parameters and response fields below. |
Parameters
| Name | Location / required | Schema |
|---|---|---|
querySearch query | query / required |
|
filterSearch posts or comments | query / optional |
Allowed values |
sortSort by. Comment search supports relevance, new, and top; comment_count is for post search only. | query / optional |
Allowed values |
timeframePost search timeframe | query / optional |
Allowed values |
trimSet true for a trimmed response. | query / optional |
|
afterUsed to paginate to next page | query / optional |
|
Request examples
Replace placeholder values and supply your own API key. For operations with a request body, populate the body using the schema above.
cURL
curl --request GET 'https://api.fetchproof.com/v1/reddit/search?query=YOUR_QUERY' \
--header 'x-api-key: YOUR_API_KEY'JavaScript
const response = await fetch("https://api.fetchproof.com/v1/reddit/search?query=YOUR_QUERY", {
method: 'GET',
headers: { 'x-api-key': process.env.FETCHPROOF_API_KEY }
});
console.log(await response.text());Python
import os
import requests
response = requests.get("https://api.fetchproof.com/v1/reddit/search?query=YOUR_QUERY",
headers={"x-api-key": os.environ["FETCHPROOF_API_KEY"]})
print(response.text)Responses
200Success. Envelope: success / credits_remaining / credits_charged.
application/json
object
successrequired
boolean
credits_remainingrequired
integer
credits_chargedrequired
integer
postsrequired
array
Array items
object
approved_at_utcoptional
null
subredditrequired
string
selftextoptional
string
author_fullnamerequired
string
savedoptional
boolean
mod_reason_titleoptional
null
gildedoptional
integer
clickedoptional
boolean
titlerequired
string
link_flair_richtextoptional
array
subreddit_name_prefixedoptional
string
hiddenoptional
boolean
pwlsoptional
integer
link_flair_css_classoptional
null
downsrequired
integer
thumbnail_heightoptional
null
top_awarded_typeoptional
null
hide_scoreoptional
boolean
namerequired
string
quarantineoptional
boolean
link_flair_text_coloroptional
string
upvote_ratiorequired
null
author_flair_background_coloroptional
null
subreddit_typeoptional
string
upsrequired
integer
total_awards_receivedrequired
integer
media_embedoptional
object
thumbnail_widthoptional
null
author_flair_template_idoptional
null
is_original_contentoptional
boolean
user_reportsoptional
array
secure_mediaoptional
null
is_reddit_media_domainoptional
boolean
is_metaoptional
boolean
categoryoptional
null
secure_media_embedoptional
object
link_flair_textoptional
null
can_mod_postoptional
boolean
scorerequired
integer
approved_byoptional
null
is_created_from_ads_uioptional
boolean
author_premiumoptional
boolean
thumbnailoptional
string
editedoptional
integer
author_flair_css_classoptional
null
author_flair_richtextoptional
array
gildingsoptional
object
content_categoriesoptional
null
is_selfoptional
boolean
mod_noteoptional
null
createdrequired
integer
link_flair_typeoptional
string
wlsoptional
integer
removed_by_categoryoptional
null
banned_byoptional
null
author_flair_typeoptional
string
domainoptional
string
allow_live_commentsoptional
boolean
selftext_htmloptional
string
likesoptional
null
suggested_sortoptional
null
banned_at_utcoptional
null
view_countoptional
null
archivedoptional
boolean
no_followoptional
boolean
is_crosspostableoptional
boolean
pinnedoptional
boolean
over_18optional
boolean
all_awardingsoptional
array
awardersoptional
array
media_onlyoptional
boolean
can_gildoptional
boolean
spoileroptional
boolean
lockedoptional
boolean
author_flair_textoptional
null
treatment_tagsoptional
array
visitedoptional
boolean
removed_byoptional
null
num_reportsoptional
null
distinguishedoptional
null
subreddit_idoptional
string
author_is_blockedoptional
boolean
mod_reason_byoptional
null
removal_reasonoptional
null
link_flair_background_coloroptional
string
idrequired
string
is_robot_indexableoptional
boolean
report_reasonsoptional
null
authorrequired
string
discussion_typeoptional
null
num_commentsrequired
integer
send_repliesoptional
boolean
contest_modeoptional
boolean
mod_reportsoptional
array
author_patreon_flairoptional
boolean
author_flair_text_coloroptional
null
permalinkoptional
string
stickiedoptional
boolean
urlrequired
string
subreddit_subscribersrequired
null
created_utcrequired
integer
num_crosspostsoptional
integer
mediaoptional
null
is_videorequired
boolean
created_at_isooptional
string
{
"format": "date-time"
}post_idoptional
string
thumbnail_blurredoptional
boolean
positionoptional
integer
relative_positionoptional
integer
afterrequired
string