Residential proxies with ASN targeting
Add -asn- and the network number to the username, after the country, and every exit comes from that one ISP.
In short
Write USER-country-ch-asn-3303 and the exit is a Swisscom home connection in Switzerland: 6 of 6 in our test, each a different IP. The country is required; -asn- on its own is ignored. Numbers only, no AS in front.
The internet routes traffic between autonomous systems, and every ISP has at least one. Its number, the ASN, is what IP lookups show as org: AS7922 Comcast Cable Communications, AS3320 Deutsche Telekom AG. A residential IP always belongs to the ASN of the provider that connects that home.
Country and city targeting pick where an exit is. ASN targeting picks whose line it is. That matters when a site treats providers differently, when you test what customers of one carrier see, or when an account was always used from one ISP and should stay there.
Without a network filter you get whatever the country offers. In Switzerland 9 of 18 sticky sessions we opened on November 6 landed on Swisscom; the rest were Sunrise, Salt and netplus. With -asn-3303 every one was Swisscom.
| Username | Networks seen | Swisscom |
|---|---|---|
| USER-country-ch | Swisscom, Sunrise, Salt Mobile, netplus.ch | 9 of 18 |
| USER-country-ch-asn-3303 | Swisscom (Bellinzona, Cernier, Thônex, Luzern, Zürich) | 6 of 6 |
The country comes first
The network flag only works inside a country. USER-asn-3303 without one gave us exits in Indonesia, Argentina and the US, none on Swisscom, and no error. A country and a network that don’t belong together are refused instead.
Only the number
IP lookups print AS3303, but the username takes 3303. Both -asn-AS3303 and -asn-swisscom were refused with 403, the answer for a value the gateway can’t read.
A session keeps its exit
USER-country-us-asn-7922-session-job1-lifetime-10 on port 10000 answered three requests from the same Comcast IP. Reusing that session name with another country or ASN still returned the old exit, so pick a new name whenever the targeting changes. More on rotating and sticky sessions.
| Username | Port | Result |
|---|---|---|
| USER-country-us-asn-7922 | 9000 | 200 · US · AS7922 Comcast |
| USER-country-de-asn-3320 | 9000 | 200 · DE · AS3320 Deutsche Telekom |
| USER-country-ch-asn-6730 | 10000 | 200 · CH · AS6730 Sunrise |
| USER-country-gb-asn-2856 | 11000 (SOCKS5) | 200 · GB · AS2856 British Telecommunications |
| USER-country-de-city-berlin-asn-3320 | 9000 | 200 · 2 of 3 in Berlin, 1 in Burg bei Magdeburg |
| USER-country-ch-asn-99999999 | 9000 | 465 · no exit |
November 6 and 7, 2026. City plus network narrows the pool a lot, and the city is not always where the lookup places the IP.
Which networks a country has, and how often we saw them, is on each country page: for example Comcast, Deutsche Telekom, Swisscom and BT. The AS number is in each page’s address.
A setup that works
Ran unchanged against our gateway on November 7, 2026. PROXY_USER and PROXY_PASS come from the environment.
import os
import re
import requests # pip install requests
USER, PASS = os.environ["PROXY_USER"], os.environ["PROXY_PASS"]
def proxy(country, asn, session=None, minutes=10):
name = f"{USER}-country-{country}-asn-{asn}" # the ASN only counts together with a country
port = 9000
if session: # sticky: same IP for `minutes`, on the sticky port
name += f"-session-{session}-lifetime-{minutes}"
port = 10000
url = f"http://{name}:{PASS}@via.proxies.vision:{port}"
return {"http": url, "https": url}
for country, asn in [("us", 7922), ("de", 3320), ("ch", 3303), ("us", 3303)]:
try:
info = requests.get("https://ipinfo.io/json", proxies=proxy(country, asn), timeout=30).json()
except requests.exceptions.ProxyError as e:
code = re.search(r"failed: (\d{3})", str(e)) # 465: no exit on that network in that country
print(country, asn, "proxy refused:", code.group(1) if code else e)
continue
print(country, asn, "->", info["country"], info["org"])us 7922 -> US AS7922 Comcast Cable Communications, LLC
de 3320 -> DE AS3320 Deutsche Telekom AG
ch 3303 -> CH AS3303 Swisscom (Switzerland) Ltd
us 3303 proxy refused: 465On the command line
curl -x http://via.proxies.vision:9000 -U "$PROXY_USER-country-de-asn-3320:$PROXY_PASS" https://ipinfo.io/json prints the exit and its org. A 465 shows as CONNECT tunnel failed, response 465; what curl’s tunnel errors mean.
No code needed: the generator in the dashboard and the public proxy list generator have a Network (ASN) field that writes the flag for you.
What is ASN targeting for residential proxies?
Why does -asn- give me IPs from the wrong country or ISP?
What does 465 mean with ASN targeting?
Can I write AS3303 instead of 3303?
How do I keep the same ISP and the same IP?
Keep reading
How to Rotate Proxies in Python (and Why Yours May Not Rotate)
requests.Session, httpx.Client and Scrapy reuse one IP through a rotating proxy. What rotates, measured, and code that gets a new IP per request.
7 min read · #python#scrapy
Sneaker Bot Proxies: One Sticky Residential IP per Task
One sticky session per task, the right country, the list formats bots import, and a generator for a ready proxies.txt. Measured on our gateway.
6 min read · #sneakers#sticky-sessions
Tunnel connection failed: 407 in Python requests (and 403, 465)
The status is the proxy's answer, not the website's. Five causes of 407 we reproduced, and what 403 and 465 mean instead.
7 min read · #python#errors
Residential proxies, pay per GB
HTTP and SOCKS5. Country, city and sticky sessions in the username. No subscription.