- Country - targets peers from a specific country
- Geolocation radius – targets peers using an exact latitude, longitude, and radius simulating a precise physical location for more granular geo-targeted data collection.
How to target a country
Add the-country flag, after your USER credentials within the Bright Data endpoint, followed by the 2-letter ISO code for that country.
For example, Browser API using Puppeteer in the USA:
AL, AZ, KG, BA, UZ, BI, XK, SM, DE, AT, CH, UK, GB,IE, IM, FR, ES, NL, IT, PT, BE, AD, MT, MC, MA, LU, TN, DZ, GI, LI, SE, DK, FI, NO, AX, IS, GG, JE, EU, GL, VA, FX, FO.
How to set the geolocation radius
Use theProxy.setLocation function to dynamically change the location of your proxies using an exact latitude, longitude, and radius.
Parameters
float
Specifies the latitude of the desired proxy location.
float
Specifies the longitude of the desired proxy location.
boolean
default:"true"
Defines the desired behavior in case no peers are available in the specified distance.
strict: true - Bright Data will search for available peers only within the specific distance.strict: false - if no peers are available in the specified distance we will automatically expand the distance and look for the nearest available peers.How to use proxy location targeting
TheProxy.setLocation command should be invoked before navigating to the site for which the proxy is intended. This ensures that the proxy location is set accurately according to the specified parameters before any data requests are made.
How to run examples
You need to get Browser API credentials in the control panel. Pass it in format SBR_ZONE_FULL_USERNAME:SBR_ZONE_PASSWORD as environment variable AUTH
Code Examples
Change proxy location before scrapingHow to get proxy geolocation
Use this command to retrieve the exact geo-location information of the proxy peer assigned to your current browser session. This is useful for logging and verifying the assigned peer’s location on your end.Proxy geolocation CDP command
Proxy.getGeolocation
Use the CDP command after navigation to the target page.
Example (Puppeteer)
Returns