Get Started
API Documentation
Sync/Async options
Create screenshot async
Queue the creation of a screenshot and call the webhook with the result.
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Page options, either provide the url
, html
or htmlTemplate
option.
URL to go to. Should include the scheme, e.g. https://
HTML to render. Needs to be base64 encoded!
HTML template to render. Needs to be base64 encoded!
Template data, only used in combination with page.htmlTemplate
.
When to consider waiting succeeds.
auto
our smart waiting option that can handle 90% of the cases.load
waits for the 'load' event.domcontentloaded
waits for the 'DOMContentLoaded' event.networkidle0
waits till there are no more than 0 network connections for at least500
ms.networkidle2
waits till there are no more than 2 network connections for at least500
ms.
Wait for a certain amount of milliseconds before the request continues.
The selector of an element to wait for.
Options for configuring waiting behavior.
Wait for the selected element to be present in DOM and to be visibleAn element is considered to be visible if all of the following is true:
- the element has computed styles
- the element has a non-empty bounding client rect
- the element's visibility is not
hidden
orcollapse
Wait for the selected element to not be found in the DOM or to be hidden.An element is considered to be hidden if at least one of the following is true:
- the element has no computed styles
- the element has an empty bounding client rect
- the element's visibility is
hidden
orcollapse
Maximum time to wait in milliseconds.
Wait for the pageFunction
to execute in the page. If the pageFunction
doesn't execute successfully after the timeout
milliseconds of waiting, the request will continue.
Function to be evaluated in browser context until it returns a truthy value.
Options for configuring waiting behavior.
An interval at which the pageFunction
is executed, defaults to raf
. If polling
is a number, then it is treated as an interval in milliseconds at which the function would be executed. If polling
is a string, then it can be one of the following values:
raf
to constantly executepageFunction
inrequestAnimationFrame
callback. This is the tightest polling mode which is suitable to observe styling changes.mutation
to executepageFunction
on every DOM mutation.
Maximum time to wait in milliseconds.
An object containing additional HTTP headers to be sent with every request. All header values must be strings.
Use our build-in adblocker.
Whether or not to enable JavaScript on the page.
Cookies added to the page, Also accepted as string inside headers.cookie
.
Provide credentials for HTTP authentication
.
Color-scheme to set on the page.
Changes the CSS media type of the page.
Changes the timezone of the page. See ICU’s metaZones.txt for a list of supported timezone IDs.
Device preset to use, will not be set when viewport
option is provided!
Define an custom viewport, when defined the device
option will be ignored!
The page width in CSS pixels.
The page height in CSS pixels.
Specify device scale factor. See devicePixelRatio for more info.
Whether the meta viewport
tag is taken into account.
Specify if the viewport supports touch events.
Specifies if the viewport is in landscape mode.
When true
, takes a screenshot of the full page.
Capture the screenshot from the surface, rather than the view.
Hides default white background and allows capturing screenshots with transparency.
Quality of the image, between 0-100. Not applicable to png
images.
Capture the screenshot beyond the viewport. false
if there is no clip
. true
otherwise.
Specifies the region of the page to clip.
The width of the element in pixels.
The height of the element in pixels.
It captures the DOM element matching the given CSS selector. This will overwrite the clip
property and set fullPage
to false
.
Add an overlay to the image. Cannot be used together with the fullPage
option!
Color to apply as background, can be an an hexadecimal/rgb/rgba color code or CSS gradient.
Apply CSS Filter to background.
Margin to apply.
Browser to apply.
The border radius, specified in CSS pixels, is applied to the screenshot only when the device
option is not set.
Pre-signed url to upload the generated pdf/screenshot to. Should include the scheme, e.g. https://
Webhook to call when screenshot is generated.
The way this webhook wants to receive the result.
- When
URL
is used an temporary URL will be provided to download the file (the file will be automatically deleted after 1 hour). - When
base64
is used make sure your webhook can receive the size of the file!
The webhook's URL. Should include the scheme, e.g. https://
Method to use when calling the webhook.
An object containing additional HTTP headers to be sent with the webhook. All header values must be strings.
Additional metadata that will be inside the request when the webhook is called. All values must be strings. Max 1kB.
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
Page options, either provide the url
, html
or htmlTemplate
option.
Webhook to call when screenshot is generated.
Response
Id of the queued job.
Status of the job.
PENDING
, RUNNING
, FAILED
, COMPLETED
Was this page helpful?