Skip to content
Navigation

Search Reddit Posts

GET /v1/reddit/search/posts
1 credit per page Permission: reddit:read

Searches Reddit posts, subreddits, or users matching a query string globally or within a specified subreddit.

Authorization

  • bearerAuth: optional HTTP
  • apiKeyAuth: optional API key in header

Query parameters

  • q: required string

    Search query, 1 to 256 characters.

    maxLength: 256
  • type: optional post|subreddit|user

    Content type to search: post, subreddit, or user.

    default: "post"
  • sub: optional string

    Only search this subreddit.

  • sort: optional relevance|new|top|comments
    default: "relevance"
  • t: optional hour|day|week|month|year|all

    Time window when sorting by top or controversial.

  • limit: optional integer

    Number of items per page.

    range: 1–100 · default: 25
  • after: optional string

    Pagination cursor from the previous page's after field.

  • nsfw: optional boolean

    Include NSFW content (filtered out by default).

    default: false

Returns

200

The search results.

JSON

One of the following:

  • Listing
    • sort: required string
    • count: required integer
    • items: required array ofobject
      • id: optional string
      • name: optional string
      • domain: optional string
      • is_self: optional boolean
      • flair: optional string
      • spoiler: optional boolean
      • is_pinned: optional boolean
      • locked: optional boolean
      • removed: optional boolean
      • subreddit: optional string
      • title: optional string
      • author: optional string
      • score: optional integer
      • upvote_ratio: optional number
      • comments_count: optional integer
      • url: optional string
      • permalink: optional string
      • body: optional string
      • is_video: optional boolean
      • is_nsfw: optional boolean
      • media: optional array ofobject
        • type: optional image|video|gallery
        • url: optional string
        • width: optional integer
        • height: optional integer
        • caption: optional string
      • poll: optional object
        • total_votes: optional integer
        • is_closed: optional boolean
        • options: optional array ofobject
          • id: optional string
          • text: optional string
          • vote_count: optional integer
      • crosspost_of: optional object
        • id: optional string
        • subreddit: optional string
        • title: optional string
        • author: optional string
        • permalink: optional string
      • comments: optional array ofobject
        • id: optional string
        • parent_id: optional string

          t3_<post id> for a top-level comment, t1_<comment id> for a reply.

        • author: optional string
        • score: optional integer
        • body: optional string
        • depth: optional integer
        • is_op: optional boolean

          Written by the original poster (OP).

        • replies: optional array ofobject
          • id: optional string
          • parent_id: optional string

            t3_<post id> for a top-level comment, t1_<comment id> for a reply.

          • author: optional string
          • score: optional integer
          • body: optional string
          • depth: optional integer
          • is_op: optional boolean

            Written by the original poster (OP).

          • replies: optional array ofobject
    • filtered_nsfw: required integer
    • subreddit: optional string | null
    • query: optional string | null
    • after: optional string | null
  • SubredditListing
    • sort: required string
    • count: required integer
    • items: required array ofobject
      • name: optional string
      • title: optional string
      • public_description: optional string
      • description: optional string
      • subscribers: optional integer
      • is_nsfw: optional boolean
      • type: optional string
      • url: optional string
      • icon: optional string
      • rules: optional array ofobject
        • kind: optional string
        • short_name: optional string
        • description: optional string
        • violation_reason: optional string
        • priority: optional integer
    • filtered_nsfw: required integer
    • query: optional string | null
    • after: optional string | null
  • UserListing
    • sort: required string
    • count: required integer
    • items: required array ofobject
      • name: optional string
      • post_karma: optional integer
      • comment_karma: optional integer
      • karma: optional integer
      • is_employee: optional boolean
      • icon: optional string
      • suspended: optional boolean
    • filtered_nsfw: required integer
    • query: optional string | null
    • after: optional string | null

400

Bad request (invalid parameter or unknown action)
JSON
  • error: required object

    Some codes add fields, such as limit and used on monitor_limit_reached and upgrade_url on rate_limited and daily_quota_exceeded.

    • code: required string
    • message: required string
    • retryable: required boolean
    • retry_after: optional integer

      Seconds to wait before retrying.

    • request_id: optional string

      The request's X-Request-Id; include it when reporting an issue.

401

Missing or invalid API key or OAuth access token
JSON
  • error: required object

    Some codes add fields, such as limit and used on monitor_limit_reached and upgrade_url on rate_limited and daily_quota_exceeded.

    • code: required string
    • message: required string
    • retryable: required boolean
    • retry_after: optional integer

      Seconds to wait before retrying.

    • request_id: optional string

      The request's X-Request-Id; include it when reporting an issue.

402

The account has no credits left (insufficient_credits).
JSON
  • error: required object

    Some codes add fields, such as limit and used on monitor_limit_reached and upgrade_url on rate_limited and daily_quota_exceeded.

    • code: required string
    • message: required string
    • retryable: required boolean
    • retry_after: optional integer

      Seconds to wait before retrying.

    • request_id: optional string

      The request's X-Request-Id; include it when reporting an issue.

429

Rate limit or daily request quota exceeded
JSON
  • error: required object

    Some codes add fields, such as limit and used on monitor_limit_reached and upgrade_url on rate_limited and daily_quota_exceeded.

    • code: required string
    • message: required string
    • retryable: required boolean
    • retry_after: optional integer

      Seconds to wait before retrying.

    • request_id: optional string

      The request's X-Request-Id; include it when reporting an issue.

503

A temporary problem reaching Reddit (upstream_busy, upstream_timeout, upstream_blocked, upstream_error). Nothing was billed. If upstream_blocked, wait for Retry-After.
JSON
  • error: required object

    Some codes add fields, such as limit and used on monitor_limit_reached and upgrade_url on rate_limited and daily_quota_exceeded.

    • code: required string
    • message: required string
    • retryable: required boolean
    • retry_after: optional integer

      Seconds to wait before retrying.

    • request_id: optional string

      The request's X-Request-Id; include it when reporting an issue.

Type to search…

↑↓ navigate ↵ select Esc close