> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bridgly.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Search Reddit posts



## OpenAPI

````yaml /openapi.json post /reddit/search/posts
openapi: 3.1.0
info:
  title: Bridgly API
  description: >-
    Web scraping API for LinkedIn, X (Twitter) and Reddit. Authenticated
    endpoints accept a Bridgly API key (`bgly_…`) via `Authorization: Bearer
    <token>`.
  version: 1.0.0
servers:
  - url: https://api.bridgly.app
    description: Production
  - url: http://localhost:4000
    description: Local
security: []
tags:
  - name: LinkedIn
    description: Scrape LinkedIn profiles, companies, posts, and search.
  - name: Reddit
    description: Scrape Reddit posts, subreddits, users, and search.
  - name: X (Twitter)
    description: Scrape tweets and search X.
paths:
  /reddit/search/posts:
    post:
      tags:
        - Reddit
      summary: Search Reddit posts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  type: string
                  description: >-
                    The text to search Reddit for, e.g. "openai", "best
                    keyboard".
                subreddit:
                  description: >-
                    Restrict the search to a single subreddit (name without the
                    "r/" prefix). Only applies to post search.
                  type: string
                sort:
                  type: string
                  enum:
                    - relevance
                    - hot
                    - top
                    - new
                    - comments
                  description: Result ordering. Defaults to "relevance".
                time:
                  type: string
                  enum:
                    - hour
                    - day
                    - week
                    - month
                    - year
                    - all
                  description: Restrict results to a recent window. Defaults to "all".
                after:
                  description: >-
                    Pagination cursor (a Reddit fullname returned as `after`
                    from a previous page).
                  type: string
                limit:
                  description: Number of results to return (1–100). Defaults to 25.
                  type: integer
                  minimum: 1
                  maximum: 100
              required:
                - query
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  timeMs:
                    type: number
                    description: >-
                      Wall-clock time the request took to complete, in
                      milliseconds.
                  creditsCost:
                    type: number
                    description: Number of account credits this request consumed.
                  data:
                    type: object
                    properties:
                      posts:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              description: >-
                                Base-36 post id without the `t3_` prefix, e.g.
                                "1u3a0cd".
                            fullname:
                              type: string
                              description: >-
                                Reddit fullname including the type prefix, e.g.
                                "t3_1u3a0cd".
                            title:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: Post title.
                            author:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: Author username, or "[deleted]" when removed.
                            authorFullname:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: Author account fullname, e.g. "t2_98wao505".
                            selftext:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: >-
                                Self-post body text (empty string for link
                                posts).
                            score:
                              anyOf:
                                - type: number
                                - type: 'null'
                              description: Net score (upvotes minus downvotes).
                            upvoteRatio:
                              anyOf:
                                - type: number
                                - type: 'null'
                              description: Fraction of votes that are upvotes, 0–1.
                            numComments:
                              anyOf:
                                - type: number
                                - type: 'null'
                              description: Total comment count.
                            createdUtc:
                              anyOf:
                                - type: number
                                - type: 'null'
                              description: Creation time as a Unix epoch in seconds.
                            permalink:
                              type: string
                              description: >-
                                Site-relative permalink path, e.g.
                                "/r/technology/comments/…".
                            postUrl:
                              type: string
                              description: Absolute URL to the post on reddit.com.
                            url:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: >-
                                The URL the post points to — the external link
                                for link posts, or the post permalink for self
                                posts.
                            subreddit:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: >-
                                Subreddit name without prefix, e.g.
                                "technology".
                            subredditPrefixed:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: Subreddit name with prefix, e.g. "r/technology".
                            subredditSubscribers:
                              anyOf:
                                - type: number
                                - type: 'null'
                              description: Subscriber count of the subreddit, when present.
                            linkFlairText:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: Link flair label, if any.
                            domain:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: >-
                                Source domain, e.g. "self.technology" or
                                "nytimes.com".
                            thumbnail:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: >-
                                Thumbnail URL, or a sentinel like
                                "self"/"default"/"nsfw" when there is no image.
                            isSelf:
                              type: boolean
                              description: Whether this is a self (text) post.
                            isVideo:
                              type: boolean
                              description: Whether the post hosts a Reddit video.
                            over18:
                              type: boolean
                              description: Whether the post is marked NSFW.
                            spoiler:
                              type: boolean
                              description: Whether the post is marked as a spoiler.
                            stickied:
                              type: boolean
                              description: Whether the post is pinned in its subreddit.
                            locked:
                              type: boolean
                              description: Whether commenting is locked.
                          required:
                            - id
                            - fullname
                            - title
                            - author
                            - authorFullname
                            - selftext
                            - score
                            - upvoteRatio
                            - numComments
                            - createdUtc
                            - permalink
                            - postUrl
                            - url
                            - subreddit
                            - subredditPrefixed
                            - subredditSubscribers
                            - linkFlairText
                            - domain
                            - thumbnail
                            - isSelf
                            - isVideo
                            - over18
                            - spoiler
                            - stickied
                            - locked
                          additionalProperties: false
                        description: Matching posts.
                      query:
                        type: string
                        description: The query string that was searched on Reddit.
                      after:
                        anyOf:
                          - type: string
                          - type: 'null'
                        description: >-
                          Pagination cursor for the next page (Reddit `after`
                          fullname), or null when there are no more results.
                    required:
                      - posts
                      - query
                      - after
                    additionalProperties: false
                required:
                  - timeMs
                  - creditsCost
                  - data
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                    description: Human-readable description of what went wrong.
                required:
                  - status
                  - message
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                    description: Human-readable description of what went wrong.
                required:
                  - status
                  - message
                additionalProperties: false
        '402':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                    description: Human-readable description of what went wrong.
                required:
                  - status
                  - message
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                    description: Human-readable description of what went wrong.
                required:
                  - status
                  - message
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                    description: Human-readable description of what went wrong.
                required:
                  - status
                  - message
                additionalProperties: false
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A Bridgly API key (`bgly_…`). Metered endpoints deduct credits from the
        resolved account.

````