# 🎚️ API Options

Along with your request to SpeedyShot, you'll have to specify what you want the service to capture. Depending on your type of request, different parameters can be used.

✳️ This symbol indicates the parameter is a mandatory parameter.


# Mandatory Options

# ✳️ output

Parameter Name
Value Type
output

✳️string

Description

One of: jpeg, webp, pdf, html, or text depending on your desired result.

  • jpeg: Used to generate .jpeg screenshots of desired content.
  • webp: Used to generate .webp screenshots of desired content - these images are optimized for use on websites.
  • pdf: Used to generate .pdf files of desired content.
  • html: Used to crawl the loaded page's html contents.
  • text: Used to crawl the loaded page's text contents.

# ✳️ url

Parameter Name
Value Type
url

✳️string

Description

The URL of the page which you would like to generate a capture for.


# ✳️ htmlContent

Parameter Name
Value Type
htmlContent

✳️string

Description

The HTML Contents of the page which you would like to generate a capture for.


# Extra Options

# emulateDevice

Parameter Name
Value Type
emulateDevice

string

One of the devices listed in the following page.

Devices List
../devices/
⚠️ case, and space sensitive!

Compatible with output types
  • jpeg
  • webp
  • pdf
  • text
  • html
Description

Emulate a mobile device by name. This automatically sets the correct resolution, scale, width, height and so on, to match the device's settings.

Defaults to undefined (no emulation).

Example value: iPhone 13 Pro Max landscape.


# width

Parameter Name
Value Type
width

number

Maximum 7680

Compatible with output types
  • jpeg
  • webp
  • pdf
  • text
  • html
Description

Specify the width of the viewport during capture.


# height

Parameter Name
Value Type
height

number

Maximum 4320

Compatible with output types
  • jpeg
  • webp
  • pdf
  • text
  • html
Description

Specify the height of the viewport during capture.


# scale

Parameter Name
Value Type
scale

number

A value between 0.1 and 2.

Compatible with output types
  • jpeg
  • webp
  • pdf
Description

Specify the scale during capture. This can make the image size smaller, or larger, depending on the factor.

Defaults to 1.5 in order to increase output quality.


# omitBackground

Parameter Name
Value Type
omitBackground

boolean

Compatible with output types
  • jpeg
  • webp
  • pdf
Description

Attempt to hide the default white background, and allows transparent captures.

Defaults to false.


# isMobile

Parameter Name
Value Type
isMobile

boolean

Compatible with output types
  • jpeg
  • webp
  • pdf
  • text
  • html
Description

If true, the meta viewport tag will not be taken into account.

Defaults to false.


# hasTouch

Parameter Name
Value Type
hasTouch

boolean

Compatible with output types
  • jpeg
  • webp
  • pdf
  • text
  • html
Description

If true, the viewport will support touch events.

Defaults to false.


# isLandscape

Parameter Name
Value Type
isLandscape

boolean

Compatible with output types
  • jpeg
  • webp
  • pdf
  • text
  • html
Description

If true, the viewport will be in landscape mode.

Defaults to false.


# authentication

Parameter Name
Value Type
authentication

object

{
  "username": string,
  "password": string
}
Compatible with output types
  • jpeg
  • webp
  • pdf
  • text
  • html
Description

Basic HTTP authentication to be used when navigating to the given website.

Defaults to undefined (no authentication).


# cookies

Parameter Name
Value Type
cookies

list

[
  {
    "name": string-mandatory,
    "value": string-mandatory,
    "url": string,
    "domain": string,
    "path": string,
    "expires": number-unix-time-in-seconds,
    "httpOnly": boolean,
    "secure": boolean,
    "sameSite": 'Strict' or 'Lax'
  },
  ...
]
Compatible with output types
  • jpeg
  • webp
  • pdf
  • text
  • html
Description

The cookies to be set when navigating to the given website.

The minimum required parameters are name, value and either url or domain.

⚠️ Without url or domain the cookie will not be set.

Defaults to undefined (no cookies).


# headers

Parameter Name
Value Type
headers

object

{
  "x-my-header": string,
  "x-another-header": string,
  ...
}
Compatible with output types
  • jpeg
  • webp
  • pdf
  • text
  • html
Description

The HTTP headers to be set when navigating to the given website.

Defaults to undefined (no headers).


# geolocation

Parameter Name
Value Type
geolocation

object

{
  "latitude": number,
  "longitude": number
}
Compatible with output types
  • jpeg
  • webp
  • pdf
  • text
  • html
Description

The geolocation coordinates to be set when navigating to the given website.

