Sylvia API Subreddits API

The Subreddits API from Sylvia API — 2 operation(s) for subreddits.

OpenAPI Specification

sylvia-api-subreddits-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Sylvia Subreddits API
  version: 1.0.0
  description: Reddit data API - no OAuth, no rate limits, pay-per-request. Posts, comments, search, subreddits, users, live streams, datasets.
  contact:
    name: Sylvia API
    url: https://sylvia-api.com
    email: support@sylvia-api.com
  license:
    name: Proprietary
    url: https://sylvia-api.com/terms
servers:
- url: https://api.sylvia-api.com/v1
  description: Production API server
security:
- ApiKeyAuth: []
tags:
- name: Subreddits
paths:
  /subreddits/{name}:
    get:
      summary: Get subreddit info
      description: 'Fetch subreddit metadata: subscribers, description, rules, icon, etc.'
      operationId: getSubreddit
      parameters:
      - name: name
        in: path
        description: Subreddit name (without r/)
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Subreddit object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subreddit'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      tags:
      - Subreddits
  /subreddits/{name}/posts:
    get:
      summary: Get posts from a subreddit
      description: Fetch recent/hot/top/new posts from a specific subreddit with pagination.
      operationId: getSubredditPosts
      parameters:
      - name: name
        in: path
        description: Subreddit name (without r/)
        required: true
        schema:
          type: string
      - name: sort
        in: query
        description: Sort order
        schema:
          type: string
          enum:
          - hot
          - new
          - top
          - rising
          default: hot
      - name: time
        in: query
        description: Time filter for 'top' sort
        schema:
          type: string
          enum:
          - hour
          - day
          - week
          - month
          - year
          - all
      - name: limit
        in: query
        description: Results per page (max 100)
        schema:
          type: integer
          minimum: 1
          maximum: 100
          default: 25
      - name: cursor
        in: query
        description: Pagination cursor
        schema:
          type: string
      responses:
        '200':
          description: Paginated posts
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      tags:
      - Subreddits
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        code:
          type: integer
    SearchResponse:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
        cursor:
          type:
          - string
          - 'null'
        has_more:
          type: boolean
        total:
          type:
          - integer
          - 'null'
    Subreddit:
      type: object
      properties:
        name:
          type: string
        display_name:
          type: string
        title:
          type: string
        description:
          type: string
        subscribers:
          type: integer
        created_utc:
          type: integer
          format: int64
        over_18:
          type: boolean
        icon:
          type:
          - string
          - 'null'
        banner:
          type:
          - string
          - 'null'
        rules:
          type: array
          items:
            type: object
            properties:
              short_name:
                type: string
              description:
                type: string
  responses:
    Unauthorized:
      description: Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication. Get yours at https://sylvia-api.com