#
🎚️ 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
output
✳️string
One of: jpeg, webp, pdf, html, or text depending on your desired result.
jpeg: Used to generate.jpegscreenshots of desired content.webp: Used to generate.webpscreenshots of desired content - these images are optimized for use on websites.pdf: Used to generate.pdffiles of desired content.html: Used to crawl the loaded page'shtmlcontents.text: Used to crawl the loaded page's text contents.
#
✳️ url
Either url or htmlContent is a required parameter. They cannot be used together.
url
✳️string
The URL of the page which you would like to generate a capture for.
#
✳️ htmlContent
Either url or htmlContent is a required parameter. They cannot be used together.
htmlContent
✳️string
The HTML Contents of the page which you would like to generate a capture for.
#
Extra Options
#
emulateDevice
emulateDevice
jpegwebppdftexthtml
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
width
number
Maximum 7680
jpegwebppdftexthtml
Specify the width of the viewport during capture.
#
height
height
number
Maximum 4320
jpegwebppdftexthtml
Specify the height of the viewport during capture.
#
scale
scale
number
A value between 0.1 and 2.
jpegwebppdf
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.
This is a great way to improve image quality, by increasing the scale.
#
omitBackground
omitBackground
boolean
jpegwebppdf
Attempt to hide the default white background, and allows transparent captures.
Defaults to false.
#
isMobile
isMobile
boolean
jpegwebppdftexthtml
If true, the meta viewport tag will not be taken into account.
Defaults to false.
#
hasTouch
hasTouch
boolean
jpegwebppdftexthtml
If true, the viewport will support touch events.
Defaults to false.
#
isLandscape
isLandscape
boolean
jpegwebppdftexthtml
If true, the viewport will be in landscape mode.
Defaults to false.
#
authentication
authentication
object
{
"username": string,
"password": string
}
jpegwebppdftexthtml
Basic HTTP authentication to be used when navigating to the given website.
Defaults to undefined (no authentication).
#
cookies
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'
},
...
]
jpegwebppdftexthtml
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
headers
object
{
"x-my-header": string,
"x-another-header": string,
...
}
jpegwebppdftexthtml
The HTTP headers to be set when navigating to the given website.
Defaults to undefined (no headers).
#
geolocation
geolocation
object
{
"latitude": number,
"longitude": number
}
jpegwebppdftexthtml
The geolocation coordinates to be set when navigating to the given website.
Defaults to undefined (random geolocation).
#
userAgent
userAgent
string
jpegwebppdftexthtml
The user agent string to be used when navigating to the given website.
Defaults to undefined (headless Chrome user agent).
#
waitForItems
waitForItems
list - (string|number)[]
[
string, // Selector
number, // Timeout in ms
...
]
jpegwebppdftexthtml
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.
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).
Waiting for non-existing selectors, or for a high timeout can cause the request to timeout.
We only recommend using this feature for fixing load/wait-related issues with pages.
#
disableJavascript
disableJavascript
boolean
jpegwebppdftexthtml
Allows you to disable Javascript on the browser.
Defaults to false.
Disabling javascript can cause issues with some websites.
#
enableOfflineMode
enableOfflineMode
boolean
jpegwebppdftexthtml
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.
Enabling offline mode can cause potential timeout issues, as the website might have difficulties fully loading.
#
loadUntil
loadUntil
string
One of
networkidle2networkidle0domcontentloadedload
jpegwebppdftexthtml
After navigation, until what event should the browser wait?
networkidle2: Until there are no more than 2 network connections for at least500msnetworkidle0: Until there are no more than 0 network connections for at least500msdomcontentloaded: When theDOMContentLoadedevent is firedload: When theloadevent is fired
Defaults to networkidle2.
We recommend experimenting with this value to optimise the processing time and your desired output.
#
proxy
proxy
string
jpegwebppdftexthtml
The proxy server connection string to be used for navigation.
For example https://proxy-ip:proxy-port.
Defaults to undefined (no proxy server).
#
consoleOutput
consoleOutput
boolean
jpegwebppdftexthtml
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
autoScroll
boolean
jpegwebppdftexthtml
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
hideAds
boolean
jpegwebppdftexthtml
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
hideCookieBanners
boolean
jpegwebppdftexthtml
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
extraScripts
list
[
{
"url": string
},
{
"content": string
}
]
jpegwebppdftexthtml
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).
✴️ This feature is only available to mega- and giga-tier users.
#
✴️ extraStyles
extraStyles
list
[
{
"url": string
},
{
"content": string
}
]
jpegwebppdftexthtml
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).
✴️ This feature is only available to mega- and giga-tier users.
#
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:
storageAuthKeystorageAuthSecretKeystorageBucketstorageFilePathstorageRegionstorageEndpoint
#
storageAuthKey
storageAuthKey
string
jpegwebppdf
An AWS Access Key ID to access your S3-Compatible storage
#
storageAuthSecretKey
storageAuthSecretKey
string
jpegwebppdf
An AWS Secret Access Key to access your S3-Compatible storage
#
storageBucket
storageBucket
string
jpegwebppdf
The S3-compatible Bucket name to store the results into
#
storageRegion
storageRegion
string
jpegwebppdf
The region of the S3-compatible storage to store the results into
#
storageEndpoint
storageEndpoint
string
jpegwebppdf
The endpoint of the S3-compatible storage to store the results into, get this from your S3-Compatible storage provider.
#
storageFilePath
storageFilePath
string
jpegwebppdf
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
fullPage
boolean
jpegwebp
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
clip
object
{
"x": number,
"y": number,
"width": number,
"height": number
}
jpegwebp
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.
Note: if you use clip, all the parameters are required (x, y, width and height)
#
captureBeyondViewport
captureBeyondViewport
boolean
jpegwebp
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
quality
number between 1 and 100.
jpeg
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
pdfFormat
string
One of:
a0a1a2a3a4a5a6LetterLegalTabloidLedger
pdf
The output format/size for the PDF to be used.
Defaults to a4.
#
printBackground
printBackground
boolean
pdf
If true, the background graphics will also be printed.
Defaults to false.
#
Text/HTML Specific Options
#
encoding
encoding
string
Must be equal to:
inline
texthtml
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.