Search Reddit posts

Search Reddit posts or comments site-wide by keyword (to search one subreddit, use reddit.subreddit.search.list).

GET/v1/reddit/search
1credit
x-api-keystringheader

API key (`sfk_...`)

Parameters
6
querystringrequiredquery

Search query text for public Reddit posts or comments.

min 1 chars · max 512 chars

typestringoptionalquery

What to search: `posts` (the default) or `comments`. Comment search answers in `comments`, sorts by `relevance`, `new` or `top`, and takes no `timeframe`.

one of: posts, comments

sortBystringoptionalquery

Optional sort order for search results. `comment-count` puts the most-commented posts first.

one of: relevance, new, top, comment-count

timeframestringoptionalquery

Optional time range filter for search results.

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

cursorstringoptionalquery

Opaque pagination cursor returned by a previous response.

min 1 chars

trimbooleanoptionalquery

Whether to request a smaller response shape when available.

Response fields
46

Endpoint-specific response payload.

dataquery
string

Search query string evaluated for this response.

Posts returned for this page; empty for `type=comments`.

dataposts[]id
string

Stable post identifier.

min 1 chars

dataposts[]name
stringnullable

Full post name when available.

dataposts[]title
stringnullable

Post title when available.

dataposts[]author
stringnullable

Author username when available.

dataposts[]subreddit
stringnullable

Subreddit name without a leading r/ when available.

dataposts[]subredditPrefixedName
stringnullable

Prefixed subreddit label such as r/example when available.

dataposts[]url
stringnullable

Canonical public post URL when available.

dataposts[]permalink
stringnullable

Public permalink URL when available.

dataposts[]bodyText
stringnullable

Post body text when available.

dataposts[]score
integernullable

Post score when available.

dataposts[]upvotes
integernullable

Upvote count when available.

dataposts[]upvoteRatio
numbernullable

Upvote ratio between 0 and 1 when available.

≥ 0 · ≤ 1

dataposts[]commentCount
integernullable

Comment count when available.

≥ 0

dataposts[]createdAt
stringnullable

ISO-8601 creation timestamp when available.

dataposts[]isVideo
boolean

Whether the post is a video post.

dataposts[]subredditSubscriberCount
integernullableoptional

Subreddit subscriber count when available.

≥ 0

Comments returned for this page. Present only for `type=comments`.

datacomments[]id
string

Stable comment identifier.

min 1 chars

datacomments[]url
stringnullable

Public comment URL when available.

datacomments[]permalink
stringnullable

Relative permalink path when available.

datacomments[]parentId
stringnullable

Identifier of the comment this replies to, or of the post for a top-level comment.

datacomments[]author
stringnullable

Comment author username when available.

datacomments[]text
string

Comment text.

datacomments[]score
integernullable

Comment score when available.

datacomments[]createdAt
stringnullable

ISO-8601 creation timestamp when available.

datacomments[]subreddit
stringnullable

Subreddit name without a leading r/ when available.

The post the comment was left on, when available.

datacomments[]postid
stringnullable

Post identifier.

datacomments[]posttitle
stringnullable

Post title.

datacomments[]posturl
stringnullable

Public post URL.

datacomments[]postscore
integernullable

Post score.

datacomments[]postcommentCount
integernullable

Comment count on the post.

≥ 0

datacomments[]postcreatedAt
stringnullable

ISO-8601 creation timestamp of the post.

datatotalResults
integer

Number of posts (or comments) returned in this response.

≥ 0

Pagination information for the current response.

datapagenextCursor
stringnullable

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

datapagehasMore
boolean

Whether another page of results is available.

Metadata describing the request and billing outcome.

metarequestId
string

Unique request identifier for tracing this API call.

min 1 chars

metacreditsCharged
integer

Credits charged for this request.

≥ 0

metaversion
string

Public API version that served the response.

one of: v1

metastale
booleanoptional

Present, and `true`, only when the source couldn't be reached and this is the last good answer for the same request instead, up to 24 hours old. Absent on every live answer.

one of: true

metafetchedAt
stringoptional

When a stale answer (`stale: true`) was originally fetched (ISO 8601, UTC). Absent on every live answer.

Code example

curl "https://api.socialfetch.dev/v1/reddit/search?query=web%20scraping" \
  -H "x-api-key: YOUR_API_KEY"

Responses

Search results for the requested query.