Proxies
Every connection Chrome makes goes out one of three ways:
| Mode | Address | How to ask | Cost |
|---|---|---|---|
direct |
No proxy: the machine’s own address, a US datacenter | The default: omit proxyCountryCode, or send null |
$0.12 a GB |
managed |
A residential address in the country you choose | proxyCountryCode: "de" |
$3 a GB |
custom |
Your proxy | customProxy: { host, port, username, password } |
No traffic fee from Datum |
Direct and residential traffic are measured in both directions, including when a session switches between them.
A residential address
Section titled “A residential address”browser = client.browsers.create(proxy_country_code="gb", timeout=30)Countries are ISO codes in lower case, as at Browser Use (uk works for Great Britain too). A code that is not a
country returns 422 invalid_country.
BrowserReal checks an address before a browser gets it: it has to connect and respond quickly enough. Addresses in the
United States, the United Kingdom, Germany, France and Canada are kept ready. For any other country, the first request
waits while an address there is checked, up to about 18 seconds. If none passes in that time the request returns
503 proxy_pool_empty with Retry-After: 5: retry after those seconds, as an address may be ready by then.
- Coverage outside the US varies by country. Some countries have few residential addresses, or none that pass the check: the dashboard’s list names every country you can ask for, not the ones with an address ready.
- Distance adds latency. The browser’s machine is in the United States, so an address far from it (Asia, Australia, South America) makes every page slower than one in North America or Europe.
Sticky or rotating
Section titled “Sticky or rotating”By default the address is sticky: the browser keeps one address for as long as the provider holds it (up to 24
hours), and the same profile and country get it back next time, which keeps sign-ins stable. For scraping, send
proxySticky: false and every new connection gets another address.
To spend less proxy traffic, send proxyImages: false: images then load from the machine’s own address (charged as
direct traffic) while everything else goes through the proxy.
Your own proxy
Section titled “Your own proxy”{ "customProxy": { "host": "proxy.example.com", "port": 8080, "username": "user", "password": "secret", "protocol": "http" }}protocol is http, https or socks5; left out, it is https on port 443 and http otherwise. The proxy must be
on a public address. Its credentials go to the machine and are never stored. caBundle, caBundleUrl and
ignoreCertErrors are not available yet.
Change the proxy while the browser runs
Section titled “Change the proxy while the browser runs”PATCH /browsers/{id}/proxy switches the proxy without restarting Chrome: tabs, cookies and
storage stay, open connections are closed, and the next ones go the new way.
# Another countrycurl -X PATCH https://browser.datum.network/api/v4/browsers/$ID/proxy \ -H "X-Browser-Use-API-Key: $DATUM_API_KEY" -H "Content-Type: application/json" \ -d '{"mode": "managed", "country": "fr"}'
# A new address, same countrycurl -X PATCH https://browser.datum.network/api/v4/browsers/$ID/proxy \ -H "X-Browser-Use-API-Key: $DATUM_API_KEY" -H "Content-Type: application/json" \ -d '{"rotate": true}'
# No proxycurl -X PATCH https://browser.datum.network/api/v4/browsers/$ID/proxy \ -H "X-Browser-Use-API-Key: $DATUM_API_KEY" -H "Content-Type: application/json" \ -d '{"mode": "direct"}'GET /browsers/{id}/proxy returns the proxy now, with the address sites see (exitIp).