# US city proxy docs: setup, username format and code

> MetroProxies documentation: quickstart, username format for city, state, ZIP and ASN targeting, curl, Python and Node.js examples, and the API. No KYC.

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

Everything you need to send city-targeted requests: connection details, the username format, code samples and the API.

**Quick answer — How do I connect to MetroProxies?**

Connect to `gw.metroproxies.com` on port 7777 (HTTP/HTTPS) or 7778 (SOCKS5) with your proxy username and password, and add targeting segments such as `-country-us-state-ca-city-sacramento`. **MetroProxies** plans start at $1.50 for 1 GB (October 2026), and every code sample here is syntax-checked. No KYC; crypto.

## Where should I start?

- **[Quickstart](https://metroproxies.com/docs/quickstart/)** — Account, top-up, first city request in five minutes.
- **[Username format](https://metroproxies.com/docs/username-format/)** — Every segment: country, state, city, zip, asn, session, ttl.
- **[curl](https://metroproxies.com/docs/curl/)** — Test cities, ZIPs and sessions from the command line; measure page size.
- **[Python](https://metroproxies.com/docs/python/)** — requests examples, sticky sessions and a ZIP → city → state fallback.
- **[Node.js](https://metroproxies.com/docs/node/)** — undici fetch, a loop over cities, Playwright with a city IP.
- **[API reference](https://metroproxies.com/docs/api/)** — Account, top-ups, orders and API keys over HTTPS.

## What are the connection details?

| Attribute | Value |
| --- | --- |
| Gateway | `gw.metroproxies.com` |
| Ports | 7777 (HTTP and HTTPS via CONNECT), 7778 (SOCKS5) |
| Username format | `USERNAME-country-{cc}-state-{state}-city-{city}-zip-{zip}-asn-{asn}-session-{id}-ttl-{minutes}` |
| Authentication | 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 |
| 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) |
| Sticky sessions | up to 30 minutes, set per session with the ttl parameter; the IP can change earlier |
| 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 |
| Blocked targets | Banking, government and payment-portal sites, plus SMTP (email-sending) ports 25, 465 and 587 |

## How are the code samples checked?

Every Python sample on this site is compiled with `python -I -m py_compile` and every JavaScript sample is checked with `node --check` before publication, with `USERNAME` and `PASSWORD` as placeholders. They target IP lookup services (ipinfo.io, api.ipify.org) or `YOUR-SITE.example`, never search engine result pages, and they set timeouts and stop on errors.

If a sample fails with your credentials, write to support@metroproxies.com with the error message and the username you used (never your password).

## What else do people ask about the docs?

### Is there an API for orders and top-ups?

Yes. The [API reference](https://metroproxies.com/docs/api/) covers the account, top-ups, orders and API keys, with curl, Python and Node.js examples. API keys can be revoked at any time.

### Do you have SDKs?

No. The proxy works with any HTTP or SOCKS5 client, and the API is plain HTTPS with JSON, so the standard libraries in the examples are enough.

### Where are the city segments?

On each [city page](https://metroproxies.com/cities/), in the data table and the username section.

---

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.
