Screenshot Options

This document lists all available request options to take screenshots of websites, render HTML, or Markdown.

Credentials

access_key

Each request must have an access key to authenticate the API user. You can find it on the access page.

An example of the request URL with access_key:

https://api.screenshotone.com/take?url=https://apple.com&access_key=<your access key>
Result
A screenshot of the Apple site taken by screenshot API

signature

A signature is optional. It is used for the signed requests.

You can force signing all requests access page.

Essentials

url

URL of the site to take a screenshot of. One of the Markdown, HTML or URL parameters is required.

An example of the request URL with url=https://www.youtube.com/feed/explore:

https://api.screenshotone.com/take?url=https://www.youtube.com/feed/explore&access_key=<your access key>
Result
A screenshot of the Youtube site taken by screenshot API

html

HTML you want to render. One of the Markdown, HTML or URL parameters is required.

An example of the request URL with html=<h1>Hello, world!</h1>:

https://api.screenshotone.com/take?html=<h1>Hello,%20world!</h1>&access_key=<your access key>
Result
A screenshot of the custom HTML taken by screenshot API

markdown

Markdown you want to render. One of the Markdown, HTML or URL parameters is required.

An example of the request URL with markdown=# Hello, world! (encoded to markdown=%23%20Hello%2C%20world!):

https://api.screenshotone.com/take?html=%23%20Hello%2C%20world!&access_key=<your access key>
Result
A screenshot of the custom Markdown taken by screenshot API

format

Available response formats:

  • png
  • jpeg or jpg
  • webp
  • gif
  • jp2
  • tiff
  • avif
  • heif
  • html (text representation)

Default value is jpg.

An example of the request URL with format=jpeg (an alias for format=jpg):

https://api.screenshotone.com/take?format=jpeg&url=https://apple.com&access_key=<your access key>
Result
A screenshot of the Apple site taken by screenshot API

response_type

Available response types:

  • by_format — return exactly the response defined in the format option. If format=png, the response will be the binary representation of the png with the content type header image/png;
  • empty — return only status or error. It is suitable when you want to upload the screenshot to storage and don’t care about the results. It also speeds up the response since there are no networking costs involved.
  • json — A method returns the response in the JSON format, but it is only suitable if you use options that are effective for JSON. By default, the JSON response will be empty. But for example, when you use caching, the JSON will be populated with additional data.

The default value is by_format.

An example of the request URL:

https://api.screenshotone.com/take?response_type=empty&url=https://example.com&access_key=<your access key>

selector

A CSS-like selector of the element to take a screenshot of. It is optional.

If the selector is specified and error_on_selector_not_found=true, the error will be returned if the element by selector is not visible or it took more than timeout seconds to render it, but not more than 30 seconds.

For HTML or Markdown formats, the selector returns the outer rendered HTML of the provided input.

An example of the request URL with selector=.content:

https://api.screenshotone.com/take?selector=.content&url=https://scalabledeveloper.com/posts/context-in-go/&access_key=<your access key>
Result
A screenshot of the content part of the Scalable Developer site taken by screenshot API


The same page without selector:

https://api.screenshotone.com/take?url=https://scalabledeveloper.com/posts/context-in-go/&access_key=<your access key>
Result
A screenshot of the Scalable Developer site taken by screenshot API

capture_beyond_viewport

When you take a full page screenshot or a screenshot of an element by selector, there is a rare case where the page or the part of the element might not be visible on the viewport.

With the capture_beyond_viewport option, you control if you want to take the screenshot of the full page or the element (capture_beyond_viewport=true) or if you are OK with taking a screenshot of the part of the page or the element (capture_beyond_viewport=false).

When you take full page screenshot or you take screenshot of an element by selector.

The option is set to true by default.

You might find it useful to check out the examples of how the captureBeyondViewport option works.

scroll_into_view

It scrolls the page if needed and ensures that the given selector is present in the view when taking a screenshot.

