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

# Create Screenshot or PDF

> Captures a screenshot or PDF of a specified URL with customizable options.
## Token Cost
Base cost: **1 token**

Additional costs:
- Anti-Bot Mode: +1 token
- Specific Region: +1 token



## OpenAPI

````yaml https://api.snapopa.com/specs post /capture
openapi: 3.1.0
info:
  title: Snapopa API
  version: 1.0.0
  description: >-
    High-performance API for website screenshots, screen recording, PDFs, and
    metadata extraction. Built for developers, marketers, and enterprises who
    need reliable, scalable capture solutions.
  termsOfService: https://snapopa.com/terms
  contact:
    name: Snapopa Support
    url: https://snapopa.com
    email: hello@snapopa.com
  license:
    name: Proprietary
    url: https://snapopa.com/terms
servers:
  - url: https://api.snapopa.com
    description: Production API
security:
  - bearerAuth: []
tags:
  - name: Capture
    description: >-
      Create and manage website screenshots, PDFs, and screen recordings.
      Supports caching, persistence, and custom viewport configurations.
    externalDocs:
      description: Capture API Guide
      url: https://snapopa.com/docs/api/capture
  - name: System
    description: Health checks and system status monitoring endpoints
    externalDocs:
      description: System API Guide
      url: https://snapopa.com/docs/api/system
externalDocs:
  description: Full API Documentation
  url: https://snapopa.com/docs
