Code examples
Working proxy examples in cURL, Python and Node.js. The examples below use Budget Unlimited (residential.proxyomega.com:10000), but the same pattern works for every product. Swap the host and port and you're done.
Before you start
These examples assume username + password authentication. Your username and password are shown in your dashboard. If you prefer credential-free access, add your server's public IP under Whitelist and drop the user:pass@ part of the URL. See Authentication for both methods.
Throughout, replace USER and PASS with your own credentials. Targeting parameters are appended to the username (dash-separated); the password never changes. For the full parameter list see Targeting, and for how sticky sessions work see Sessions & rotation.
http:// for socks5://, for example socks5://USER:[email protected]:10000. Budget Unlimited supports HTTP, HTTPS and SOCKS5.cURL
The -x flag sets the proxy. We hit https://api.ipify.org so the response is just the exit IP the request came out on.
Rotating (new IP each request)
Omit -session to get a fresh IP on every request:
# Rotating - run it twice, you'll see two different IPs
curl -x "http://USER:[email protected]:10000" https://api.ipify.org
curl -x "http://USER:[email protected]:10000" https://api.ipify.org
Sticky + country
Add -country-us to target the United States, -session-abc123 to hold one IP, and -ttl-30 to keep that IP for 30 minutes:
# US exit, same IP held for 30 minutes
curl -x "http://USER-country-us-session-abc123-ttl-30:[email protected]:10000" https://api.ipify.org
socks5:// scheme: curl -x "socks5://USER:[email protected]:10000" https://api.ipify.org.Python (requests)
The requests library takes a proxies dict. Set the same proxy URL for both the http and https keys so all traffic is routed:
Rotating (new IP each request)
import requests
proxy = "http://USER:[email protected]:10000"
proxies = {"http": proxy, "https": proxy}
# Each call rotates to a new IP
for _ in range(2):
r = requests.get("https://api.ipify.org", proxies=proxies, timeout=30)
print(r.text)
Sticky + country
Put the targeting parameters in the username. Here we pin a US IP for 30 minutes:
import requests
user = "USER-country-us-session-abc123-ttl-30"
proxy = f"http://{user}:[email protected]:10000"
proxies = {"http": proxy, "https": proxy}
r = requests.get("https://api.ipify.org", proxies=proxies, timeout=30)
print(r.text) # same IP for the life of the session
pip install "requests[socks]", then use the socks5:// scheme in the proxy URL, for example socks5://USER:[email protected]:10000.Node.js
Two common approaches: axios with https-proxy-agent, or the built-in fetch with an agent.
axios + https-proxy-agent (rotating)
Install the agent with npm install axios https-proxy-agent. Passing the agent as both httpProxy and httpsProxy ensures every request is routed:
import axios from "axios";
import { HttpsProxyAgent } from "https-proxy-agent";
const proxy = "http://USER:[email protected]:10000";
const agent = new HttpsProxyAgent(proxy);
// Each request rotates to a new IP
for (let i = 0; i < 2; i++) {
const res = await axios.get("https://api.ipify.org", {
httpAgent: agent,
httpsAgent: agent,
proxy: false, // let the agent handle it
});
console.log(res.data);
}
fetch + agent (sticky + country)
Node's built-in fetch accepts a dispatcher/agent. Put the targeting parameters in the username to pin a US IP for 30 minutes:
import { HttpsProxyAgent } from "https-proxy-agent";
const user = "USER-country-us-session-abc123-ttl-30";
const proxy = `http://${user}:[email protected]:10000`;
const agent = new HttpsProxyAgent(proxy);
const res = await fetch("https://api.ipify.org", { agent });
console.log(await res.text()); // same IP for the whole session
https-proxy-agent for socks-proxy-agent (npm install socks-proxy-agent) and build the agent from a socks5://USER:[email protected]:10000 URL.Rotating vs sticky in code
The only thing that controls rotation is the -session value in your username:
- Rotating. Omit
-sessionentirely, or send a fresh value each time. Every request exits from a new IP. - Sticky. Keep the same
-sessionvalue across requests. All those requests share one IP. Add-ttl-<minutes>to control how long that IP is held (Budget Unlimited: up to 24 hours).
The same three usernames, side by side, show it clearly:
# Rotating: no session - new IP every request
USER-country-us
# Sticky "session A": every request with this string shares one IP
USER-country-us-session-A-ttl-30
# Sticky "session B": a different string = a different held IP
USER-country-us-session-B-ttl-30
To force a rotation on a sticky session, change the session string (for example bump a counter: -session-batch1, -session-batch2, and so on). In code that usually means interpolating a variable:
# A fresh sticky IP per worker, each held for 10 minutes
for worker_id in range(5):
user = f"USER-country-us-session-worker{worker_id}-ttl-10"
proxy = f"http://{user}:[email protected]:10000"
proxies = {"http": proxy, "https": proxy}
r = requests.get("https://api.ipify.org", proxies=proxies, timeout=30)
print(worker_id, r.text)
Swapping products
To adapt any example above to a different product, change the host and port, plus the targeting parameters where they are supported. Everything else stays identical: the username/password format and the code structure don't change.
| Product | Host | Port | Protocols | Targeting in username |
|---|---|---|---|---|
| Budget Unlimited | residential.proxyomega.com | 10000-10099 | HTTP, HTTPS, SOCKS5 | country, session, ttl |
| Premium Unlimited | assigned in dashboard | 8000 | HTTP, HTTPS, SOCKS5 | country, state, city, session, ttl |
| Residential / ISP | platinum.proxyomega.com | 20228 | HTTPS, SOCKS5 | country, state, city, asn, session, ttl |
| Mobile | mobile.proxyomega.com | 20229 | HTTPS, SOCKS5 | country, session, ttl |
| IPv6 | ipv6.proxyomega.com | 9000 | HTTP, HTTPS, SOCKS5 | country, session |
| Static ISP | isp.proxyomega.com | 30000-30099 | HTTP, SOCKS5 | none; each port is a fixed IP |
For example, the same rotating cURL call against Residential/ISP with ASN and city targeting:
# Residential / ISP - Los Angeles, AS7018, sticky 15 min (HTTPS/SOCKS5 only)
curl -x "https://USER-country-us-state-california-city-losangeles-asn-7018-session-la1-ttl-15:[email protected]:20228" https://api.ipify.org
Static ISP needs no rotation parameters at all. Each port from 30000 to 30099 is already one of your dedicated pinned IPs:
# Static ISP - connect straight to a pinned IP, no targeting params
curl -x "http://USER:[email protected]:30000" https://api.ipify.org
Next steps
Targeting
The full list of country, state, city and ASN parameters, and which products accept each. Read Targeting →
Sessions & rotation
How -session and -ttl control sticky IPs, and the maximum sticky duration per product. Read Sessions & rotation →
Authentication
Username/password versus IP whitelist, and how to connect with no credentials at all. Read Authentication →
Last updated July 6, 2026