Parameters

In this guide, we'll go over all the parameters available for the Screenshot API. Understanding these parameters will help you customize your screenshot requests and make the most of the API's capabilities.

Common Parameters

Here are the common parameters you can use when making requests to the Screenshot API:

url (required)

  • Description: The URL of the website you want to capture.
  • Type: string
  • Example: https://apple.com

access_key (required)

  • Description: Your unique access key for authenticating API requests.
  • Type: string
  • Example: <your_access_key>

wait_until

  • Description: Determines when the navigation should be considered complete.
  • Type: string
  • Default: load
  • Options: load, domcontentloaded, networkidle0, networkidle2
  • Example: networkidle0

timeout

  • Description: Maximum time (in seconds) to wait for the navigation to complete.
  • Type: integer
  • Default: 60
  • Example: 30

delay

  • Description: Wait time (in seconds) before taking the screenshot.
  • Type: integer
  • Default: 0
  • Example: 2

viewport_width

  • Description: The width of the browser viewport.
  • Type: integer
  • Default: 1920
  • Example: 1280

viewport_height

  • Description: The height of the browser viewport.
  • Type: integer
  • Default: 1080
  • Example: 720

device_scale_factor

  • Description: The device scale factor (pixel density).
  • Type: integer
  • Default: 1
  • Example: 2

viewport_mobile

  • Description: Emulates a mobile device viewport.
  • Type: boolean
  • Default: false
  • Options: true, false
  • Example: true

viewport_landscape

  • Description: Sets the viewport to landscape orientation.
  • Type: boolean
  • Default: false
  • Options: true, false
  • Example: true

viewport_has_touch

  • Description: Emulates touch capability in the viewport.
  • Type: boolean
  • Default: false
  • Options: true, false
  • Example: true

format

  • Description: The image format of the screenshot.
  • Type: string
  • Default: png
  • Options: png, jpeg, webp
  • Example: jpeg

image_quality

  • Description: The quality of the screenshot image (only applicable for jpeg and webp formats).
  • Type: integer
  • Default: 80
  • Example: 90

full_page

  • Description: Capture the full height of the page.
  • Type: boolean
  • Default: false
  • Options: true, false
  • Example: true

omit_background

  • Description: Remove the background and make it transparent (only for png format).
  • Type: boolean
  • Default: false
  • Options: true, false
  • Example: true

resolution

  • Description: The resolution of the screenshot (DPI).
  • Type: integer
  • Example: 300

selector

  • Description: Capture a specific element on the page using a CSS selector.
  • Type: string
  • Example: #main-content

clip_x, clip_y, clip_width, clip_height

  • Description: Defines a clipping region for the screenshot.
  • Type: integer
  • Example: clip_x=100, clip_y=200, clip_width=300, clip_height=400

block_ads

  • Description: Blocks advertisements on the page.
  • Type: boolean
  • Default: false
  • Options: true, false
  • Example: true

block_cookie_banners

  • Description: Blocks cookie banners on the page.
  • Type: boolean
  • Default: false
  • Options: true, false
  • Example: true

block_trackers

  • Description: Blocks tracking scripts on the page.
  • Type: boolean
  • Default: false
  • Options: true, false
  • Example: true

block_banners_by_heuristics

  • Description: Blocks banners using heuristic analysis.
  • Type: boolean
  • Default: false
  • Options: true, false
  • Example: true

javascript_enabled

  • Description: Enable or disable JavaScript execution on the page.
  • Type: boolean
  • Default: true
  • Options: true, false
  • Example: false

dark_mode

  • Description: Enable dark mode for the page.
  • Type: boolean
  • Default: false
  • Options: true, false
  • Example: true

proxy

  • Description: Use a proxy for the request.
  • Type: string
  • Example: http://username:password@proxyserver:port

user_agent

  • Description: Custom user agent for the browser.
  • Type: string
  • Example: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36

authorization

  • Description: Custom authorization header for the request.
  • Type: string
  • Example: Bearer <token>

extra_headers

  • Description: Additional headers to include in the request.
  • Type: object
  • Example: { "X-Custom-Header": "value" }

site_language

  • Description: The language preference for the site.
  • Type: string
  • Default: en-US,en
  • Example: fr-FR,fr

custom_geo

  • Description: Custom geographical location for the request.
  • Type: string
  • Example: US

timezone

  • Description: The timezone for the request.
  • Type: string
  • Example: America/New_York

device_type

  • Description: The type of device to emulate.
  • Type: string
  • Example: mobile

device_model

  • Description: The specific model of the device to emulate.
  • Type: string
  • Example: iPhone X

screen_orientation

  • Description: The orientation of the screen.
  • Type: string
  • Options: portrait, landscape
  • Example: landscape

bypass_cloudflare

  • Description: Bypass Cloudflare protection.
  • Type: boolean
  • Default: false
  • Options: true, false
  • Example: true

Using Parameters in Requests

You can include these parameters as part of the query string in a GET request or as JSON in a POST request.

Example GET Request

GET https://api.capturescreenshotapi.com/take?url=https://apple.com&access_key=<access_key>&format=jpeg&full_page=true&viewport_width=1280

Example POST Request

POST https://api.capturescreenshotapi.com/take
Content-Type: application/json
{
    "url": "https://apple.com",
    "access_key": "<access_key>",
    "format": "jpeg",
    "full_page": true,
    "viewport_width": 1280
}

What's next?

Now that you know about the available parameters, you can start experimenting to customize your screenshots. Here are some links to help you on your journey:

Was this page helpful?