An example of the request URL:

https://api.screenshotone.com/take?scroll_into_view=%23faq&url=https://screenshotone.com&access_key=<your access key>

scroll_into_view_adjust_top

After the given element appears in the viewport and its top coordinate is aligned with the viewport’s top, you can adjust the position a bit before taking a screenshot by specifying the scroll_into_view_adjust_top parameter.

By default, it is 0. But you can use negative and positive integers.

An example of the request URL:

https://api.screenshotone.com/take?scroll_into_view_adjust_top=-100&scroll_into_view=%23faq&url=https://screenshotone.com&access_key=<your access key>

Full page

full_page

To take the screenshot of the full page, set full_page=true.

Default value is false.

When full_page is set to true, full_page_scroll is automatically set to true, until you override it. It is done to make sure that all lazy loaded images are requested and rendered.

An example of the request URL:

https://api.screenshotone.com/take?full_page=true&url=https://netflix.com&access_key=<your access key>
Result
A full page screenshot of the Apple site taken by screenshot API

full_page_scroll

If set to true, scrolls to the bottom of the page and back to the top. Default value is false.

When full_page is set to true, full_page_scroll is automatically set to true, until you override it. It is done to make sure that all lazy loaded images are requested and rendered.

An example of the request URL:

https://api.screenshotone.com/take?full_page_scroll=true&full_page=true&url=https://netflix.com&access_key=<your access key>

full_page_scroll_delay

The default value is 400 microseconds. Use it to specify how fast you want to scroll the page to the bottom.

Some sites require larger values than 400 microseconds to trigger the loading of lazy-load images.

Use it in combination with full_page_scroll_delay to find optimal solution.

An example of the request URL:

https://api.screenshotone.com/take?full_page_scroll_delay=1000&full_page_scroll=true&full_page=true&url=https://netflix.com&access_key=<your access key>

full_page_scroll_by

The default value is the height of the viewport. Use it to specify how fast you want to scroll the page to the bottom.

Some sites require values less than viewport height to trigger the loading of lazy-load images. Try to play with values between 100 and 500. However, don’t hesitate to try out any value that might work for you.

Use it in combination with full_page_scroll_delay to find optimal solution.

An example of the request URL:

https://api.screenshotone.com/take?full_page_scroll_by=400&full_page_scroll=true&full_page=true&url=https://netflix.com&access_key=<your access key>

Viewport

viewport_device

The default value is not set.

Instead of manually specifying viewport parameters like width and height, you can specify a device to use for emulation. In addition, other parameters of the viewport, including the user agent, will be set automatically.

The viewport_device option sets the next options for you: viewport_width, viewport_height, device_scale_factor, viewport_mobile, viewport_has_touch, viewport_landscape. You can change these options and override the ones set by the viewport_device option.

Use the list of devices for available values. Use the id property of the device as viewport_device, e.g. viewport_device=galaxy_s9+_landscape.

An example of the request URL with viewport_device=iphone_13_pro_max_landscape:

https://api.screenshotone.com/take?viewport_device=iphone_13_pro_max_landscape&url=https://tailwindcss.com&access_key=<your access key>
Result
A screenshot of the Apple site taken by screenshot API for the specified device

viewport_width

The width of the browser viewport (pixels).

The browser’s viewport is the window area where you can see the web content.

Default value is 1280.

An example of the request URL with viewport_width=1920 and viewport_height=1080:

https://api.screenshotone.com/take?viewport_width=1920&viewport_height=1080&url=https://apple.com&access_key=<your access key>
Result
A full page screenshot of the Apple site taken by screenshot API

viewport_height

The height of the browser viewport (pixels).

The browser’s viewport is the window area where you can see the web content.

Default value is 1024.

An example of the request URL with viewport_width=1920 and viewport_height=1080:

https://api.screenshotone.com/take?viewport_width=1920&viewport_height=1080&url=https://apple.com&access_key=<your access key>
Result
A full page screenshot of the Apple site taken by screenshot API

