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

# Screenshot API

> This endpoint captures a screenshot of a given URL based on the specified parameters.



## OpenAPI

````yaml POST /api/capture-screenshot/
openapi: 3.0.1
info:
  title: Screenshot API
  description: >-
    This API captures a screenshot of a given URL based on the specified
    parameters.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://staging.screenshotbee.com
security: []
paths:
  /api/capture-screenshot/:
    post:
      summary: Take Screenshot
      description: >-
        This endpoint captures a screenshot of a given URL based on the
        specified parameters.
      parameters:
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
          description: This is the API key associated with the company.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  format: uri
                  pattern: ^https://.*
                  description: URL of the website you want to take a screenshot
                viewport_width:
                  type: number
                  description: Set the width of the browser viewport in pixels.
                  nullable: true
                viewport_height:
                  type: number
                  description: Set the height of the browser viewport in pixels.
                  nullable: true
                device_scale_factor:
                  type: number
                  description: >-
                    Set the device scale factor to simulate different screen
                    densities.
                  enum:
                    - 1
                    - 2
                    - 3
                  nullable: true
                user_agent:
                  type: string
                  description: >-
                    Set a custom user agent string to mimic a specific browser
                    or device.
                  nullable: true
                pre_defined_device:
                  type: boolean
                  description: Use a pre-defined device profile for the request.
                  nullable: true
                device_name:
                  type: string
                  description: Set a custom device name for the request.
                  enum:
                    - Blackberry PlayBook
                    - Blackberry PlayBook landscape
                    - BlackBerry Z30
                    - BlackBerry Z30 landscape
                    - Galaxy Note 3
                    - Galaxy Note 3 landscape
                    - Galaxy Note II
                    - Galaxy Note II landscape
                    - Galaxy S III
                    - Galaxy S III landscape
                    - Galaxy S5
                    - Galaxy S5 landscape
                    - Galaxy S8
                    - Galaxy S8 landscape
                    - Galaxy S9+
                    - Galaxy S9+ landscape
                    - Galaxy Tab S4
                    - Galaxy Tab S4 landscape
                    - iPad
                    - iPad landscape
                    - iPad (gen 6)
                    - iPad (gen 6) landscape
                    - iPad (gen 7)
                    - iPad (gen 7) landscape
                    - iPad Mini
                    - iPad Mini landscape
                    - iPad Pro
                    - iPad Pro landscape
                    - iPad Pro 11
                    - iPad Pro 11 landscape
                    - iPhone 4
                    - iPhone 4 landscape
                    - iPhone 5
                    - iPhone 5 landscape
                    - iPhone 6
                    - iPhone 6 landscape
                    - iPhone 6 Plus
                    - iPhone 6 Plus landscape
                    - iPhone 7
                    - iPhone 7 landscape
                    - iPhone 7 Plus
                    - iPhone 7 Plus landscape
                    - iPhone 8
                    - iPhone 8 landscape
                    - iPhone 8 Plus
                    - iPhone 8 Plus landscape
                    - iPhone SE
                    - iPhone SE landscape
                    - iPhone X
                    - iPhone X landscape
                    - iPhone XR
                    - iPhone XR landscape
                    - iPhone 11
                    - iPhone 11 landscape
                    - iPhone 11 Pro
                    - iPhone 11 Pro landscape
                    - iPhone 11 Pro Max
                    - iPhone 11 Pro Max landscape
                    - iPhone 12
                    - iPhone 12 landscape
                    - iPhone 12 Pro
                    - iPhone 12 Pro landscape
                    - iPhone 12 Pro Max
                    - iPhone 12 Pro Max landscape
                    - iPhone 12 Mini
                    - iPhone 12 Mini landscape
                    - iPhone 13
                    - iPhone 13 landscape
                    - iPhone 13 Pro
                    - iPhone 13 Pro landscape
                    - iPhone 13 Pro Max
                    - iPhone 13 Pro Max landscape
                    - iPhone 13 Mini
                    - iPhone 13 Mini landscape
                    - JioPhone 2
                    - JioPhone 2 landscape
                    - Kindle Fire HDX
                    - Kindle Fire HDX landscape
                    - LG Optimus L70
                    - LG Optimus L70 landscape
                    - Microsoft Lumia 550
                    - Microsoft Lumia 950
                    - Microsoft Lumia 950 landscape
                    - Nexus 10
                    - Nexus 10 landscape
                    - Nexus 4
                    - Nexus 4 landscape
                    - Nexus 5
                    - Nexus 5 landscape
                    - Nexus 5X
                    - Nexus 5X landscape
                    - Nexus 6
                    - Nexus 6 landscape
                    - Nexus 6P
                    - Nexus 6P landscape
                    - Nexus 7
                    - Nexus 7 landscape
                    - Nokia Lumia 520
                    - Nokia Lumia 520 landscape
                    - Nokia N9
                    - Nokia N9 landscape
                    - Pixel 2
                    - Pixel 2 landscape
                    - Pixel 2 XL
                    - Pixel 2 XL landscape
                    - Pixel 3
                    - Pixel 3 landscape
                    - Pixel 4
                    - Pixel 4 landscape
                    - Pixel 4a (5G)
                    - Pixel 4a (5G) landscape
                    - Pixel 5
                    - Pixel 5 landscape
                    - Moto G4
                    - Moto G4 landscape
                  nullable: true
                fullsize_screenshot:
                  type: boolean
                  description: Capture a full-page screenshot instead of a cropped one.
                  nullable: true
                is_selector:
                  type: boolean
                  description: Screenshot of the element.
                  nullable: true
                selector:
                  type: string
                  description: Take a screenshot of the element specified by this selector.
                  nullable: true
                has_screenshot_wait_time:
                  type: boolean
                  description: Enable waiting time before taking screenshot.
                  nullable: true
                screenshot_wait_time:
                  type: number
                  description: Set the wait time before taking screenshot event in seconds.
                  nullable: true
                image_quality:
                  type: number
                  description: Set the quality of the screenshot image (1-100).
                  nullable: true
                format:
                  type: string
                  description: Choose the format of the screenshot (e.g., PNG, JPEG, PDF).
                  enum:
                    - png
                    - jpeg
                    - pdf
                  nullable: true
                has_scroll_options:
                  type: boolean
                  description: By enabling we can control scroll options.
                  nullable: true
                scroll_delay:
                  type: number
                  description: Set the delay between scroll events in milliseconds..
                  nullable: true
                one_scroll_duration:
                  type: number
                  description: Set the duration of a single scroll event in milliseconds.
                  nullable: true
                scroll_by_pixes:
                  type: number
                  description: Set the number of pixels to scroll by in each event.
                  nullable: true
                one_scroll_duration_wait_time:
                  type: number
                  description: Set the wait time after a scroll event in milliseconds.
                  nullable: true
                stop_scrolling_after:
                  type: number
                  description: Set the number of scrolls before stopping.
                  nullable: true
                scroll_back_after:
                  type: number
                  description: >-
                    Set the number of milliseconds to wait before scrolling
                    back.
                  nullable: true
                scroll_immediately:
                  type: boolean
                  description: >-
                    Scroll immediately without waiting for the previous event to
                    complete.
                  nullable: true
                scroll_back:
                  type: boolean
                  description: Scroll back to the top of the page after reaching the end.
                  nullable: true
                stop_when_full_scroll_completed:
                  type: boolean
                  description: Stop scrolling when the full page is scrolled.
                  nullable: true
                scroll_easing:
                  type: string
                  description: >-
                    Choose an easing function for the scroll animation (e.g.,
                    linear, ease-in, ease-out).
                  enum:
                    - linear
                    - ease
                    - ease-in
                    - ease-out
                    - ease-in-out
                    - step-start
                    - step-end
                    - initial
                    - inherit
                  nullable: true
                is_record_video:
                  type: boolean
                  description: >-
                    Record the scrolling process as a video before taking a
                    screenshot.
                  nullable: true
                authorization_header:
                  type: string
                  description: Set a custom authorization header for the request.
                  nullable: true
                headers:
                  type: object
                  properties:
                    Custom-Header:
                      type: string
                      minLength: 1
                      description: User-defined value for the Custom-Header
                  additionalProperties: false
                  description: Set a custom header with a user-defined value.
                attach_cookies:
                  type: boolean
                  description: Attach Cookies with Request.
                  nullable: true
                cookies:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                      value:
                        type: string
                      domain:
                        type: string
                  description: Set cookies for the request.
                  nullable: true
                request_time_zone:
                  type: string
                  description: Set the time zone for the request.
                  enum:
                    - UTC
                    - GMT
                    - ECT
                    - EET
                    - ART
                    - EAT
                    - MET
                    - NET
                    - PLT
                    - IST
                    - BST
                    - VST
                    - CTT
                    - JST
                    - ACT
                    - AET
                    - SST
                    - NST
                    - MIT
                    - HST
                    - AST
                    - PST
                    - PNT
                    - MST
                    - CST
                    - EST
                    - IET
                    - PRT
                    - CNT
                    - AGT
                    - BET
                    - CAT
                  nullable: true
                block_ads:
                  type: boolean
                  description: Block ads from loading during the request.
                  nullable: true
                solve_captcha:
                  type: boolean
                  description: Attempt to solve captchas during the request.
                  nullable: true
                hide_cookie_banner:
                  type: boolean
                  description: Hide the cookie banner during the request.
                  nullable: true
                block_cookies:
                  type: boolean
                  description: Block cookies from being set during the request.
                  nullable: true
                disable_js:
                  type: boolean
                  description: Disable JavaScript execution during the request.
                  nullable: true
              required:
                - url
      responses:
        '200':
          description: Screenshot captured successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: >-
                      Indicates whether the call was successful. True if
                      successful, false if not.
                  result:
                    type: object
                    properties:
                      success:
                        type: boolean
                        description: >-
                          Indicates whether the call was successful. True if
                          successful, false if not.
                      screenshotUrl:
                        type: string
                        description: The URL of the captured screenshot.
                      statusCode:
                        type: number
                        description: The HTTP status code of the screenshot operation.
                      taskDurationSec:
                        type: number
                        description: The duration of the screenshot task in seconds.
                      pageResourceSizeinKB:
                        type: number
                        description: The size of the page resources in KB.
                      videoURL:
                        type: string
                        description: The URL of the captured screenshot video.
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '401':
          description: Invalid api key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseError'
        '402':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseError'
components:
  schemas:
    ValidationError:
      allOf:
        - $ref: '#/components/schemas/BaseError'
        - type: object
          required:
            - errors
          properties:
            errors:
              oneOf:
                - type: object
                  properties:
                    name:
                      type: string
                      example: ZodError
                    issues:
                      type: array
                      items:
                        type: object
                        properties:
                          code:
                            type: string
                            example: invalid_type
                          expected:
                            type: string
                            example: boolean
                          received:
                            type: string
                            example: number
                          path:
                            type: array
                            items:
                              type: string
                            example:
                              - field
                          message:
                            type: string
                            example: Expected boolean, received number
                        required:
                          - code
                          - path
                          - message
                - type: object
                  description: Generic error structure
                  additionalProperties: true
    BaseError:
      required:
        - success
        - message
      type: object
      properties:
        success:
          type: boolean
          description: Indicates request success status
        message:
          type: string
          description: A short description of the error

````