Rotating Gateway Proxies
Rotating gateway proxies are shared gateway endpoints that route traffic through upstream providers based on the options you send with the request. Use the exact rotating HTTP/SOCKS endpoints shown in your account.
Unlike assigned/static endpoints, rotating gateways support request-level routing controls such as sticky sessions and HTTP targeting headers. The exact endpoint values are account-specific and should be copied from Portal → Proxy IPs.
Supported today: HTTP proxy supports routing headers for geo/city/ISP/ASN and provider type. SOCKS5 supports sticky sessions through the username suffix. Charges are usage-based and deducted from your account balance.
Find your endpoint
- Open Portal → Proxy IPs.
- Find the Rotating Gateway IPs section.
- Copy the HTTP and SOCKS5 endpoints shown for your account.
| Mode | Host | Port |
|---|---|---|
| Rotating HTTP endpoint | <ROTATING_HTTP_ENDPOINT> | Portal-assigned |
| Rotating SOCKS5 endpoint | <ROTATING_SOCKS_ENDPOINT> | Portal-assigned |
Authentication & control model
Default rotation
Use your username and API key directly. Each request can take a different route.
http://USERNAME:API_KEY@<ROTATING_HTTP_ENDPOINT>Sticky session
Use either an X-Session-ID header (HTTP) or a username suffix to request stickiness.
USERNAME-session-checkoutflow42:API_KEYHTTP targeting headers
| Parameter | Syntax | Example |
|---|---|---|
| Session ID | X-Session-ID | checkout-flow-42 |
| Country | X-Target-Geo | US |
| City | X-Target-City | NewYork |
| ISP | X-Target-ISP | Comcast |
| ASN | X-Target-ASN | AS7922 |
| Provider type | X-Provider-Type | residential |
| Session duration | X-Session-Duration | 30 |
Code examples
curl
# Default rotation
curl -x "http://<USERNAME>:<API_KEY>@<ROTATING_HTTP_ENDPOINT>" "https://ip.ninjasproxy.com/"
# Sticky session via header
curl -x "http://<USERNAME>:<API_KEY>@<ROTATING_HTTP_ENDPOINT>" -H "X-Session-ID: checkout-flow-42" "https://ip.ninjasproxy.com/"
# Geo / city / ISP targeting
curl -x "http://<USERNAME>:<API_KEY>@<ROTATING_HTTP_ENDPOINT>" -H "X-Target-Geo: US" -H "X-Target-City: NewYork" -H "X-Target-ISP: Comcast" "https://ip.ninjasproxy.com/"SOCKS5 sticky session
curl --socks5-hostname "<ROTATING_SOCKS_ENDPOINT>" --proxy-user "<USERNAME>-checkoutflow42:<API_KEY>" "https://ip.ninjasproxy.com/"Python
import requests
proxy = "http://<USERNAME>:<API_KEY>@<ROTATING_HTTP_ENDPOINT>"
headers = {
"X-Session-ID": "cart-1",
"X-Target-Geo": "US",
"X-Target-City": "NewYork",
}
response = requests.get(
"https://ip.ninjasproxy.com/",
proxies={"http": proxy, "https": proxy},
headers=headers,
timeout=20,
)
print(response.text.strip())Next Steps
- Authentication — credential and whitelist setup
- Rate limits — connection reuse, retries, and concurrency
- curl integration — fastest path for debugging gateway requests
- API Reference — account and endpoint APIs
