Social Fetch
Reddit

Search Reddit subreddit

Search posts within a subreddit.

Operation

GET/v1/reddit/subreddits/search
Cost: 1 credit

Headers

x-api-keystringrequired(header)

API key (`sfk_...`)

Parameters

subredditstringrequired(query)

Subreddit name, optional `r/` prefix, or Reddit subreddit URL. Must match Reddit's exact casing (for example `AskReddit`, not `askreddit`). Searches posts within this subreddit.

min 1 chars · max 256 chars

querystring(query)

Search text to match against public subreddit posts.

min 1 chars · max 512 chars

sortstring(query)

Optional sort order for search results. Defaults to relevance when omitted.

one of: relevance, hot, top, new, comments

timeframestring(query)

Optional time range filter for search results. Defaults to all when omitted.

one of: all, year, month, week, day, hour

cursorstring(query)

Opaque pagination cursor returned by a previous response.

min 1 chars

Response fields

data
objectrequired

Endpoint-specific response payload.

datasubreddit
stringrequired

Subreddit name evaluated for this response.

dataquery
stringrequirednullable

Search query evaluated for this response.

datasort
stringrequired

Sort order applied for this response.

one of: relevance, hot, top, new, comments

datatimeframe
stringrequired

Time range filter applied for this response.

one of: all, year, month, week, day, hour

dataposts
arrayrequired

Matching posts for the search.

dataposts[]id
stringrequired

Stable post identifier.

min 1 chars

dataposts[]postId
stringrequired

Post identifier when available.

min 1 chars

dataposts[]title
stringrequired

Post title.

min 1 chars

dataposts[]url
stringrequired

Canonical public URL for this post.

min 1 chars

dataposts[]permalink
stringrequired

Permalink path or URL for this post.

min 1 chars

dataposts[]nsfw
booleanrequired

Whether the post is marked as adult content.

dataposts[]spoiler
booleanrequired

Whether the post is marked as a spoiler.

dataposts[]crosspost
booleanrequired

Whether the post is a crosspost.

dataposts[]subreddit
objectrequirednullable

Subreddit metadata when available.

dataposts[]subredditid
stringrequirednullable

Subreddit identifier when available.

dataposts[]subredditname
stringrequirednullable

Subreddit name when available.

dataposts[]subredditnsfw
booleanrequirednullable

Whether the subreddit is marked as adult content.

dataposts[]subredditquarantined
booleanrequirednullable

Whether the subreddit is quarantined.

dataposts[]subredditiconUrl
stringrequirednullable

Subreddit icon URL when available.

dataposts[]subredditbannerUrl
stringrequirednullable

Subreddit banner URL when available.

dataposts[]subredditdescription
stringrequirednullable

Subreddit description when available.

dataposts[]subredditweeklyVisitors
integerrequirednullable

Approximate weekly visitors when available.

≥ 0

dataposts[]subredditweeklyContributions
integerrequirednullable

Approximate weekly contributions when available.

≥ 0

dataposts[]metrics
objectrequired

Engagement metrics for this post.

dataposts[]metricsvotes
integerrequirednullable

Vote count when available.

≥ 0

dataposts[]metricscomments
integerrequirednullable

Comment count when available.

≥ 0

dataposts[]createdAt
stringrequirednullable

ISO-8601 publish timestamp when available.

dataposts[]thumbnailUrl
stringrequirednullable

Thumbnail image URL when available.

dataposts[]thumbnailBlurred
booleanrequirednullable

Whether the thumbnail is blurred.

dataposts[]position
integerrequirednullable

Position of this row in the current result page.

≥ 0

dataposts[]relativePosition
integerrequirednullable

Relative position of this row in the current result page.

≥ 0

datatotalResults
integerrequired

Number of post rows returned in this response.

≥ 0

datapage
objectrequired

Pagination information for the current response.

datapagenextCursor
stringrequirednullable

Cursor to pass in the next request when another page exists.

datapagehasMore
booleanrequired

Whether another page of results is available.

meta
objectrequired

Metadata describing the request and billing outcome.

metarequestId
stringrequired

Unique request identifier for tracing this API call.

min 1 chars

metacreditsCharged
integerrequired

Credits charged for this request.

≥ 0

metaversion
stringrequired

Public API version that served the response.

one of: v1

Code example

Responses

Search results for the requested subreddit.

Error codes

bad_requestinsufficient_creditsinternal_errorlookup_failedtemporarily_unavailableunauthorized

On this page