About this endpoint
What it does
Renders a web page, raw HTML or Markdown in Chromium and returns a PNG or JPEG screenshot. Set the viewport, wait for content, and pick how the image comes back.
Request Body
| Parameter | Type | Description |
|---|---|---|
| url | String | Required if html and markdown are not set. Public web page to capture. Must be http or https. Max length 2083 characters. Provide exactly one of url, html or markdown. |
| html | String | Required if url and markdown are not set. Raw HTML to render and capture. Max length 500000 characters. |
| markdown | String | Required if url and html are not set. Markdown to convert to HTML, render and capture. Max length 500000 characters. |
| image_format | String | Image format. Allowed values: png, jpeg. Default: png. |
| response_mode | String | How the image is returned. Allowed values: binary, base64, json, url. Default: binary. |
| filename | String | Name of the image file. Default: screenshot.png. Max length 255 characters. |
| width | Integer | Viewport width in pixels. Range: 100 to 10000. Default: 1280. |
| height | Integer | Viewport height in pixels. Range: 100 to 10000. Default: 720. |
| full_page | Boolean | Capture the full scrollable page, not only the viewport. Default: false. |
| custom_css | String | CSS injected into the page before capture. Max length 200000 characters. |
| style_url | String | Public URL of a CSS file to load before capture. Max length 2048 characters. |
| script_url | String | Public URL of a JavaScript file to load before capture. Max length 2048 characters. |
| scripts | String Array | Inline scripts or script URLs to run before capture. |
| execute_javascript | Boolean | Run the page's JavaScript before capture. Default: true. |
| wait_until | ENUM | When the page counts as loaded. Allowed values: load, domcontentloaded, networkidle, networkidle0, networkidle2. Default: networkidle. |
| wait_for_selector | String | CSS selector to wait for before capture. Max length 256 characters. |
| wait_for_function | String | JavaScript expression to wait for until it is true. Max length 200000 characters. |
| wait_for_timeout | Integer | How long to wait for the selector or function, in milliseconds. Range: 0 to 300000. |
| timeout | Integer | Load and capture timeout in milliseconds. Range: 1000 to 180000. Default: 30000. |
| auth_type | ENUM | Login used when loading url. Allowed values: none, basic, bearer. Default: none. |
| auth_credentials | String | Login value for auth_type: username:password for basic, the token for bearer. Max length 2048 characters. |
| extra_headers | Object | Extra HTTP headers sent when loading url. |
| cookies | Object Array | Cookies set in the browser before loading the page. |
Response
Returns the image in the shape set by response_mode. In json mode, returns a JSON object with the image and its metadata.
| Parameter | Type | Description |
|---|---|---|
| filename | String | Name of the image file. |
| size | Integer | Size of the image in bytes. |
| created_at | String | UTC timestamp when the image was created. |
| image_base64 | String | Base64-encoded image. |
Notes
- Provide exactly one of
url,htmlormarkdown. binaryreturns the image file itself, not JSON.base64returns onlyfilenameandimage_base64.urlreturnsfile_url,expires_atandexpires_in_seconds. The link needs no authentication and stops working after it expires.- The request body must be under 5 MB. Larger bodies return
413. - A capture that runs past
timeoutreturns504. url,style_url,script_urlandscriptsmust be public addresses.



