Web Screenshot Service
Learn how to use the Web Screenshot Service to capture website screenshots using Playwright.
Overview
The Web Screenshot Service provides website screenshot capabilities using Playwright. The service allows you to capture full-page screenshots of any website with configurable viewport dimensions.
Endpoints
Take Website Screenshot
The screenshot endpoint captures a screenshot of the specified website and returns it in base64 encoded PNG format.
API Endpoint
Endpoint Parameters
Here is an overview of the parameters that are used by the endpoint for capturing screenshots.
Request
url
(string, required)
The URL of the website to capture. Must be a valid, accessible URL including the protocol (http:// or https://).
viewport_width
(integer, optional)
Width of the browser viewport in pixels. Default: 1920
viewport_height
(integer, optional)
Height of the browser viewport in pixels. Default: 1080
Response
status
(string)
Status of the screenshot operation:
success
: Screenshot captured successfullyerror
: Screenshot capture failed
data
(object)
Contains the screenshot data when status is 'success':
screenshot
(string): Base64 encoded PNG imageformat
(string): Image format (always 'png')viewport
(object):width
(integer): Actual viewport width usedheight
(integer): Actual viewport height used
error
(string)
Error message when status is 'error'
Examples
Below are examples demonstrating different ways to use the screenshot service.
Request
Basic Screenshot
Custom Viewport Screenshot
Response
Successful Screenshot
Error Response