# Step 1: start browserless chrome
docker run -d -p 3000:3000 --name browserless whatwewant/browserless-chrome:v1-0
# Step 2: start puppeteer service
docker run -d -p 8080:8080 --name puppeteer-as-a-service \
-e BROWSER_WS_ENDPOINT=ws://browserless:3000 \
whatwewant/puppeteer:latest
Params
url: The URL to site url
format: The format of the outputted PDF
required: false
default: A4
curl -X POST \
http://localhost:8887/pdf \
-H ' Content-Type: application/json' \
-d ' {
"url": "https://www.baidu.com"
}'
2. Generate Screenshot (Image)
Params
url: The URL to site url
fullPage: When true, takes a screenshot of the full scrollable page
required: false
default: true
encoding: The encoding of the image, can be either base64 or undefined
required: false
default: none
available: base64 | undefined
width: The width of the image
height: The height of the image
curl -X POST \
http://localhost:8080/image \
-H ' Content-Type: application/json' \
-d ' {
"url": "https://www.baidu.com"
}'