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

# Targeting

> Select a country, state, city, or network by adding tokens to your proxy username.

Targeting is controlled entirely through your proxy **username**. Append tokens after your username, separated by hyphens. All tokens are optional. With none, you get a rotating IP from anywhere in the pool.

```
<username>[-country-<cc>][-state-<st>][-city-<city>][-asn-<n>][-session-<id>[-sesstime-<min>]]
```

Country, state, and city are layered: each narrows the one before it. State and city can be combined, and you should combine them to pin a specific city. Many city names repeat across states (for example, Portland exists in Oregon, Maine, and several other states), so the state is what disambiguates which city you reach.

## Tokens

| Token             | Value                                        | Description                                                                                   |
| ----------------- | -------------------------------------------- | --------------------------------------------------------------------------------------------- |
| `-country-<cc>`   | ISO 3166-1 alpha-2 (`us`, `gb`, `de`, `jp`…) | Exit country. Omit for any country.                                                           |
| `-state-<st>`     | State / region name                          | Narrow within a country.                                                                      |
| `-city-<city>`    | City name (lowercase, no spaces)             | Narrow to a city. Pair with `-state-` to disambiguate, since city names repeat across states. |
| `-asn-<n>`        | ASN number                                   | Target a specific network/carrier.                                                            |
| `-session-<id>`   | Your chosen id                               | Keep the same IP across requests. See [Sessions](/docs/residential/sessions).                      |
| `-sesstime-<min>` | Minutes, `5-1440`                            | How long a sticky session holds its IP.                                                       |

<Note>
  Use lowercase ISO country codes. Include the state with a city to reach the city you intend (for example `-country-us-state-california-city-losangeles`); without a state, a repeated city name resolves to a single default location.
</Note>

## Examples

<CodeGroup>
  ```bash Country theme={null}
  # Rotating exit in Germany
  curl -x "http://USERNAME-country-de:SECRET@proxy.illusory.io:1080" https://ipinfo.io/json
  ```

  ```bash City theme={null}
  # Rotating exit in Los Angeles, California, US
  curl -x "http://USERNAME-country-us-state-california-city-losangeles:SECRET@proxy.illusory.io:1080" https://ipinfo.io/json
  ```

  ```bash Network (ASN) theme={null}
  # Exit on a specific network (verify with ip-api, ipinfo can mislabel residential ASNs)
  curl -x "http://USERNAME-country-us-asn-7922:SECRET@proxy.illusory.io:1080" http://ip-api.com/json
  ```
</CodeGroup>

## Common locations

A few popular locations to get you started. Any ISO 3166-1 alpha-2 country code works, so this list is illustrative, not exhaustive. See [all available locations](/docs/residential/locations) for the full country list.

| Country        | Code | Example city token              |
| -------------- | ---- | ------------------------------- |
| United States  | `us` | `-state-newyork-city-newyork`   |
| United Kingdom | `gb` | `-state-england-city-london`    |
| Germany        | `de` | `-state-landberlin-city-berlin` |
| Canada         | `ca` | `-state-ontario-city-toronto`   |
| France         | `fr` | `-state-iledefrance-city-paris` |
| Japan          | `jp` | `-state-tokyo-city-tokyo`       |

```bash theme={null}
# Rotating exit in London, England, UK
curl -x "http://USERNAME-country-gb-state-england-city-london:SECRET@proxy.illusory.io:1080" https://ipinfo.io/json
```

<Note>
  Country targeting spans 195+ countries. State and city targeting work where the pool has coverage. If a specific city returns no exits, broaden to the country.
</Note>

## Common networks (ASN)

Target a specific carrier with `-asn-<n>`. ASN selects by network operator, so an exit can be anywhere that operator runs. Combine it with `-country-`, `-state-`, or `-city-` to also pin a location.

The pool spans thousands of networks across every country. The table below is a small selection of common consumer carriers and is not exhaustive, any valid ASN works with `-asn-<n>`.

| Country        | Carrier            | Token        |
| -------------- | ------------------ | ------------ |
| United States  | Comcast (Xfinity)  | `-asn-7922`  |
| United States  | Charter (Spectrum) | `-asn-20115` |
| United States  | AT\&T Mobility     | `-asn-20057` |
| United States  | Verizon Wireless   | `-asn-6167`  |
| United States  | T-Mobile           | `-asn-21928` |
| United States  | Cox                | `-asn-22773` |
| United Kingdom | BT                 | `-asn-2856`  |
| United Kingdom | Virgin Media       | `-asn-5089`  |
| United Kingdom | Sky                | `-asn-5607`  |
| United Kingdom | Vodafone           | `-asn-25135` |
| Germany        | Deutsche Telekom   | `-asn-3320`  |
| Germany        | Vodafone           | `-asn-3209`  |
| France         | Orange             | `-asn-3215`  |
| France         | Free               | `-asn-12322` |
| France         | SFR                | `-asn-15557` |
| Canada         | Rogers             | `-asn-812`   |
| Canada         | Bell               | `-asn-577`   |
| Canada         | Shaw               | `-asn-6327`  |
| Australia      | Telstra            | `-asn-1221`  |
| Australia      | TPG                | `-asn-7545`  |
| Brazil         | Claro              | `-asn-28573` |
| Brazil         | Vivo               | `-asn-27699` |
| India          | Reliance Jio       | `-asn-55836` |
| India          | Airtel             | `-asn-24560` |
| Japan          | NTT Docomo         | `-asn-4713`  |
| Japan          | KDDI               | `-asn-2516`  |
| Japan          | SoftBank           | `-asn-17676` |
| Spain          | Telefonica         | `-asn-3352`  |
| Spain          | Vodafone           | `-asn-12430` |

<Note>
  Prefer a carrier's mobile network for broad coverage: mobile ASNs (for example Verizon Wireless `6167`, AT\&T Mobility `20057`, T-Mobile `21928`) have exits nationwide and honor city targeting anywhere. Fixed and cable ASNs (for example Verizon Fios `701`, AT\&T wireline `7018`) only have exits in their service areas, so pairing one with a city it does not serve falls back to another exit on that network. See each country's page under [Available Locations](/docs/residential/locations) for its full network list. To confirm the exit's network, check `ip-api.com` rather than `ipinfo.io`, which can mislabel residential ASNs.
</Note>

## Notes

* Country codes follow the [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) standard.
* `-state-` and `-city-` work together. Include the state when targeting a city, since city names are not unique within a country. See [all available locations](/docs/residential/locations) for each country's states and the cities within them.
* The more specific your targeting, the smaller the available pool, which can affect availability and speed in some locations.
* Targeting tokens are case-insensitive, but lowercase is recommended.

<Card title="Next: Sessions" icon="repeat" href="/docs/residential/sessions">
  Keep the same IP with sticky sessions, or rotate on every request.
</Card>
