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:

text
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:

text
USERNAME
USERNAME-country-gb
USERNAME-country-us-state-texas
USERNAME-country-us-state-texas-city-houston
USERNAME-country-fr-session-k3x9q2ma-time-10

The 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

ParameterValueExampleProducts
countryTwo-letter country code, lower case-country-deAll gateway products
stateUS state name, lower case, no spaces-state-newyorkResidential
cityCity name, lower case, no spaces-city-losangelesResidential, with a US state
asnNetwork number, digits only-asn-7922Residential, Mobile
sessionYour own ID, letters and digits-session-a1b2c3d4Products with sessions
timeMinutes to hold the IP, up to 120-time-30With 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

Productcountrystate, cityasnsession, time
ResidentialYesYes, USYesYes
MobileYesNoYesYes
Unlimited ResidentialYesNoNoYes
Residential BudgetYesNoNoNo, rotating only
DatacenterUS poolNoNoRotating
Shared ISPUS poolNoNoRotating
IPv6 ResidentialUS poolNoNoRotating
IPv6 DatacenterUS poolNoNoRotating

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:

text
USERNAME-country-us-session-cart42-time-30

time 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))

Common mistakes

  • Parameters in the password. They only work in the username.
  • Upper case or spaces in values. Write -country-us and -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-cart does not give you the ID my-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.