device_scale_factor

Set the device scale factor, think of it as DPR (Device Pixel Ratio). The acceptable value is between the range of 1 and 5, including real numbers, like 2.25.

Set 2 if you need to render a screenshot with a higher pixel density like Apple’s Retina Display.

The parameter can override the value set by viewport_device option.

An example of the request URL with device_scale_factor=1:

https://api.screenshotone.com/take?device_scale_factor=1&url=https://apple.com&access_key=<your access key>
Result
A full page screenshot of the Apple site taken by screenshot API

An example of the request URL with device_scale_factor=2:

https://api.screenshotone.com/take?device_scale_factor=2&url=https://apple.com&access_key=<your access key>
Result
A full page screenshot of the Apple site taken by screenshot API

viewport_mobile

Whether the meta viewport tag is taken into account. Defaults to false.

An example of the request URL with viewport_mobile=true:

https://api.screenshotone.com/take?viewport_mobile=true&url=https://example.com&access_key=<your access key>

viewport_has_touch

The default value is false. Set to true if the viewport supports touch events.

The parameter can override the value set by viewport_device option.

An example of the request URL with viewport_has_touch=true:

https://api.screenshotone.com/take?viewport_has_touch=true&url=https://example.com&access_key=<your access key>

viewport_landscape

The default value is false. Set to true if the viewport is in landscape mode.

The parameter can override the value set by viewport_device option.

An example of the request URL with viewport_landscape=true:

https://api.screenshotone.com/take?viewport_landscape=true&url=https://example.com&access_key=<your access key>

Image

image_quality

Render image with specified quality. Available for the next formats:

  • jpeg (jpg)
  • webp
  • png
  • tiff
  • jp2
  • avif
  • hei

Allowed range is between 0 and 100. Default value is 80.

An example of the request URL with image_quality=10:

https://api.screenshotone.com/take?format=webp&image_quality=10&url=https://apple.com&access_key=<your access key>
Result
A screenshot of the Apple site taken by screenshot API

image_width

The image_width and image_height parameters allow you to create a thumbnail of the screenshot, rendered HTML or PDF.

By default image_width = viewport_width and image_height = viewport_height.

If you specify image width and height parameters, the API will resize a screenshot, preserving the aspect ratio. The image will be resized to be as large as possible while ensuring its dimensions are less than or equal to the image width and height specified.

If you omit one of the parameters, the other is computed automatically, preserving the aspect ratio

An example of the request with image_width=500:

https://api.screenshotone.com/take?image_width=500&url=https://example.com/&access_key=<access key>

image_height

The image_width and image_height parameters allow you to create a thumbnail of the screenshot, rendered HTML or PDF.

By default image_width = viewport_width and image_height = viewport_height.

If you specify image width and height parameters, the API will resize a screenshot, preserving the aspect ratio. The image will be resized to be as large as possible while ensuring its dimensions are less than or equal to the image width and height specified.

If you omit one of the parameters, the other is computed automatically, preserving the aspect ratio

An example of the request with image_width=500&image_height=400:

https://api.screenshotone.com/take?image_width=500&image_height=400&url=https://example.com/&access_key=<access key>

omit_background

Render a transparent background for the image. Works only if the site has not defined background color. Available for the following response formats:

  • png
  • webp

