Request Options

Created by Danny Chu, Modified on Tue, 26 Jul, 2022 at 2:39 PM by Danny Chu

 

Parameters:


file_type
string
File type for the file (If output is not set to json), the options include PNGJPGWebP, and PDFThe default is PNG
omit_background
boolean
Omit background (If using PNG as the file_type only) removes the background from websites with a basic white background and makes it transparent. Default is false.
destroy_screenshotbooleanIf true, the screenshot will not be stored on our server after render. The resulting screenshot (or PDF) must be deleted (destroyed) when it's rendered as it will not be available again. Default is false
fail_on_errorbooleanIf fail on error is set to true, then the API will return an error if the render encounters a 4xx or 5xx status code. Default is false
longitudenumberThe longitude to use with the browser's Geolocation API. Default is null
latitudenumberThe latitude to use with the browser's Geolocation API. Default is null
proxystringUse an address for a proxy server for the request. Example: address:port or username:password@address:portDefault: ''
no_cookie_bannersstringBlock or hide cookie banners on websites as the request loads before render. Default is false
block_adsbooleanBlock ad requests from common and popular ad-networks from loading the request before the render. Default is false
headersstringSets the header or headers when the request is being loaded before the render. This works for single or multiple headers. Example: X-HEADER: value; X-OTHER_HEADERL otherValue;Default is ''
cookiesstringSets the cookie or cookies when the request is being loaded before the render. This works for single or multiple cookies. Example: cookie=value;otherCookie=otherValue;Default is ''
scroll_to_elementstringTarget a specific element for the browser to scroll to before the render. This is useful if a given element is only loaded in the viewport. Default is ''
selectorstringSpecify the target for the render based on a element with a matching selector. If the element is not found, a render of the results is still returned. Example: div > .main-navigation > .logoDefault is ''
cssstringCSS code injected into the render. Default is ''
css_urlstringURL for CSS code injected into the render. Default is ''
ttlintegerTTL (Time to Live) sets the number of seconds to keep a rendered screenshot (or PDF) in the cache. Default is 30 days or 2592000 seconds
user_agentstringSets the User-Agent string for the render for a particular request. Default is ''
accept_languagesstringSets the Accept-Language header on the request for the specified URL rendered. Default isen-US,en;q=0.8
delayintegerTime delay in milliseconds (ms) before the screenshot is rendered from the browser instance (this includes PDFs). Default is 0
thumbnail_widthintegerThe width in pixels of the thumbnail generated from the render. If not set, the fallback behavior is the outputted screenshot. Default is null
outputstringSet the output of the results from the render. The output can be either JSON or the raw image captured. Default is image
freshstringTake a fresh screenshot or render (or PDF) vs. getting the version cached version within the app's storage. Default is false 
lazy_loadbooleanIf lazy load is set to true, the browser will cross down the entire page to ensure all content is loaded in the render. Default is false
full_pagebooleanCapture the full page of a website vs. the scrollable area that is visible in the viewport upon render. Default is false
retinabooleanRetina or a high definition equivalent for a device that sets the pixel ratio to 2X. This option will cause the screenshot processing time to go up due to processing of the larger images. Default is false
heightintegerViewport height in pixels of the browser render. Default is 867
widthintegerViewport width in pixels of the browser render. Default is 1680
custom_htmlstringProvide custom HTML that should be rendered. This will override the URL option and take a screenshot of the following HTML output. Default is ''
urlstringThe URL of the website for the screenshot / render
tokenstringYour API key for Screenshot API


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article