Defaults to undefined (random geolocation).


# userAgent

Parameter Name
Value Type
userAgent

string

Compatible with output types
  • jpeg
  • webp
  • pdf
  • text
  • html
Description

The user agent string to be used when navigating to the given website.

Defaults to undefined (headless Chrome user agent).


# waitForItems

Parameter Name
Value Type
waitForItems

list - (string|number)[]

[
  string, // Selector
  number, // Timeout in ms
  ...
]
Compatible with output types
  • jpeg
  • webp
  • pdf
  • text
  • html
Description

Any items you would like to wait for after the page has loaded.

This is a list of either a:

  • Selector
  • Timeout

A selector could for example be .intro-image, but it also supports XPath, for example: //*[@id=\"root\"]/div/div/div[1]/div[1]/a/span.

For more information on CSS Selectors, see the following resource.

CSS Selectors
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors

When using a selector, the browser will wait for that item to appear on the page.

When using a timeout, the browser will wait for the given extra time before returning the result.

Defaults to [] empty list (no waitForItems).


# disableJavascript

Parameter Name
Value Type
disableJavascript

boolean

Compatible with output types
  • jpeg
  • webp
  • pdf
  • text
  • html
Description

Allows you to disable Javascript on the browser.

Defaults to false.


# enableOfflineMode

Parameter Name
Value Type
enableOfflineMode

boolean

Compatible with output types
  • jpeg
  • webp
  • pdf
  • text
  • html
Description

Allows you to enable the offline mode.

Do note, this option will not work with the url parameter, as that requires an internet connection.

However, you can use this parameter along with the htmlContent parameter, if you want to make sure no online requests are made for this capture.

Defaults to false.


# loadUntil

Parameter Name
Value Type
loadUntil

string

One of

  • networkidle2
  • networkidle0
  • domcontentloaded
  • load
Compatible with output types
  • jpeg
  • webp
  • pdf
  • text
  • html
Description

After navigation, until what event should the browser wait?

  • networkidle2: Until there are no more than 2 network connections for at least 500ms
  • networkidle0: Until there are no more than 0 network connections for at least 500ms
  • domcontentloaded: When the DOMContentLoaded event is fired
  • load: When the load event is fired

Defaults to networkidle2.

We recommend experimenting with this value to optimise the processing time and your desired output.


# proxy

Parameter Name
Value Type
proxy

string

Compatible with output types
  • jpeg
  • webp
  • pdf
  • text
  • html
Description

The proxy server connection string to be used for navigation.

For example https://proxy-ip:proxy-port.

Defaults to undefined (no proxy server).


# consoleOutput

Parameter Name
Value Type
consoleOutput

boolean

Compatible with output types
  • jpeg
  • webp
  • pdf
  • text
  • html
Description

Whether the console output should be returned as part of the response.

If set to true, the console output will be available in responseBody.consoleOutput.

Defaults to false (no console output).


# autoScroll

Parameter Name
Value Type
autoScroll

boolean

Compatible with output types
  • jpeg
  • webp
  • pdf
  • text
  • html
Description

Some websites don't fully load the entire web page's content unless the user scrolls down. Setting this value to true will simulate such a user scroll in an attempt to load all the page data before the SpeedyShot capture occurs.

Do note that using the automatic scroll adds some extra processing time, and may cause very long pages to fail.

Defaults to false (no scroll).


# hideAds

Parameter Name
Value Type
hideAds

boolean

Compatible with output types
  • jpeg
  • webp
  • pdf
  • text
  • html
Description

Use the in-built SpeedyShot ad blocker to hide ads on the page.

If your page is ads-heavy, this can help you get a cleaner and faster capture. However, if your page does not have any ads, enabling this feature can slow down the capture. We estimate an impact around 500-1500ms to your capture.

We recommend only enabling this feature if you know the page you are capturing has ads, or if adding a second of processing time is not an issue.

Defaults to false (no hiding of ads).


# hideCookieBanners

Parameter Name
Value Type
hideCookieBanners

boolean

Compatible with output types
  • jpeg
  • webp
  • pdf
  • text
  • html
Description

Enables you to hide cookie banners on the page, allowing for a cleaner capture.

Please note that this is a very effective best effort mechanism and we are improving this feature over time. If you notice any cookie banners still appearing, please let us know and we can improve it on a case-by-case basis.

This adds a slight processing time to your request, estimated around 600ms.

Defaults to false (no hiding of cookie banners).


# ✴️ extraScripts

Parameter Name
Value Type
extraScripts

list