Default value is `false.

Set omit_background=true to take a screenshot with the transparent background.

Emulations

dark_mode

The default value is not set.

Set true to request site rendering, if supported, in the dark mode. Set false to request site rendering in the light mode if supported. If you don’t set the parameter. The site is rendered in the default mode.

An example of the request URL with dark_mode=true:

https://api.screenshotone.com/take?dark_mode=true&url=https://tailwindcss.com/&access_key=<your access key>
Result
A screenshot of the tailwindcss.com site taken by screenshot API in the dark mode

reduced_motion

When reduced_motion set to true, the API will request the site to minimize the amount of non-essential motion it uses. When the site supports it, it should use animations as least as possible.

An example of the request URL with reduced_motion=true:

https://api.screenshotone.com/take?reduced_motion=true&url=https://tailwindcss.com/&access_key=<your access key>

media_type

If you want to request the page and it is supported to be rendered for printers, specify print. If the page is by default rendered for printers and you want it to be rendered for screens, use screen.

An example of the request URL with media_type=print:

https://api.screenshotone.com/take?media_type=print&url=https://example.com/&access_key=<your access key>

Customization

hide_selectors

The hide_selectors option allows hiding elements before taking a screenshot. You can specify as many selectors as you wish. All elements that match each selector will be hidden by setting the display style property to none !important.

An example of the request URL with hide_selectors=.a&hide_selectors=.b:

https://api.screenshotone.com/take?hide_selectors=.a&hide_selectors=.b&url=https://example.com/&access_key=<your access key>

scripts

scripts parameter allows to inject custom JavaScript and customize the page behavior.

An example of the request URL with scripts=document.body.innerHTML="Hello, world!":

https://api.screenshotone.com/take?scripts=document.body.innerHTML="Hello,%20world!"&url=https://example.com/&access_key=<your access key>
Result
A screenshot of the example.com site taken by screenshot API

scripts_wait_until

The default value of scripts_wait_until is [] — nothing, no wait at all.

The scripts_wain_until option allows you to wait until a given set of events after the scripts were executed. You need to use in case, if your script might trigger page reloading, like:

window.location = 'https://example.com';

It accepts the same values as wait_until and can have multiple values:

  • load: the navigation is successful when the load even is fired;
  • domcontentloaded: the navigation is finished when the DOMContentLoaded even is fired;
  • networkidle0: the navigation is finished when there are no more than 0 network connections for at least 500 ms;
  • networkidle2: consider navigation to be finished when there are no more than 2 network connections for at least 500 ms.

The parameter accepts many values. It means that screenshots will be taken after all events occur altogether.

An example of the request with scripts_wait_until=networkidle2&scripts_wait_until=domcontentloaded:

https://api.screenshotone.com/take?scripts_wait_until=networkidle2&scripts_wait_until=domcontentloaded&url=https://example.com/&access_key=<access key>

styles

styles parameter allows to inject custom styles and customize the page. It might help generate beautiful images for the Open Graph protocol.

An example of the request URL with styles=h1{color: red;}:

https://api.screenshotone.com/take?styles=h1{color:%20red;}&url=https://example.com/&access_key=<your access key>
Result
A screenshot of the example.com site taken by screenshot API


A screenshot without styles for comparison:

Result
A screenshot of the example.com site taken by screenshot API

click

Specify the CSS selector of an element to click on before taking the screenshot. It could be anything, including a button, link, or even a regular div element.

An example of the request URL with click=.a-some-button-class-selector:

https://api.screenshotone.com/take?click=.a-some-button-class-selector&url=https://example.com&access_key=<your access key>

Blocking

Blocks cookie banners, GDPR overlay windows, and other privacy-related notices. Default value is false when the url option is set.

It is useful when you want to take “clean” screenshots.

An example of the request URL with block_cookie_banners=true:

https://api.screenshotone.com/take?block_cookie_banners=true&url=https://stackoverflow.com&access_key=<your access key>
Result
A screenshot of the StackOverflow site taken by screenshot API

An example of the request URL with block_cookie_banners=false:

https://api.screenshotone.com/take?block_ads=false&url=https://stackoverflow.com&access_key=<your access key>
Result
A screenshot of the StackOverflow site taken by screenshot API

block_banners_by_heuristics

Blocks cookie banners, GDPR overlay windows, and other privacy-related notices. Default value is false.

It is useful when you want to take “clean” screenshots, but the block_cookie_banners option doesn’t work.

An example of the request URL with block_banners_by_heuristics=true:

https://api.screenshotone.com/take?block_banners_by_heuristics=true&url=https://example.com&access_key=<your access key>

block_chats

Blocks chats like Crisp, Facebook Messenger, Intercom, Drift, Tawk, User.com, Zoho SalesIQ and many others. Default value is false when the url option is set..

It is useful when you want to take “clean” screenshots.

An example of the request URL with block_chats=true:

https://api.screenshotone.com/take?block_chats=true&url=https://screenshotone.com&access_key=<your access key>
Result
A screenshot of the ScreenshotOne site taken by screenshot API

An example of the request URL with block_chats=false:

https://api.screenshotone.com/take?block_chats=false&url=https://screenshotone.com&access_key=<your access key>
Result
A screenshot of the ScreenshotOne site taken by screenshot API

block_ads

Blocks ads. Default value is false when the url option is set..

It is useful when you want to take “clean” screenshots or don’t want to generate a loss for advertisers.

An example of the request URL with block_ads=true:

https://api.screenshotone.com/take?block_ads=true&url=https://scalabledeveloper.com/posts/linux-kernel-coding-style/&access_key=<your access key>
Result
A screenshot of the Scalable Developer site taken by screenshot API

An example of the request URL with block_ads=false:

https://api.screenshotone.com/take?block_ads=false&url=https://scalabledeveloper.com/posts/linux-kernel-coding-style/&access_key=<your access key>
Result
A screenshot of the Scalable Developer site taken by screenshot API

block_trackers

Block trackers. Default value is false when the url option is set.

It is useful when you don’t want to count screenshots as client visits in your analytics app.

Set block_trackers=true to disable all trackers.

block_requests

Block requests by specifying URL, domain, or even a simple pattern like block_requests=*.example.com/*. You can specify the parameter multiple times like block_requests=example.com&block_requests=http://*.

Blocking requests by URL or domain can be used to test how the site responds when resources are not available. Or it might be used to speed up page loading.

Or, as an example, another way of blocking ads and trackers with block_requests=*.carbonads.com&block_requests=*.google-analytics.com:

https://api.screenshotone.com/take?block_requests=*.carbonads.com&url=https://scalabledeveloper.com/posts/linux-kernel-coding-style/&access_key=<access key>
Result
A screenshot of the Scalable Developer site taken by screenshot API

block_resources

Blocks loading resources by type. Available resource types are:

  • document
  • stylesheet
  • image
  • media
  • font
  • script
  • texttrack
  • xhr
  • fetch
  • eventsource
  • websocket
  • manifest
  • other

Blocking resources might be helpful when you need to optimize page loading speed before taking a screenshot.

You can specify multiple values as block_resources=stylesheet&block_resources=image:

https://api.screenshotone.com/take?block_resources=stylesheet&block_resources=image&url=https://screenshotone.com&access_key=<access key>
Result
A screenshot of the ScreenshotOne landing page site taken by screenshot API

Geolocation

geolocation_latitude

Set geolocation latitude for the request. Both latitude and longitude are required if one of them is set.

Take a screenshot from Eiffel Tower with accuracy in 50 meters geolocation_latitude=48.858184&geolocation_longitude=2.294720&geolocation_accuracy=50:

https://api.screenshotone.com/take?geolocation_latitude=48.858184&geolocation_longitude=2.294720&geolocation_accuracy=50&url=https://www.infobyip.com/browsergeolocation.php&access_key=<access key>
Result
A screenshot from Eiffel Tower with accuracy in 50 meters taken by screenshot API

geolocation_longitude

Set geolocation longitude for the request. Both latitude and longitude are required if one of them is set.

Take a screenshot from Eiffel Tower with accuracy in 50 meters geolocation_latitude=48.858184&geolocation_longitude=2.294720&geolocation_accuracy=50:

https://api.screenshotone.com/take?geolocation_latitude=48.858184&geolocation_longitude=2.294720&geolocation_accuracy=50&url=https://www.infobyip.com/browsergeolocation.php&access_key=<access key>
Result
A screenshot from Eiffel Tower with accuracy in 50 meters taken by screenshot API

geolocation_accuracy

Set the geolocation accuracy in meters.

Take a screenshot from Eiffel Tower with accuracy in 50 meters geolocation_latitude=48.858184&geolocation_longitude=2.294720&geolocation_accuracy=50:

https://api.screenshotone.com/take?geolocation_latitude=48.858184&geolocation_longitude=2.294720&geolocation_accuracy=50&url=https://www.infobyip.com/browsergeolocation.php&access_key=<access key>
Result
A screenshot from Eiffel Tower with accuracy in 50 meters taken by screenshot API

Request

ip_location

You can use data center proxies provided by ScreenshotOne to take screenshots from different countries. Set parameter ip_locationto the desired country, and you are ready to go, e.g., ip_location=gb.

The parameter is not supposed to be used for stealth screenshots. These are not residential proxies. If you have such a case, please, feel free to send the request to support@screenshotone.com.

While ScreenshotOne uses premium, highly available data center proxies, routing requests through them is slower than without a proxy. Try to avoid using the feature if you don’t need it.

The list of supported countries:

  • us (United States) default
  • gb (Great Britain)
  • de (Germany)
  • it (Italy)
  • fr (France)
  • cn (China)
  • ca (Canada)
  • es (Spain)
  • jp (Japan)
  • kr (South Korea)
  • in (India)
  • au (Australia)
  • br (Brazil)
  • mx (Mexico).

Feel free to request any additional country at support@screenshotone.com.

proxy

You can use your custom proxy to take screenshots or render HTML with the proxy option.

It is suitable in many cases. For example, you might want to render a screenshot from the given location and check how the site renders for this location.

The https, http, socks4 and socks5 proxies are supported.

If you need to specify username and password, use the usual URL format like: https://myuser:mypassword@example.com/.

Example of the request:

https://api.screenshotone.com/take?proxy=socks5://127.0.0.1:1080&url=https://example.com/&access_key=<access key>

user_agent

A user agent for the request. The default value is the latest version of the browser that Puppeteer uses.

An example with default user agent:

https://api.screenshotone.com/take?url=https://www.whatsmyua.info/&access_key=<access key>
Result
A screenshot with default user agent by screenshot API

An example with specified user agent user_agent=screenshoter:

https://api.screenshotone.com/take?user_agent=screenshoter&url=https://www.whatsmyua.info/&access_key=<access key>
Result
A screenshot with custom user agent by screenshot API

authorization

Set the Authorization header for the request.

Setting the authorization header is proper when you want to take a screenshot of the protected page by basic authentication or token.

For example, if use basic authentication with credentials like username:password, encode it to Base64 format dXNlcm5hbWU6cGFzc3dvcmQ= and then use set the value of the authorization header like authorization=Basic+dXNlcm5hbWU6cGFzc3dvcmQ=.

cookies

Set cookies for the request in format <cookie-name>=<cookie-value>; Domain=<domain-value>; Secure; HttpOnly. You can specify multiple cookies.

An escaped query string might look like: cookies=name1=val1;+Domain=example.com;+Secure;+HttpOnly&cookies=name2=val2;+Domain=example.com;+Secure;+HttpOnly

headers

Set extra headers for the request in the format of Header-Name:Header-Value

Headers can override all other previously implicitly set headers by options like cookies or authorization.

You can specify multiple headers at once headers=X-Header-1:Value-1&headers=X-Header-2:Value-2:

https://api.screenshotone.com/take?headers=X-Header-1:Value-1&headers=X-Header-2:Value-2&url=http://myhttpheader.com/&access_key=<access key>
Result
A screenshot with custom headers by screenshot API

time_zone

Sets time zone for the request. Available time zones are:

  • America/Belize
  • America/Cayman
  • America/Chicago
  • America/Costa_Rica
  • America/Denver
  • America/Edmonton
  • America/El_Salvador
  • America/Guatemala
  • America/Guayaquil
  • America/Hermosillo
  • America/Jamaica
  • America/Los_Angeles
  • America/Mexico_City
  • America/Nassau
  • America/New_York
  • America/Panama
  • America/Port-au-Prince
  • America/Santiago
  • America/Tegucigalpa
  • America/Tijuana
  • America/Toronto
  • America/Vancouver
  • America/Winnipeg
  • Asia/Kuala_Lumpur
  • Asia/Shanghai
  • Asia/Tashkent
  • Europe/Berlin
  • Europe/Kiev
  • Europe/Lisbon
  • Europe/London
  • Europe/Madrid
  • Pacific/Auckland
  • Pacific/Majuro

Default time zone is GMT +/- 00:00.

An example with time_zone=Europe/Madrid:

https://api.screenshotone.com/take?time_zone=Europe/Madrid&url=https://whatismytimezone.com/&access_key=<access key>
Result
A screenshot with custom time zone by screenshot API

Wait

These are one of the most tricky parameters when rendering screenshots of a site. Read on how to wait until the page is ready if you are curious. Or use these wait options directly.

wait_until

Use wait_until to wait until an event occurred before taking a screenshot or rendering HTML or PDF.

The default value of wait_until is ['load', 'domcontentloaded']. Allowed values are:

  • load: the navigation is successful when the load even is fired;
  • domcontentloaded: the navigation is finished when the DOMContentLoaded even is fired;
  • networkidle0: the navigation is finished when there are no more than 0 network connections for at least 500 ms;
  • networkidle2: consider navigation to be finished when there are no more than 2 network connections for at least 500 ms.

The parameter accepts many values. It means that screenshots will be taken after all events occur altogether.

An example of the request with wait_until=networkidle2&wait_until=domcontentloaded:

https://api.screenshotone.com/take?wait_until=networkidle2&wait_until=domcontentloaded&url=https://example.com/&access_key=<access key>

delay

Specify the delay option in seconds to wait before taking a screenshot or rendering HTML or PDF.

It is suitable when the wait_until option does not work well for you, and you want to ensure that everything is ready.

The default value is 0. It can be more than 30 seconds.

An example of the request with delay=5:

https://api.screenshotone.com/take?delay=5&url=https://example.com/&access_key=<access key>

timeout

Specify timeout (in seconds) of when to abort the request if screenshot or rendering is still impossible. The default and max value is 30.

An example of the request with delay=20:

https://api.screenshotone.com/take?timeout=20&url=https://example.com/&access_key=<access key>

wait_for_selector

Specify wait_for_selector to wait until the element appears in DOM, which is not necessarily visible.

An example of the request with wait_for_selector=.dynamically-loaded-element:

https://api.screenshotone.com/take?wait_for_selector=.dynamically-loaded-element&url=https://example.com/&access_key=<access key>

Caching

Screenshots are cached by the combination of all specified request options. And the cache_key option allows having different cached versions of the same screenshot.

Cached screenshots are not counted by quota and are not logged anywhere. They are served directly from the cache. Screenshots are cached in a combination of Cloudflare CDN and R2 storage (like Amazon S3).

There is a header x-screenshotone-cache-url that provides a direct link to the cached image, PDF or video. The file exist as long as it was defined in the cache_ttl parameter when API request was performed with cache=true.

And if the response_type option is specified as json, you can find a cache URL in the JSON response too:

{
    "cache_url": "https://cache.screenshotone.com/..."
}

What is the benefit of using the cache URL?

  1. You don’t share API keys and don’t complicate your code with signed links.
  2. You control when to regenerate the cache, but a user with a link to the screenshot can’t regenerate it. Because if you shared a link to an API request, once the cache is expired, it would be regenerated.

cache

The cache option enables or disables caching of a screenshot, rendering HTML, or PDF. The default value is false.

The false option forces disabling caching and always generate a free screenshot or render HTML or PDF without caching.

An example of the request with cache=false:

https://api.screenshotone.com/take?cache=false&url=https://example.com/&access_key=<access key>

cache_ttl

The cache_ttl option (in seconds) hints at how long the cached screenshot should be stored. The minimum value is 14400 seconds (4 hours), and the maximum value is 2592000 seconds (one month).

An example of the request with cache_ttl=20000:

https://api.screenshotone.com/take?cache=true&cache_ttl=20000&url=https://example.com/&access_key=<access key>

cache_key

Screenshots are cached by the combination of all specified request options. The cache_key option allows having different cached versions of the same screenshot.

An example of the request with cache_key=2022-07-14:

https://api.screenshotone.com/take?cache=true&cache_key=2022-07-14&url=https://example.com/&access_key=<access key>

Storing

You can use any S3-compatible storage to store screenshots, rendered HTML or PDF to the configured S3 bucket.

In case you don’t care about getting the actual but only want to upload the rendering result to storage, specify response_type=empty.

An example of the request with response_type=empty:

https://api.screenshotone.com/take?response_type=empty&url=https://example.com/&access_key=<access key>

store

Default value is false. Use store=true to trigger upload of the taken screenshot, rendered HTML or PDF to the configured S3 bucket. Make sure you configured access to S3.

An example of the request with store=true:

https://api.screenshotone.com/take?store=true&url=https://example.com/&access_key=<access key>

storage_path

The parameter is required if you set store=true. You must specify the key for the file, but don’t specify an extension, it will be added automatically based on the format you specified.

You can also specify “subdirectories” in the path part.

An example of the request with storage_path=latest/example:

https://api.screenshotone.com/take?store=true&store_path=latest/example&url=https://example.com/&access_key=<access key>

storage_bucket

You can override the default bucket you configured with storage_bucket=<bucket name>.

An example of the request with storage_bucket=temporary:

https://api.screenshotone.com/take?storage_bucket=temporary&store=true&store_path=latest/example&url=https://example.com/&access_key=<access key>

storage_class

The default value is standard.

Storage class allows you to specify the object storage class.

Allowed values:

  • standard;
  • reduced_redundancy;
  • standard_ia;
  • onezone_ia;
  • intelligent_tiering;
  • glacier;
  • deep_archive;
  • outposts;
  • glacier_ir.

An example of the request with storage_class=glacier_ir:

https://api.screenshotone.com/take?storage_class=glacier_ir&store=true&store_path=latest/example&url=https://example.com/&access_key=<access key>

storage_acl

The default value is `` (not set).

Specify the ACL value when uploading the file.

Allowed values:

  • `` (default);
  • public-read.

An example of the request with storage_acl=public-read:

https://api.screenshotone.com/take?storage_acl=public-read&store=true&store_path=latest/example&url=https://example.com/&access_key=<access key>

Metadata

You can extract different properties of the site or a screenshot on demand. They might impact performance, and that’s why they are disabled by default.

metadata_image_size

The default value is false.

Set to true to get the screenshot’s actual image width and height. If response_type is set to json, you can get it from metadata.image_size{width,height} property. Otherwise, read from response headers such as X-ScreenshotOne-Image-Width and X-ScreenshotOne-Image-Height.

Error options

ignore_host_errors

When the site responds within the range of 200-299 status code, you can ignore errors and take a screenshot of the error page anyway. To do that, set the option ignore_host_errors to true. It is false by default.

It is helpful when you want to create a gallery of error pages or, for some reason, you need to render error pages.

error_on_selector_not_found

If a selector is specified and error_on_selector_not_found=true, the error will be returned if the element by selector is not visible or it took more than timeout seconds to render it, but not more than 30 seconds.

Default value is false.