How to Create Proxies in Code Without an API
Your proxy settings live inside the username, so you can build every proxy string in your own code. No API key, no requests, no limits. With Python, Node.js and curl examples.
By SocksNode TeamPublished Nov 22, 20264 min read

Most people assume that creating proxies in bulk means calling an API once per proxy. It does not. With SocksNode residential proxies the entire configuration lives inside the username, so you can build every proxy string locally, in your own code. No API key, no requests, no rate limits.
This is exactly what the Generator in your dashboard does. It builds the strings in your browser and hands them to you. Once you know the format, you can do the same thing in ten lines of Python.
What you need
Open Dashboard > Generator and copy two values: your username and your password. That single pair works for every proxy string you build from now on.
Host and ports
The host is global.socksnode.com, which answers from the gateway closest to you. If you would rather pin one region, use us.socksnode.com, fr.socksnode.com or sg.socksnode.com instead.
| Port | Protocol and behaviour |
|---|---|
| 9000 | HTTP, a new IP on every request |
| 10000 | HTTP, the same IP held for a while |
| 11000 | SOCKS5, a new IP on every request |
| 12000 | SOCKS5, the same IP held for a while |
How the username carries your settings
Start with your username and append pieces, separated by hyphens:
USERNAME-country-us
USERNAME-country-us-state-california-city-losangeles
USERNAME-country-us-city-chicago-asn-7922
USERNAME-country-us-os-android
USERNAME-country-us-session-a1b2c3d4-lifetime-30
The pieces you can use:
country-usis the two letter country code. Leave this piece out entirely for IPs from anywhere in the world.state-californiais the state name written as one word, no spaces and no underscores.city-losangelesis the city name written as one word.asn-7922pins one specific ISP. It combines with both a state and a city.os-androidbiases the exit toward a device running that operating system. Accepts windows, android, ios and mac.session-a1b2c3d4holds one IP. You pick the string yourself, letters and digits.lifetime-30is how many minutes that IP is held. The maximum is 1440.strict-offfalls back to another IP in the same country when nothing matches your exact target, instead of failing.
Two mistakes are easy to make. session only works on the IP holding ports, 10000 and 12000, and a rotating port refuses the connection outright. And lifetime is counted in minutes, not seconds.
Python
import random, string, requests
USER = "USERNAME"
PASS = "PASSWORD"
HOST = "global.socksnode.com"
def make_proxy(country="us", state=None, city=None, asn=None,
os_name=None, sticky_minutes=None, socks=False):
parts = [USER]
if country:
parts.append(f"country-{country}")
if state:
parts.append(f"state-{state}")
if asn:
parts.append(f"asn-{asn}")
if city:
parts.append(f"city-{city}")
if os_name:
parts.append(f"os-{os_name}")
if sticky_minutes:
sid = "".join(random.choices(string.ascii_lowercase + string.digits, k=8))
parts += [f"session-{sid}", f"lifetime-{sticky_minutes}"]
port = 12000 if socks else 10000
else:
port = 11000 if socks else 9000
scheme = "socks5h" if socks else "http"
return f"{scheme}://{'-'.join(parts)}:{PASS}@{HOST}:{port}"
# A fresh IP on every request
p = make_proxy(country="us")
# The same IP for the next 30 minutes
p = make_proxy(country="us", city="losangeles", sticky_minutes=30)
r = requests.get("https://api.ipify.org", proxies={"http": p, "https": p}, timeout=30)
print(r.text)
Need 500 sticky proxies that each hold a different IP? Call the function 500 times. Every new session value is a different IP.
proxies = [make_proxy(country="us", sticky_minutes=60) for _ in range(500)]
open("proxies.txt", "w").write("\n".join(proxies))
Node.js
const USER = "USERNAME";
const PASS = "PASSWORD";
const HOST = "global.socksnode.com";
function makeProxy({ country = "us", city, asn, osName, stickyMinutes, socks = false } = {}) {
const parts = [USER];
if (country) parts.push(`country-${country}`);
if (asn) parts.push(`asn-${asn}`);
if (city) parts.push(`city-${city}`);
if (osName) parts.push(`os-${osName}`);
let port;
if (stickyMinutes) {
const sid = Math.random().toString(36).slice(2, 10);
parts.push(`session-${sid}`, `lifetime-${stickyMinutes}`);
port = socks ? 12000 : 10000;
} else {
port = socks ? 11000 : 9000;
}
const scheme = socks ? "socks5h" : "http";
return `${scheme}://${parts.join("-")}:${PASS}@${HOST}:${port}`;
}
console.log(makeProxy({ country: "gb", stickyMinutes: 15 }));
Check it with curl
curl -x http://global.socksnode.com:9000 \
-U "USERNAME-country-us:PASSWORD" \
https://api.ipify.org
Run it twice and you should see two different IPs. Switch to port 10000 with a session piece and the same two runs must return one IP.
Things worth knowing
This works on Pool 1, which is the default pool and also the largest one. Pool 2, Pool 3 and the Mix name their targets differently in each country, so for those the Generator in your dashboard or the API is the easier route.
You are billed for the traffic that actually flows, never for the number of proxies you create. Building ten strings or ten thousand costs the same. A string you never dial simply does not exist.
Your password is shared across the whole account. If it leaks anywhere, open the Generator and rotate it. Every old string stops working immediately.
Frequently asked questions
Do I need an API key to create proxies this way?
No. The username carries the whole configuration, so your code builds the proxy string on its own. An API key is only needed if you want to call our REST endpoints for things like balance, orders or the other pools.
Is there a limit on how many proxy strings I can build?
No. Building a string is just text in your own code, so nothing is counted and nothing is charged. You are billed for the traffic that actually flows through the proxies you dial.
Why does my sticky session not hold the same IP?
A session only works on the IP holding ports, 10000 for HTTP and 12000 for SOCKS5. On a rotating port the gateway refuses the connection. Also check that lifetime is in minutes, with 1440 as the maximum.