paths:
  /capture:
    post:
      tags:
        - Capture
      summary: Create Screenshot or PDF
      description: >-
        Captures a screenshot or PDF of a specified URL with customizable
        options.

        ## Token Cost

        Base cost: **1 token**


        Additional costs:

        - Anti-Bot Mode: +1 token

        - Specific Region: +1 token
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  maxLength: 2048
                  format: uri
                  description: URL to capture
                html:
                  type: string
                  maxLength: 1048576
                  description: >-
                    Raw or base64-encoded HTML to render. Mutually exclusive
                    with url.
                responseType:
                  type: string
                  enum:
                    - json
                    - file
                  default: json
                  description: Return JSON metadata or the raw file.
                format:
                  type: string
                  enum:
                    - png
                    - jpeg
                    - webp
                    - pdf
                  default: jpeg
                  description: 'Output file format. One of: png, jpeg, webp, pdf.'
                responseCache:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                      default: false
                      description: >-
                        Return a cached result if available instead of
                        generating a fresh capture.
                    ttl:
                      type: integer
                      minimum: 60
                      exclusiveMinimum: true
                      maximum: 2592000
                      default: 86400
                      description: Cache lifetime in seconds.
                    nonce:
                      type: string
                      maxLength: 32
                      default: ''
                      description: >-
                        Random string to bust the cache key when stale results
                        should be skipped.
                  default:
                    enabled: false
                    ttl: 86400
                    nonce: ''
                  description: Reuse cached results to avoid duplicate captures.
                viewport:
                  type: object
                  properties:
                    width:
                      type: integer
                      minimum: 100
                      maximum: 3840
                      default: 1366
                      description: Viewport width in pixels.
                    height:
                      type: integer
                      minimum: 100
                      maximum: 2160
                      default: 768
                      description: >-
                        Viewport height in pixels. Ignored when full page is
                        enabled.
                  default:
                    width: 1366
                    height: 768
                  description: Viewport dimensions.
                colorScheme:
                  type: string
                  enum:
                    - light
                    - dark
                    - no-preference
                  default: light
                  description: Browser prefers-color-scheme value.
                quality:
                  type: integer
                  minimum: 1
                  maximum: 100
                  default: 85
                  description: Image quality for JPEG and WebP. Ignored for other formats.
                cdnTtl:
                  type: integer
                  minimum: 60
                  exclusiveMinimum: true
                  maximum: 2592000
                  default: 86400
                  description: >-
                    CDN storage lifetime in seconds. Ignored when persistence is
                    enabled.
                isFullPage:
                  type: boolean
                  default: false
                  description: Capture the full scrollable page. Overrides viewport height.
                async:
                  type: boolean
                  default: false
                  description: Process in the background and return immediately.
                persistence:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                      default: false
                      description: >-
                        Store the capture as a permalink with no expiration.
                        Delete via revoke.
                    refreshInterval:
                      type: integer
                      minimum: 0
                      maximum: 2592000
                      default: 0
                      description: >-
                        Auto-refresh interval in seconds. 0 disables. Each
                        refresh re-bills the full token cost.
                  default:
                    enabled: false
                    refreshInterval: 0
                  description: Long-term storage with optional auto-refresh.
                timeout:
                  type: integer
                  minimum: 5000
                  maximum: 120000
                  default: 30000
                  description: Navigation timeout in milliseconds.
                waitUntil:
                  type: string
                  enum:
                    - load
                    - domcontentloaded
                    - networkidle
                    - commit
                  default: domcontentloaded
                  description: Page load state to wait for before capturing.
                imageLoadTimeout:
                  type: integer
                  minimum: 0
                  maximum: 15000
                  default: 5000
                  description: >-
                    Max time in milliseconds to wait for images to load. Returns
                    early if all images load sooner.
                delay:
                  type: integer
                  minimum: 0
                  maximum: 15000
                  default: 0
                  description: >-
                    Extra wait in milliseconds after page load before capturing.
                    Useful for animations or delayed content.
                region:
                  type: string
                  enum:
                    - auto
                    - us-east
                    - us-west
                    - eu-west
                    - eu-central
                    - asia-east
                    - asia-southeast
                  default: auto
                  description: Geographic region for browser rendering.
                antiBot:
                  type: boolean
                  default: false
                  description: Use stealth providers to bypass bot detection.
                block:
                  type: object
                  properties:
                    ads:
                      type: boolean
                      default: true
                      description: Block ad networks and ad-related requests.
                    trackers:
                      type: boolean
                      default: true
                      description: Block analytics and tracking scripts.
                    cookies:
                      type: boolean
                      default: true
                      description: Hide cookie consent and GDPR banners (CSS-only).
                    popups:
                      type: boolean
                      default: false
                      description: Hide newsletter and promo popups (CSS-only).
                    media:
                      type: boolean
                      default: false
                      description: >-
                        Block images, videos, and fonts. Will affect screenshot
                        visuals.
                  default:
                    ads: true
                    trackers: true
                    cookies: true
                    popups: false
                    media: false
                  description: Block ads, trackers, and media to speed up captures.
              additionalProperties: false
            examples:
              basicScreenshot:
                summary: Basic screenshot
                description: Simple PNG screenshot with default settings
                value:
                  url: https://example.com
              fullPagePDF:
                summary: Full page PDF
                description: Capture entire page as PDF
                value:
                  url: https://example.com
                  format: pdf
                  isFullPage: true
              customViewport:
                summary: Custom viewport size
                description: Screenshot with specific dimensions
                value:
                  url: https://example.com
                  format: png
                  viewport:
                    width: 1280
                    height: 720
              cachedCapture:
                summary: Cached capture with response cache
                description: Use cached results to avoid duplicate API costs
                value:
                  url: https://example.com
                  responseCache:
                    enabled: true
                    ttl: 604800
              permanentCapture:
                summary: Permanent capture with daily refresh
                description: Store capture permanently with automatic daily refresh
                value:
                  url: https://example.com
                  persistence:
                    enabled: true
                    refreshInterval: 86400
              asyncCapture:
                summary: Async capture
                description: Background processing with immediate response
                value:
                  url: https://example.com
                  async: true
                  responseType: json
      responses:
        '200':
          description: Capture created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  error:
                    nullable: true
                  data:
                    type: object
                    properties:
                      uuid:
                        type: string
                        format: uuid
                      fileUrl:
                        type: string
                        format: uri
                        description: URL of the final capture file
                      fromCache:
                        type: boolean
                        description: Whether the response was served from cache
                      tokenCost:
                        type: integer
                        description: >-
                          Number of tokens consumed (0 for cache hits, 1+ for
                          fresh captures)
                      processingTimeMs:
                        type: integer
                        description: Time taken to process the capture in milliseconds
                      metadata:
                        type: object
                        properties:
                          url:
                            type: string
                            description: The original URL that was captured
                          capturedAt:
                            type: string
                            format: date-time
                            description: ISO 8601 timestamp when the capture was created
                          format:
                            type: string
                            description: File format (png, jpeg, webp, pdf)
                          mimeType:
                            type: string
                            description: MIME type of the capture file
                          fileSizeBytes:
                            type: integer
                            description: Size of the capture file in bytes
                          viewport:
                            type: object
                            properties:
                              width:
                                type: integer
                                description: Viewport width used for capture
                              height:
                                type: integer
                                description: Viewport height used for capture
                            required:
                              - width
                              - height
                            description: Viewport dimensions used for capture
                          fullPage:
                            type: boolean
                            description: Whether full page screenshot was captured
                          expiresAt:
                            type: string
                            format: date-time
                            description: >-
                              ISO 8601 timestamp when CDN storage expires (temp
                              captures only)
                        required:
                          - url
                          - capturedAt
                          - format
                          - mimeType
                          - fileSizeBytes
                          - viewport
                          - fullPage
                    required:
                      - uuid
                      - fileUrl
                      - fromCache
                      - tokenCost
                      - processingTimeMs
                      - metadata
                required:
                  - success
                  - error
                  - data
            image/png:
              schema:
                type: string
                format: binary
            image/jpeg:
              schema:
                type: string
                format: binary
            image/webp:
              schema:
                type: string
                format: binary
            application/pdf:
              schema:
                type: string
                format: binary
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                  data:
                    nullable: true
                required:
                  - success
                  - error
                  - data
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                  data:
                    nullable: true
                required:
                  - success
                  - error
                  - data
        '402':
          description: Payment Required - Quota exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                  data:
                    nullable: true
                required:
                  - success
                  - error
                  - data
        '429':
          description: Too Many Requests - Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                  data:
                    nullable: true
                required:
                  - success
                  - error
                  - data
        '500':
          description: Internal Server Error - Capture failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                  data:
                    nullable: true
                required:
                  - success
                  - error
                  - data
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication. Get your API key at
        https://snapopa.com/dashboard
      bearerFormat: API Key

````