> ## Documentation Index
> Fetch the complete documentation index at: https://docs.driver.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Geolocation

> Target specific countries for your browser sessions

Run browser sessions from specific geographic locations by specifying a country code.

## Setting Country

Pass a 2-letter ISO country code when creating a session:

<CodeGroup>
  ```typescript TypeScript theme={null}
  const session = await client.browser.session.create({
    type: "hosted",
    country: "US", // United States
  });
  ```

  ```python Python theme={null}
  resp = requests.post(
      "https://api.driver.dev/v1/browser/session",
      headers={
          "Authorization": f"Bearer {os.getenv('DRIVER_API_KEY')}",
          "Content-Type": "application/json",
      },
      json={"type": "hosted", "country": "US"}
  )
  resp.raise_for_status()
  session = resp.json()
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.driver.dev/v1/browser/session \
    -H "Authorization: Bearer $DRIVER_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"type":"hosted","country":"US"}'
  ```
</CodeGroup>

## Availability

<Note>
  Available countries depend on node availability. If no nodes are available in
  a requested country, the API will return an error.
</Note>

## Notes

* Country filtering is best-effort based on available nodes
* Some countries may have limited node availability
