# Proxy username format for city, state and ZIP targeting

> Reference for the MetroProxies proxy username: country, state, city, zip, asn, session and ttl segments, their order, formats and examples. No KYC.

- URL: https://metroproxies.com/docs/username-format/
- Last updated: 2026-10-18
- Publisher: MetroProxies (https://metroproxies.com)

Every targeting option is a segment of the username. This page lists them all, in order, with the format each one expects.

**Quick answer — What is the MetroProxies username format?**

The full format is `USERNAME-country-{cc}-state-{state}-city-{city}-zip-{zip}-asn-{asn}-session-{id}-ttl-{minutes}`. Start with your username, then add only the segments you need, from the widest place to the narrowest; city names are lower case with underscores. **MetroProxies** includes every segment on every plan from $0.50/GB (October 2026), with no surcharge. No KYC; crypto payments.

## Which segments exist, and in what order?

| Segment | Format | Example | Notes |
| --- | --- | --- | --- |
| `country-` | ISO 3166 code, lower case | `country-us` | Required for any targeting |
| `state-` | USPS code, lower case | `state-tx` | United States only; 50 states and `dc` |
| `city-` | lower case, underscores for spaces, no punctuation | `city-fort_worth` | City availability varies; the checkout shows what is online |
| `zip-` | five digits | `zip-76102` | United States only; keep leading zeros |
| `asn-` | AS number without "AS" | `asn-20115` | Narrows to one provider's network |
| `session-` | letters and digits | `session-ftw01` | Same ID = same IP while the session lasts |
| `ttl-` | minutes | `ttl-20` | Sticky time, up to 30 minutes, set per session with the ttl parameter; the IP can change earlier |

## How do the segments combine?

Each segment narrows the previous one. Write them in the order of the table and leave out what you do not need.

- `USERNAME-country-us` — any US residential IP, new IP per connection.
- `USERNAME-country-us-state-tx-city-fort_worth` — Fort Worth.
- `USERNAME-country-us-state-tx-city-fort_worth-zip-76102` — downtown Fort Worth.
- `USERNAME-country-us-state-tx-city-fort_worth-asn-20115` — a Spectrum IP in Fort Worth.
- `USERNAME-country-us-state-tx-city-fort_worth-session-ftw01-ttl-20` — one Fort Worth IP kept for up to 20 minutes.

The password never changes. Username and password on every plan, or an IP allowlist (up to 10 IPs). Sub-users with their own credentials and traffic cap. API keys you can revoke at any time.

## What are the connection details?

| Attribute | Value |
| --- | --- |
| Gateway host | `gw.metroproxies.com` |
| HTTP / HTTPS port | 7777 |
| SOCKS5 port | 7778 |
| Protocols | HTTP, HTTPS (CONNECT) and SOCKS5 |
| Rotation | Each new connection gets an IP from the pool, usually a different one; to get a new IP on every request, send one request per connection (turn off keep-alive) |
| Traffic counting | Usage counts all data sent and received through the proxy (upload and download, headers included). 1 GB = 1,000,000,000 bytes. Connection attempts that fail before reaching the target are not counted |

## What are the common mistakes?

- **Upper case or spaces in a city:** `city-Fort Worth` will not match; write `city-fort_worth`.
- **City without state:** names repeat across states (two Aurora, two Columbus, two Glendale, two Kansas City and two Springfield pages on this site alone). Always add `state-`.
- **A ZIP outside the city:** `city-austin-zip-75201` asks for Austin and a Dallas ZIP at once, and is likely to find nothing.
- **Reusing a session ID across cities:** use one ID per city and per run.
- **SOCKS5 in a browser:** browsers do not send a username to SOCKS5 proxies; use port 7777.
- **Special characters in the password:** URL-encode them when you put credentials in a proxy URL (`@` becomes `%40`).

## Where should I go next?

Try the format with the [curl commands](https://metroproxies.com/docs/curl/), the [five-minute setup](https://metroproxies.com/docs/quickstart/) or the [Python examples](https://metroproxies.com/docs/python/); each level is explained on [city-level proxies](https://metroproxies.com/targeting/city/), [state-level proxies](https://metroproxies.com/targeting/state/) and [proxy by ZIP code](https://metroproxies.com/targeting/zip-code/).

## What else do people ask about the format?

### Is the API the same format?

No. The username is for the proxy gateway. The [API documentation](https://metroproxies.com/docs/api/) uses JSON fields, and country codes there are upper case (`US`), while the username uses lower case (`country-us`).

### How do I write cities like St. Louis or Winston-Salem?

Drop the punctuation and replace spaces and hyphens with underscores: `city-st_louis`, `city-winston_salem`. Each [city page](https://metroproxies.com/cities/) prints the exact segment.

### Can sub-users use different targeting?

Yes. Targeting lives in the username, so every sub-user can request any city. Sub-users have their own credentials and traffic cap, which is useful to separate projects or clients.

---

MetroProxies: MetroProxies is a US residential proxy provider with city-level targeting, paid in crypto with no ID upload. Home IPs are requested by city, state, ZIP code or ISP network, with a page of local data for each of 181 US cities.
