> ## 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.

# Location Fallback

> Get an IP elsewhere in the same country when your exact location has none available.

By default, targeting is strict. If no residential IP matches the exact state, city or ASN you asked for, the request fails with `PX1002`. Add `fallback-true` to your username and we will use an IP from somewhere else in the same country instead.

<Note>
  Fallback always stays in the same country. Include `country` when you use it. Without it, the default country is Germany.
</Note>

## Format

Put `fallback` after your location parameters and before the session ID:

```
client-{CLIENT_ID}-country-{COUNTRY}-city-{CITY}-fallback-true-session-{SESSION_ID}
```

<ResponseField name="fallback" type="string" required="false">
  `true` to allow another location in the same country. `1`, `yes` and `on` also work. Leave it out, or use `fallback-false`, for strict matching.
</ResponseField>

| Parameter | What happens |
| - | - |
| (none) | Strict. If the exact location has no IP, the request fails with `PX1002`. |
| `fallback-false` | Same as leaving it out. |
| `fallback-true` | If the exact location has no IP, you get one elsewhere in the same country. |

Fallback works with `state`, `city` and `asn`, and you can combine it with [OS-targeting](/residentials/os-targeting), [sessions](/residentials/session) and [UDP](/residentials/udp).

## Examples

| Username | Result |
| - | - |
| `client-{CLIENT_ID}-country-UnitedStates-city-losangeles-fallback-true` | A Los Angeles IP if available, otherwise another US IP |
| `client-{CLIENT_ID}-country-UnitedStates-city-losangeles` | A Los Angeles IP, or `PX1002` if none is available |
| `client-{CLIENT_ID}-country-UnitedStates-state-california-fallback-true` | An IP in California if available, otherwise another US IP |
| `client-{CLIENT_ID}-country-UnitedStates-state-texas-fallback-true-session-fnzwtath` | A sticky Texas IP, or a sticky IP elsewhere in the US |

## Example Request

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    import requests

    proxies = {
        'http': 'http://client-{CLIENT_ID}-country-UnitedStates-city-losangeles-fallback-true-session-fnzwtath:{PASSWORD}@residential.roundproxies.com:5000',
        'https': 'http://client-{CLIENT_ID}-country-UnitedStates-city-losangeles-fallback-true-session-fnzwtath:{PASSWORD}@residential.roundproxies.com:5000'
    }

    response = requests.get('http://ip-api.com/json', proxies=proxies)
    print(response.json())
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -x "http://client-{CLIENT_ID}-country-UnitedStates-city-losangeles-fallback-true-session-fnzwtath:{PASSWORD}@residential.roundproxies.com:5000" \
      http://ip-api.com/json
    ```
  </Tab>
</Tabs>

The response from `ip-api.com` includes `country`, `regionName` and `city`, so you can see whether you got your exact location or a fallback.

## When to Use It

* **Use fallback** when the country matters but the exact city or ISP is only a preference, for example local search results or regional prices.
* **Keep it strict** when the location has to be exact, for example when checking content for one city. You then get a clear `PX1002` instead of an IP from a different city.

## Troubleshooting

* **`PX1002` without fallback**: no IP matches the exact location. Add `fallback-true`, or remove the most specific parameter.
* **`PX1002` with fallback**: no IP is available anywhere in that country with your other filters, such as `os`. Try again shortly or loosen the other filters.
* See [Error Handling](/residentials/error-handling) for all proxy errors.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.