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

# Get Multiple Snippets

> Retrieves multiple snippets by their IDs. API Cost: N requests (one per accessible snippet).



## OpenAPI

````yaml GET /snippets
openapi: 3.1.0
info:
  title: Snippets AI API
  description: >-
    A comprehensive API for managing snippets, folders, tags, and variations
    programmatically
  version: 1.0.0
  contact:
    name: Snippets AI Support
    email: team@getsnippets.ai
servers:
  - url: https://www.getsnippets.ai/api/prompts
    description: Production server
security:
  - bearerAuth: []
tags:
  - name: Snippets
    description: Operations for managing code snippets and text snippets
  - name: Variations
    description: Operations for managing snippet variations and version history
  - name: Folders
    description: Operations for organizing snippets into folders
  - name: Tags
    description: Operations for tagging and categorizing snippets
paths:
  /snippets:
    get:
      tags:
        - Snippets
      summary: Get multiple snippets
      description: >-
        Retrieves multiple snippets by their IDs. API Cost: N requests (one per
        accessible snippet).
      operationId: getSnippets
      parameters:
        - name: ids
          in: query
          required: true
          description: Comma-separated list of snippet IDs or JSON array
          schema:
            type: string
      responses:
        '200':
          description: Snippets retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchSnippetsResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
components:
  schemas:
    BatchSnippetsResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          type: array
          items:
            type: object
        usage:
          $ref: '#/components/schemas/BatchUsageInfo'
        metadata:
          type: object
          properties:
            requestedCount:
              type: integer
            foundCount:
              type: integer
            accessibleCount:
              type: integer
            inaccessibleCount:
              type: integer
            missingCount:
              type: integer
    BatchUsageInfo:
      type: object
      properties:
        remainingRequests:
          type: integer
          description: Number of API requests remaining
        usageDeducted:
          type: integer
          description: Number of requests deducted for this operation
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          description: Error message describing what went wrong
        error:
          type: string
          description: Additional error details
  responses:
    BadRequest:
      description: Bad request - Invalid parameters or malformed JSON
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            message: Snippet ID is required
    Unauthorized:
      description: Unauthorized - Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            message: Invalid or inactive API key
    Forbidden:
      description: Forbidden - Insufficient permissions or quota exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            insufficient_quota:
              value:
                success: false
                message: >-
                  Insufficient API requests. This operation requires 5 requests
                  but you have 0 remaining.
                usage:
                  remainingRequests: 0
                  requiredRequests: 5
            no_access:
              value:
                success: false
                message: API key does not have access to this team
    NotFound:
      description: Not Found - Requested resource does not exist
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            message: Snippet not found
    RateLimitExceeded:
      description: Too Many Requests - Rate limit exceeded (20 requests per minute)
      headers:
        Retry-After:
          description: Number of seconds to wait before making another request
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            message: >-
              Rate limit exceeded. Too many requests from this API key. Try
              again in 120 seconds.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication using Bearer token. Include your API key in the
        Authorization header.

````