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

# Capture screenshot of a web page

> Capture screenshot of the specified URL with optional configuration. Returns binary image data by default for optimal performance.



## OpenAPI

````yaml https://api.weblinq.dev/doc post /v1/web/screenshot
openapi: 3.0.0
info:
  version: 1.0.0
  title: WebLinq API
  description: WebLinq API for web scraping, search, and content extraction
servers:
  - url: https://api.weblinq.dev
    description: Production API Server
  - url: http://localhost:8787
    description: Local Development Server
security: []
paths:
  /v1/web/screenshot:
    post:
      tags:
        - Web
      summary: Capture screenshot of a web page
      description: >-
        Capture screenshot of the specified URL with optional configuration.
        Returns binary image data by default for optimal performance.
      requestBody:
        description: Screenshot parameters
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  format: uri
                waitTime:
                  type: integer
                  minimum: 0
                  maximum: 5000
                  default: 0
                base64:
                  type: boolean
                  default: false
                  description: Return base64 string instead of binary Uint8Array
                screenshotOptions:
                  type: object
                  properties:
                    captureBeyondViewport:
                      type: boolean
                    clip:
                      type: object
                      properties:
                        height:
                          type: integer
                          minimum: 1
                        width:
                          type: integer
                          minimum: 1
                        x:
                          type: integer
                          minimum: 0
                        'y':
                          type: integer
                          minimum: 0
                        scale:
                          type: number
                          minimum: 0.1
                          maximum: 10
                      required:
                        - height
                        - width
                        - x
                        - 'y'
                    encoding:
                      type: string
                      enum:
                        - binary
                        - base64
                      default: binary
                    fromSurface:
                      type: boolean
                    fullPage:
                      type: boolean
                      default: true
                    omitBackground:
                      type: boolean
                    optimizeForSpeed:
                      type: boolean
                    quality:
                      type: integer
                      minimum: 1
                      maximum: 100
                    type:
                      type: string
                      enum:
                        - png
                        - jpeg
                        - webp
                      default: png
                  default: {}
                viewport:
                  type: object
                  properties:
                    height:
                      type: integer
                      minimum: 100
                      maximum: 2160
                      default: 800
                    width:
                      type: integer
                      minimum: 100
                      maximum: 3840
                      default: 1280
                    deviceScaleFactor:
                      type: number
                      minimum: 0.1
                      maximum: 10
                      default: 1
                    hasTouch:
                      type: boolean
                      default: false
                    isLandscape:
                      type: boolean
                      default: false
                    isMobile:
                      type: boolean
                      default: false
              required:
                - url
      responses:
        '200':
          description: >-
            Screenshot captured successfully - returns binary image data by
            default
          content:
            image/png:
              schema:
                type: string
                description: Raw bytes; default response.
                format: binary
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      metadata:
                        type: object
                        properties:
                          width:
                            type: number
                          height:
                            type: number
                          format:
                            type: string
                          size:
                            type: number
                          url:
                            type: string
                          timestamp:
                            type: string
                        required:
                          - width
                          - height
                          - format
                          - size
                          - url
                          - timestamp
                      permanentUrl:
                        type: string
                        format: uri
                        description: Permanent R2 storage URL for the image
                      fileId:
                        type: string
                        description: Unique file ID for tracking
                    required:
                      - metadata
                  creditsCost:
                    type: number
                    description: Credits consumed by this operation
                  requestId:
                    type: string
                    format: uuid
                    description: Unique request identifier for tracing
                  timestamp:
                    type: string
                    format: date-time
                    description: ISO timestamp when the response was generated
                required:
                  - success
                  - data
                  - requestId
                  - timestamp
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                      code:
                        type: string
                      requestId:
                        type: string
                        format: uuid
                    required:
                      - message
                      - code
                required:
                  - success
                  - error
                example:
                  success: false
                  error:
                    message: Authentication required
                    code: UNAUTHORIZED
                    requestId: bf68e5de-f6ef-479f-9328-6d3f48d5b7d4
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: object
                    properties:
                      issues:
                        type: array
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            path:
                              type: array
                              items:
                                anyOf:
                                  - type: string
                                  - type: number
                            message:
                              type: string
                          required:
                            - code
                            - path
                      name:
                        type: string
                    required:
                      - issues
                      - name
                    example:
                      issues:
                        - code: invalid_type
                          expected: string
                          received: undefined
                          path:
                            - url
                          message: Required
                      name: ZodError
                required:
                  - success
                  - error
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                      code:
                        type: string
                      requestId:
                        type: string
                        format: uuid
                    required:
                      - message
                      - code
                required:
                  - success
                  - error
                example:
                  success: false
                  error:
                    message: Authentication required
                    code: UNAUTHORIZED
                    requestId: bf68e5de-f6ef-479f-9328-6d3f48d5b7d4
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Enter your API token or session token

````