[
  {
    "url": string
  },
  {
    "content": string
  }
]
Compatible with output types
  • jpeg
  • webp
  • pdf
  • text
  • html
Description

Extra script files to inject into the webpage.

These can either come from a URL, or from JavaScript inlined in the request.

For adding a script from URL, use the url parameter as shown.

For inline script content, use the content parameter as shown.

Defaults to undefined (no extra scripts).


# ✴️ extraStyles

Parameter Name
Value Type
extraStyles

list

[
  {
    "url": string
  },
  {
    "content": string
  }
]
Compatible with output types
  • jpeg
  • webp
  • pdf
  • text
  • html
Description

Extra styling files to inject into the webpage.

These can either come from a URL, or from inlined CSS in the request.

For adding a style from URL, use the url parameter as shown.

For inlined styles content, use the content parameter as shown.

Defaults to undefined (no extra styles).

# Storage Options

Storage options below are optional, but allow the resulting request to be saved directly to your AWS S3 Compatible storage.

If setting up custom storage, the following parameters are the minimum required:

  • storageAuthKey
  • storageAuthSecretKey
  • storageBucket
  • storageFilePath
  • storageRegion
  • storageEndpoint

# storageAuthKey

Parameter Name
Value Type
storageAuthKey

string

Compatible with output types
  • jpeg
  • webp
  • pdf
Description

An AWS Access Key ID to access your S3-Compatible storage


# storageAuthSecretKey

Parameter Name
Value Type
storageAuthSecretKey

string

Compatible with output types
  • jpeg
  • webp
  • pdf
Description

An AWS Secret Access Key to access your S3-Compatible storage


# storageBucket

Parameter Name
Value Type
storageBucket

string

Compatible with output types
  • jpeg
  • webp
  • pdf
Description

The S3-compatible Bucket name to store the results into


# storageRegion

Parameter Name
Value Type
storageRegion

string

Compatible with output types
  • jpeg
  • webp
  • pdf
Description

The region of the S3-compatible storage to store the results into


# storageEndpoint

Parameter Name
Value Type
storageEndpoint

string

Compatible with output types
  • jpeg
  • webp
  • pdf
Description

The endpoint of the S3-compatible storage to store the results into, get this from your S3-Compatible storage provider.


# storageFilePath

Parameter Name
Value Type
storageFilePath

string

Compatible with output types
  • jpeg
  • webp
  • pdf
Description

The file path to store the results into. If not set, the file will be stored in the root of the bucket.

# Image Specific Options

# fullPage

Parameter Name
Value Type
fullPage

boolean

Compatible with output types
  • jpeg
  • webp
Description

Whether SpeedyShot should capture a full page capture. Defaults to false.

If true, then the height attribute will be ignored, to be able to capture the full page.


# clip

Parameter Name
Value Type
clip

object

{
  "x": number,
  "y": number,
  "width": number,
  "height": number
}
Compatible with output types
  • jpeg
  • webp
Description

This parameter allows you to clip the screen capture to a specific chosen area, using x-y coordinates and the desired width-height of the capture.


# captureBeyondViewport

Parameter Name
Value Type
captureBeyondViewport

boolean

Compatible with output types
  • jpeg
  • webp
Description

If true, the capture can contain items outside of the viewport. If false, the capture is cut to match the viewport size.

Defaults to true.


# quality

Parameter Name
Value Type
quality

number between 1 and 100.

Compatible with output types
  • jpeg
Description

The quality of the output image can be reduced in order to create smaller file-sizes.

Defaults to 99 to optimize output file sizes. Lower this to decrease file size.

# PDF Specific Options

# pdfFormat

Parameter Name
Value Type
pdfFormat

string

One of:

  • a0
  • a1
  • a2
  • a3
  • a4
  • a5
  • a6
  • Letter
  • Legal
  • Tabloid
  • Ledger
Compatible with output types
  • pdf
Description

The output format/size for the PDF to be used.

Defaults to a4.


# printBackground

Parameter Name
Value Type
printBackground

boolean

Compatible with output types
  • pdf
Description

If true, the background graphics will also be printed.

Defaults to false.

# Text/HTML Specific Options

# encoding

Parameter Name
Value Type
encoding

string

Must be equal to:

  • inline
Compatible with output types
  • text
  • html
Description

The delivery method of the generated result. For other output types, a fileUrl is usually presented.

However, for text and HTML, the result is printed out in the response body.

In the future, we will also provide the option to work with file outputs for such requests. This is why we require to set the encoding to inline. This way we can ensure backwards-compatibility.

Defaults to inline.