Screenshot API: create
POST /api/v1/{token}/screenshot/create
The Screenshot Create method captures a screenshot of a specified website URL. You
can customize the virtual browser's width and height, choose to emulate a
mobile device, and specify the output image format as either JPEG or PNG.
To receive the webpage as PDF document specify format PDF.
Additionally, the resulting image can be resized to your desired dimensions,
providing flexible options for generating website thumbnails or screenshots.
| Parameter | Type | Default | Description |
|---|---|---|---|
| url (required) | string | The website URL to capture. Supported schemes: http and https. | |
| theme | string | light |
The browser theme to use.
light|dark |
| browser_width | int | 1600 |
Width of the virtual browser viewport in pixels.
Range: 600 .. 1920 |
| browser_height | int | 900 |
Height of the virtual browser viewport in pixels.
Range: 400 .. 8000 |
| delay | int | 2500 |
Milliseconds to wait after page load before capturing the screenshot. Allows all resources and scripts to finish loading. Minimum 3000 ms if hide_cookie_popups is true.
Range: 0 .. 5000 |
| format | string | png |
The desired output of the image.
jpeg|png|pdf |
| jpeg_quality | int | 95 |
JPEG quality (1-100) for the output image. Used only if format=jpeg.
Range: 1 .. 100 |
| image_width | int |
Width in pixels to resize the image before sending. If only one dimension is provided, the other is auto-calculated to preserve aspect ratio.
Range: 32 .. 1920 |
|
| image_height | int |
Height in pixels to resize the image before sending. If only one dimension is provided, the other is auto-calculated to preserve aspect ratio.
Range: 32 .. 8000 |
|
| mobile | bool | false |
If true, renders the screenshot with a mobile browser user agent and viewport settings.
false|true |
| hide_cookie_popups | bool | false |
If true, attempts to hide cookie popups on the page. Best used with a delay of 3000 ms or higher.
false|true |
| full_page | bool | false |
If true, captures a screenshot of the entire page (up to 8000px height).
false|true |
Example create requests:
Capture a screenshot of https://example.com using all default options.
curl -o example.png "https://api.eu-west.hqapi.com/api/v1/YourToken01/screenshot/create?url=https%3A%2F%2Fexample.com%2F"
The response:
Capture a screenshot with viewport 1024x768 and resize output to 640x480 PNG.
curl -o example.png -X POST --data '{"url":"https://example.com/","browser_width":"1024","browser_height":"768","image_width":"640","image_height":"480","format":"png"}' \
"https://api.eu-west.hqapi.com/api/v1/YourToken01/screenshot/create"
The response:
Capture a mobile-rendered screenshot of https://wikipedia.org.
curl -o example.png -X POST --data '{"url":"https://wikipedia.org/","mobile":true}' \
"https://api.eu-west.hqapi.com/api/v1/YourToken01/screenshot/create"
The response:
Capture a mobile screenshot of https://wikipedia.org resized to 100px width.
curl -o example.png -X POST --data '{"url":"https://wikipedia.org/","mobile":true,"image_width":100}' \
"https://api.eu-west.hqapi.com/api/v1/YourToken01/screenshot/create"
The response:
Capture a PDF document of https://wikipedia.org.
curl -o example.pdf -X POST --data '{"url":"https://wikipedia.org/","format":"pdf"}' \
"https://api.eu-west.hqapi.com/api/v1/YourToken01/screenshot/create"
The response:
Content-type: application/pdf



