Targeting (country, state, city, ASN)
The full username DSL for targeting a country, state, city or carrier ASN, with formatting rules and examples.
Targeting is encoded directly in the proxy username as -key-value pairs,
appended to your credential's login in a fixed order:
<login>[-country-<cc>][-state-<x>][-city-<x>][-asn-<n>][-session-<id>][-life-<minutes>]
Everything after the login is optional — a bare login (ofp_0123abcd) gets
a rotating IP from anywhere in the pool. Read Getting started
first if you don't have a credential yet.
Keys
| Key | Value | Example |
|---|---|---|
country |
ISO-3166 alpha-2 country code | ofp_0123abcd-country-de |
state |
State/region — letters, digits and _, max 32 chars |
ofp_0123abcd-country-us-state-california |
city |
City — letters, digits and _, max 32 chars |
ofp_0123abcd-country-us-city-new_york |
asn |
Carrier ASN number | ofp_0123abcd-country-de-asn-3209 |
session |
Sticky session id — letters and digits, max 32 chars | ofp_0123abcd-session-abc123 |
life |
Sticky lifetime in minutes, 1–1440 | ofp_0123abcd-session-abc123-life-30 |
session and life control sticky sessions rather than geography — see
Sticky sessions for those.
Formatting rules
- Values are lowercase.
-country-DEwill not match; use-country-de. - Use an underscore instead of a space:
new_york, notnew york. - Keys must appear in the order shown above —
statebeforecity, both aftercountry, andsession/lifelast. - Combine only the keys you need; skipping one (for example, no
state) is fine, but the keys you do use must stay in that relative order.
Examples
Country only, rotating:
curl -x "http://ofp_0123abcd-country-de:PASSWORD@proxy.oneforproxy.com:8080" https://api.ipify.org
Country + state + city:
curl -x "http://ofp_0123abcd-country-us-state-california-city-los_angeles:PASSWORD@proxy.oneforproxy.com:8080" https://api.ipify.org
Country + carrier ASN:
curl -x "http://ofp_0123abcd-country-de-asn-3209:PASSWORD@proxy.oneforproxy.com:8080" https://api.ipify.org
Country + sticky session:
curl -x "http://ofp_0123abcd-country-us-session-job42-life-30:PASSWORD@proxy.oneforproxy.com:8080" https://api.ipify.org
Unknown or malformed keys
An unrecognized key, a key out of order, an uppercase value, or a state or
city value that isn't lowercase letters, digits and _ are all rejected
the same way: 407 Proxy Authentication Required on HTTP, or SOCKS5 reply
0x01 (auth failed) — the connection is refused before it ever reaches the
target. Check the exact spelling and order against the table above; the
full error list is in Errors and the Docs.
Related
- Sticky sessions — pinning one IP with
session/life. - Docs — the canonical DSL reference.
- Pricing — targeting doesn't change the per-GB rate.