Skip to main content

Navigation Options

You can use the gotoOptions to modify the default navigation behavior for the requested URL. The objects mirror Puppeteer's GoToOptions interface.

Rest API (Without Stealth)

Here’s the request in the specified format, with examples for curl, JavaScript, Python, Java and C#.

Bot detection

Browserless recommends using our REST API to generate PDFs, unless you need to get past bot detectors.

curl -X POST \
https://production-sfo.browserless.io/pdf?token=YOUR_API_TOKEN_HERE \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{
"url": "https://example.com/",
"gotoOptions": { "waitUntil": "networkidle2" }
}'

BQL (Stealth)

If the /pdf API is getting blocked by bot detectors, then we would recommend trying BrowserQL.

mutation PDF {
goto(url: "https://browserless.io/" waitUntil: networkIdle) {
status
}

pdf(displayHeaderFooter: true, printBackground: false, format: a0) {
base64
}
}
BQL Schemas

For more details on BQL mutations, refer to the BrowserQL Schema reference pages.