API Parameters

This page provides an overview of all available parameters for both the HTML/CSS API and Screenshot API. Click on any parameter to see detailed examples and usage information.

HTML/CSS API Parameters

Required Parameters

ParameterTypeDescription
htmlstringThe HTML content to render. Can include inline CSS and JavaScript.

Optional Parameters

ParameterTypeDefaultDescription
cssstringnullAdditional CSS to inject into the page. Useful for keeping styles separate from HTML.
widthinteger1440Viewport width in pixels. Must be between 1 and 5000.
heightinteger900Viewport height in pixels. Must be between 1 and 5000.
fullpagebooleanfalseWhen true, captures the full page height regardless of viewport height.
dpiinteger1Device pixel ratio for the capture. Higher values increase resolution but also processing time.
webhook_urlstringnullURL to receive the image when ready. Recommended for larger images or higher DPI values.
ms_delayintegernullAdds a delay (in milliseconds) before capturing the image. Useful for animations and dynamic content.
wait_for_selectorstringnullWaits for a specific CSS selector to be present before capturing. Note: does not work with iframe content.

Screenshot API Parameters

Required Parameters

ParameterTypeDescription
urlstringThe URL to capture. Must be a valid, publicly accessible URL.

Optional Parameters

ParameterTypeDefaultDescription
cssstringnullAdditional CSS to inject into the page. Useful for modifying the page appearance.
widthinteger1440Viewport width in pixels. Must be between 1 and 5000.
heightinteger900Viewport height in pixels. Must be between 1 and 5000.
fullpagebooleanfalseWhen true, captures the full page height regardless of viewport height.
selectorstringnullCSS selector to capture a specific element instead of the full page.
dpiinteger1Device pixel ratio for the capture. Higher values increase resolution but also processing time.
webhook_urlstringnullURL to receive the image when ready. Recommended for screenshots.
ms_delayintegernullAdds a delay (in milliseconds) before capturing the image. Useful for animations and dynamic content.
wait_for_selectorstringnullWaits for a specific CSS selector to be present before capturing. Note: does not work with iframe content.

When using the Screenshot API, we strongly recommend using the webhook_url parameter due to unpredictable page load times. See the webhook_url documentation for more details.

Higher DPI values (2-4) significantly increase processing time and memory usage. For most use cases, a DPI of 1 provides sufficient quality. See the DPI documentation for more details.