Learn how to use the Screenshot Service API.
The base endpoint for taking screenshots is:
GET /screenshot
url
(string, required)
The full URL of the website to capture (e.g., https://example.com
).
width
(integer, optional)
Viewport width in pixels. Default: 1280
. Min: 320
, Max: 3840
.
height
(integer, optional)
Viewport height in pixels. Default: 800
. Min: 320
, Max: 3840
.
wait
(integer, optional)
Time in milliseconds to wait after page load before taking the screenshot. Default: 0
.
fullPage
(boolean, optional)
Set to true
to capture the entire page height. Default: false
.
format
(string, optional)
Output image format. Options: png
, jpeg
. Default: png
.
Here's an example using curl
:
curl "https://screenshot--api.com/screenshot?url=https://cloudflare.com&width=1920&height=1080&format=jpeg&wait=1000" -o cloudflare_screenshot.jpg
Replace https://screenshot--api.com
with the actual URL of your deployed worker.
The API is currently limited to 3 free screenshots per IP address per day.
If you exceed the limit, you will receive a 429 Too Many Requests
response.
(Paid plans coming soon!)