Overview
Captures a PNG of the session’s active page and returns it base64-encoded. Supports viewport, full-page, and element-bounded capture via a CSS selector.
Path Parameters
Browser session ID (UUID).
Body
Optional URL to navigate to before capturing.
When true, capture the full scrollable document height instead of just the viewport.
CSS selector of an element to capture. Clipped to the element’s bounding box.
Example Request
cURL (viewport)
cURL (full page)
curl -X POST "https://api.scrapengine.io/api/v1/browser/sessions/baa3f390-fa6e-4a24-b84a-a575a5f3a9c7/screenshot" \
-H "Authorization: Bearer $SCRAPENGINE_API_KEY " \
-H "Content-Type: application/json" \
-d '{}'
Response
Success Response (200)
Base64-encoded PNG bytes.
Effective URL after any redirects.
Screenshot width in pixels.
Screenshot height in pixels.
Example Response:
{
"url" : "https://example.com/" ,
"image" : "iVBORw0KGgoAAAANSUhEUgAA..." ,
"width" : 1920 ,
"height" : 1080
}
Error Responses
Status Description 400Invalid body — bad selector or unreachable URL. 401Unauthorized — invalid or missing API key. 404Session not found, or selector matched no visible element. 503The browser session is temporarily unreachable.