Skip to main content

Launch Parameters

Launch parameters let you configure the browser environment for every REST API call (/pdf, /screenshot, /content, /scrape, etc.). For BrowserQL and BaaS v2 launch configuration, see BrowserQL Launch Parameters and BaaS Launch Options.

How to Pass Launch Parameters

As Query String Parameters

Append individual parameters directly to the request URL. This is the simplest approach for toggling a few options:

https://production-sfo.browserless.io/screenshot?token=YOUR_API_TOKEN_HERE&headless=false&stealth=true

As a JSON Launch Payload

For complex configurations — especially when passing Chrome flags — use a single &launch= parameter containing a JSON object. Here's the raw JSON for readability:

{
"headless": false,
"stealth": true,
"args": ["--window-size=1920,1080"]
}

Why you must encode the JSON

JSON contains characters like {, ", and : that have special meaning in URLs. If you pass raw JSON directly in a query string, the server won't parse it correctly. You need to either URL-encode or base64-encode the JSON before sending it.

URL-encoded, the above JSON becomes:

%7B%22headless%22%3Afalse%2C%22stealth%22%3Atrue%2C%22args%22%3A%5B%22--window-size%3D1920%2C1080%22%5D%7D

And the full request URL looks like:

https://production-sfo.browserless.io/screenshot?token=YOUR_API_TOKEN_HERE&launch=%7B%22headless%22%3Afalse%2C%22stealth%22%3Atrue%2C%22args%22%3A%5B%22--window-size%3D1920%2C1080%22%5D%7D

How to encode in code

Most languages handle encoding for you — you just need to pass the JSON string through the right function:

# Use --data-urlencode to let cURL handle encoding
LAUNCH='{"headless":false,"stealth":true,"args":["--window-size=1920,1080"]}'

curl -X POST \
"https://production-sfo.browserless.io/screenshot?token=YOUR_API_TOKEN_HERE" \
--data-urlencode "launch=$LAUNCH" \
-H 'Content-Type: application/json' \
-d '{"url": "https://example.com"}' \
-o screenshot.png
tip

You can also base64-encode the JSON payload and pass it as &launch=<base64string>. This is an alternative to URL-encoding that some developers find easier to work with.

Combining Both Methods

When you use both query parameters and a launch payload in the same request, Browserless merges them — with individual query parameters taking precedence.

For example, consider this request (shown unencoded for readability):

/screenshot?token=YOUR_API_TOKEN_HERE&headless=true&launch={"headless":false,"stealth":true}

The effective configuration would be:

{
"headless": true,
"stealth": true
}

The headless=true query parameter overrides the "headless": false inside the launch JSON.

Parameter Reference

Not all parameters are supported by every REST API endpoint. Check the REST API reference to verify which parameters are available for the specific endpoint you're using. The table below lists all available launch parameters:

ParameterDescriptionDefault
tokenThe authorization token for API access.none
timeoutMaximum session duration in milliseconds. The session will automatically close after this time to prevent overuse.60000
proxyRoutes browser traffic through a proxy. Only supports proxy=residential for Browserless's residential proxy pool. Omit to use the IP of the machine in the cloud running the container, meaning it's a fixed datacenter IP.none
proxyCountryUsed with proxy=residential to specify the exit node's country. Accepts ISO 3166 country codes (e.g., us, gb, de). If omitted, a random location is chosen.none
proxyStickyUsed with proxy=residential to maintain the same proxy IP across a session (when possible). Useful for sites that expect consistent IP usage.false
proxyLocaleMatchUsed with proxy=residential to automatically configure browser locale settings to match the proxy location. Recommended when using proxyCountry to improve stealth by aligning browser language preferences with the geographic region.false
proxyPresetWebsite-specific proxy configuration. Use px_gov01 for government websites or px_ipv6 for Google domains (Maps, YouTube, etc.) to ensure optimal proxy vendor selection.none
externalProxyServerExternal proxy server URL for user-provided proxies. Format: http(s)://[username:password@]host:port. When set, routes requests through this proxy instead of built-in residential proxies. Credentials can be included directly in the URL.none
blockAdsEnables the built-in ad blocker (powered by uBlock Origin). Helps speed up scripts and reduce noise by blocking ads and trackers. Especially useful for scraping to avoid popups and clutter. Note: may cause some sites to fail to load correctly.false
blockConsentModalsAutomatically blocks or dismisses cookie/GDPR consent banners. Available in BQL sessions and the /screenshot and /pdf REST APIs. In BQL, toggle it via the IDE or launch JSON. Useful for cleaner scraping by removing overlays.false
recordEnables session recording functionality for debugging and monitoring purposes.false
replayEnables session recording for replay. When true, the session is recorded and can be replayed later.false
argsArray of Chrome command-line flags to pass at browser launch (e.g. ["--window-size=1280,720", "--lang=en-US"]). See the Chrome Flags section for available flags.[]
headlessRuns the browser in headless mode. Set to false to enable headful mode (with a GUI). While the GUI isn't visible in cloud environments, headful mode may help bypass bot detection. Note: it uses more resources.true
stealthEnables stealth mode to reduce automation signals (similar to puppeteer-extra's stealth plugin). Set to true to enable stealth techniques.false
slowMoAdds delays between browser actions to slow down automation. Useful for debugging or bypassing rate limits. Value in milliseconds.0
ignoreDefaultArgsControls which default Puppeteer/Playwright arguments to ignore when launching the browser. Can be a boolean or array of specific arguments to ignore.false
acceptInsecureCertsAccepts insecure certificates during navigation. Useful for testing sites with self-signed certificates or certificate issues.false

Common Recipes

Scraping a Bot-Protected Site

Combine stealth mode with a residential proxy and ad blocking to maximize your chances of bypassing bot detection:

curl -X POST \
"https://production-sfo.browserless.io/scrape?token=YOUR_API_TOKEN_HERE&stealth=true&proxy=residential&proxyCountry=us&blockAds=true" \
-H 'Content-Type: application/json' \
-d '{
"url": "https://example.com",
"elements": [{ "selector": "h1" }]
}'

Generating a Clean PDF

Strip ads and cookie banners so your PDFs render cleanly:

curl -X POST \
"https://production-sfo.browserless.io/pdf?token=YOUR_API_TOKEN_HERE&blockAds=true&blockConsentModals=true" \
-H 'Content-Type: application/json' \
-d '{
"url": "https://example.com",
"options": {
"format": "A4",
"printBackground": true
}
}' \
-o clean-output.pdf

Using Your Own Proxy

Route traffic through your own proxy server by passing credentials in the URL:

curl -X POST \
"https://production-sfo.browserless.io/content?token=YOUR_API_TOKEN_HERE&externalProxyServer=http://user:pass@proxy.example.com:8080" \
-H 'Content-Type: application/json' \
-d '{
"url": "https://example.com"
}'

Full Example

A realistic scenario: taking a screenshot of a bot-protected site using stealth mode, a US residential proxy, and ad blocking.

curl -X POST \
"https://production-sfo.browserless.io/screenshot?token=YOUR_API_TOKEN_HERE&stealth=true&proxy=residential&proxyCountry=us&blockAds=true&blockConsentModals=true" \
-H 'Content-Type: application/json' \
-d '{
"url": "https://example.com",
"options": {
"type": "png",
"fullPage": true
}
}' \
-o screenshot.png