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

# City-Targeting

> Target residential IPs in a specific city for maximum geographic precision.

City-targeting routes requests through residential IPs located in a single city — the most precise level of geo-targeting we offer. Add the `city` parameter to the username segment of your proxy credentials, together with the matching `country` and `state`.

<Warning>
  City is the narrowest targeting level, so it has the smallest IP pool. Always pair `city` with the correct `country` and `state` — a city that doesn't match its state returns no IPs.
</Warning>

## Targeting Format

Add the `city` parameter after `country` and `state`, before your session ID:

```
client-{CLIENT_ID}-country-{COUNTRY}-state-{STATE}-city-{CITY}-session-{SESSION_ID}
```

<ResponseField name="city" type="string" required="false">
  City name that matches the selected state. Lowercase, dash-separated, no spaces or special characters.
</ResponseField>

| Parameter | Required | Description                         |
| --------- | -------- | ----------------------------------- |
| `country` | Yes      | Country the city belongs to         |
| `state`   | Yes      | State or region the city belongs to |
| `city`    | No       | City within the state               |

City names are written lowercase with spaces removed (e.g. `city-newyork`, `city-telaviv`).

## Examples

| City   | Parameter     | State                    | Country |
| ------ | ------------- | ------------------------ | ------- |
| Berlin | `city-berlin` | `state-landberlin`       | Germany |
| Bremen | `city-bremen` | `state-citystatebremen`  | Germany |
| Maghar | `city-maghar` | `state-northerndistrict` | Israel  |
| Göd    | `city-god`    | `state-pestcounty`       | Hungary |

## Example Request

<CodeGroup>
  ```python Python theme={null}
  import requests

  proxies = {
      'http': 'http://client-{CLIENT_ID}-country-Germany-state-landberlin-city-berlin-session-fnzwtath:{PASSWORD}@residential.roundproxies.com:5000',
      'https': 'http://client-{CLIENT_ID}-country-Germany-state-landberlin-city-berlin-session-fnzwtath:{PASSWORD}@residential.roundproxies.com:5000'
  }

  response = requests.get('https://api.ipify.org?format=json', proxies=proxies)
  print(response.json())
  ```

  ```bash cURL theme={null}
  curl -x "http://client-{CLIENT_ID}-country-Germany-state-landberlin-city-berlin-session-fnzwtath:{PASSWORD}@residential.roundproxies.com:5000" \
    https://api.ipify.org?format=json
  ```
</CodeGroup>

## Tips

* Only reach for city-targeting when your use case truly needs it — [country or state targeting](/residentials/geo-targeting) gives you a much larger IP pool.
* If you receive `No Available IPs for Targeting`, drop the `city` parameter and retry with state-level targeting. See [Error Handling](/residentials/error-handling).
* Pair city-targeting with a sticky [session](/residentials/session) to keep the same exit IP across requests.
