For AI agents: a documentation index is available at /llms.txt
Skip to main content

Take a Screenshot

Capture any webpage as a PNG or JPEG using the Browserless screenshot API.

Prerequisites

Steps

Use the /screenshot REST endpoint to capture a page as a PNG or JPEG. No WebSocket connection needed.

View Full Code on GitHub

1. Build the request

Append your token to the screenshot endpoint:

https://production-sfo.browserless.io/screenshot?token=YOUR_API_TOKEN_HERE

2. Send the request

curl -X POST \
"https://production-sfo.browserless.io/screenshot?token=YOUR_API_TOKEN_HERE" \
-H 'Cache-Control: no-cache' \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"options": { "fullPage": true, "type": "png" }
}' \
--output screenshot.png

3. Check the output

The response is a raw PNG binary written to screenshot.png in the current directory.

Next steps