UnifAPI Docs

Search posts within a subreddit

Searches the posts of one subreddit by text, sorted by relevance, hot, top, new or comments, with a timeframe. Paginate with `cursor`.

Pricing — $ · min $0.003

Minimum 3 credits ($0.003) per call. Records returned above the minimum bill 1 credit ($0.001) each.

GET
/reddit/subreddits/{name}/search

Authorization

bearerAuth
AuthorizationBearer <token>

UnifAPI API key. Provider credentials are managed by UnifAPI.

In: header

Path Parameters

name*string

Subreddit name without the r/ prefix (exact casing).

Length1 <= length <= 500

Query Parameters

query?string

Search text to match against public subreddit posts.

Length1 <= length <= 512
sort?string

Sort order for search results. Default: relevance.

Value in

  • "relevance"
  • "hot"
  • "top"
  • "new"
  • "comments"
timeframe?string

Time range filter for search results. Default: all.

Value in

  • "all"
  • "year"
  • "month"
  • "week"
  • "day"
  • "hour"
cursor?string

Opaque pagination cursor from a previous response's pagination.next_cursor. Omit for the first page.

Length1 <= length <= 16384

Header Parameters

Unifapi-Version?"2026-07-01"

Pin the API version an integration was built against (date-based, e.g. 2026-07-01). Omit to use the current version. Public URL paths stay stable and unversioned; breaking changes ship under a new dated version and are announced with Deprecation and Sunset response headers. The served version is echoed in every response's Unifapi-Version header. Policy: https://unifapi.com/versioning.md

Default"2026-07-01"

Value in

  • "2026-07-01"

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/reddit/subreddits/string/search"
{  "request_id": "string",  "data": [    {      "id": "string",      "post_id": "string",      "title": "string",      "url": "string",      "permalink": "string",      "is_nsfw": true,      "is_spoiler": true,      "is_crosspost": true,      "author": {        "username": "string",        "id": "string"      },      "text": "string",      "subreddit": {        "id": "string",        "name": "string",        "is_nsfw": true,        "is_quarantined": true,        "icon_url": "string",        "banner_url": "string",        "description": "string",        "weekly_visitors": 0,        "weekly_contributions": 0      },      "vote_count": 0,      "comment_count": 0,      "upvote_ratio": 0,      "created_at": 0,      "thumbnail_url": "string",      "is_thumbnail_blurred": true,      "position": 0,      "relative_position": 0    }  ],  "pagination": {    "has_more": true,    "next_cursor": "string"  },  "billing": {    "credits_charged": 0,    "records_charged": 0,    "balance_remaining": 0,    "truncated_due_to_balance": true  }}