Documentation
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
Parameter | Type | Description |
---|---|---|
html | string | The HTML content to render. Can include inline CSS and JavaScript. |
Optional Parameters
Parameter | Type | Default | Description |
---|---|---|---|
css | string | null | Additional CSS to inject into the page. Useful for keeping styles separate from HTML. |
width | integer | 1440 | Viewport width in pixels. Must be between 1 and 5000. |
height | integer | 900 | Viewport height in pixels. Must be between 1 and 5000. |
fullpage | boolean | false | When true, captures the full page height regardless of viewport height. |
dpi | integer | 1 | Device pixel ratio for the capture. Higher values increase resolution but also processing time. |
webhook_url | string | null | URL to receive the image when ready. Recommended for larger images or higher DPI values. |
ms_delay | integer | null | Adds a delay (in milliseconds) before capturing the image. Useful for animations and dynamic content. |
wait_for_selector | string | null | Waits for a specific CSS selector to be present before capturing. Note: does not work with iframe content. |
Screenshot API Parameters
Required Parameters
Parameter | Type | Description |
---|---|---|
url | string | The URL to capture. Must be a valid, publicly accessible URL. |
Optional Parameters
Parameter | Type | Default | Description |
---|---|---|---|
css | string | null | Additional CSS to inject into the page. Useful for modifying the page appearance. |
width | integer | 1440 | Viewport width in pixels. Must be between 1 and 5000. |
height | integer | 900 | Viewport height in pixels. Must be between 1 and 5000. |
fullpage | boolean | false | When true, captures the full page height regardless of viewport height. |
selector | string | null | CSS selector to capture a specific element instead of the full page. |
dpi | integer | 1 | Device pixel ratio for the capture. Higher values increase resolution but also processing time. |
webhook_url | string | null | URL to receive the image when ready. Recommended for screenshots. |
ms_delay | integer | null | Adds a delay (in milliseconds) before capturing the image. Useful for animations and dynamic content. |
wait_for_selector | string | null | Waits 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.