Username parameters
How NyxonProxies reads targeting and session options from the proxy username: country, US state, city, session ID and hold time, with the order and the rules.
NyxonProxies has no separate API call to choose a location or keep an IP. You add short parameters to the proxy username, and every connection that uses that username follows them. The password never changes.
The format
Parameters are -key-value pairs appended to your base username, in this order:
USERNAME-country-{cc}-state-{state}-city-{city}-session-{id}-time-{minutes}Unlimited Residential takes the time first: USERNAME-country-{cc}-time-{minutes}-session-{id}.
Every part after USERNAME is optional. Leave out the parts you do not need:
USERNAME
USERNAME-country-gb
USERNAME-country-us-state-texas
USERNAME-country-us-state-texas-city-houston
USERNAME-country-fr-session-k3x9q2ma-time-10The proxy generator writes these for you and only adds the parameters the plan's product supports. Building them in code is just string formatting.
Parameters
| Parameter | Value | Example | Products |
|---|---|---|---|
country | Two-letter country code, lower case | -country-de | All gateway products |
state | US state name, lower case, no spaces | -state-newyork | Residential |
city | City name, lower case, no spaces | -city-losangeles | Residential, with a US state |
asn | Network number, digits only | -asn-7922 | Residential, Mobile |
session | Your own ID, letters and digits | -session-a1b2c3d4 | Products with sessions |
time | Minutes to hold the IP, up to 120 | -time-30 | With session |
Country codes are ISO 3166-1 alpha-2: us, gb, de, fr, br, jp. Note that the United Kingdom is gb, not uk.
State and city names drop spaces and punctuation: New York is newyork, North Carolina is northcarolina, Salt Lake City is saltlakecity. The supported values and the cities in each state are listed in Location targeting.
What each product supports
| Product | country | state, city | asn | session, time |
|---|---|---|---|---|
| Residential | Yes | Yes, US | Yes | Yes |
| Mobile | Yes | No | Yes | Yes |
| Unlimited Residential | Yes | No | No | Yes |
| Residential Budget | Yes | No | No | No, rotating only |
| Datacenter | US pool | No | No | Rotating |
| Shared ISP | US pool | No | No | Rotating |
| IPv6 Residential | US pool | No | No | Rotating |
| IPv6 Datacenter | US pool | No | No | Rotating |
Datacenter, Shared ISP and the IPv6 products only have US exits, so their lines need no location parameter. The generator builds rotating lines for them. If you build usernames in code, stick to the combinations in this table.
Sessions in the username
Without session, the connection is rotating: every new connection can get a different IP. With session, every connection that sends the same ID keeps the same IP:
USERNAME-country-us-session-cart42-time-30time is the number of minutes to keep the IP, up to 120. Change the ID to get a new IP right away. On Residential, Mobile and Unlimited Residential the IP belongs to a real device, so it can change sooner if the device goes offline, see Rotating and sticky sessions.
Use only letters and digits in session IDs. Hyphens separate the parameters, so keep them out of the ID.
Building usernames in code
Keep the base username and password in your config and add the parameters per job or per request:
import secrets
def proxy_url(country=None, session=False, minutes=30):
user = "USERNAME"
if country:
user += f"-country-{country}"
if session:
user += f"-session-{secrets.token_hex(4)}-time-{minutes}"
return f"http://{user}:[email protected]:8080"
print(proxy_url("de"))
print(proxy_url("us", session=True))import { randomBytes } from "node:crypto";
function proxyUrl({ country, session = false, minutes = 30 } = {}) {
let user = "USERNAME";
if (country) user += `-country-${country}`;
if (session) user += `-session-${randomBytes(4).toString("hex")}-time-${minutes}`;
return `http://${user}:[email protected]:8080`;
}
console.log(proxyUrl({ country: "de" }));
console.log(proxyUrl({ country: "us", session: true }));Common mistakes
- Parameters in the password. They only work in the username.
- Upper case or spaces in values. Write
-country-usand-city-losangeles, as the generator does. - A city without its state. City targeting on Residential goes together with the US state:
-state-california-city-losangeles. - A hyphen inside a session ID.
-session-my-cartdoes not give you the IDmy-cart, because hyphens separate the parameters. Use-session-mycart. - Targeting on a product that does not support it. A state on Mobile or a session on Residential Budget is not supported. Check the table above.
- A location on a US-only pool. Datacenter, Shared ISP and IPv6 lines need no country, so leave it out.
Last updated
Still stuck?
People answer the live chat around the clock. Send the proxy line you used (without the password) and the error you see.