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

  1. Open Portal → Proxy IPs.
  2. Find the Rotating Gateway IPs section.
  3. Copy the HTTP and SOCKS5 endpoints shown for your account.
ModeHostPort
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_KEY

HTTP targeting headers

ParameterSyntaxExample
Session IDX-Session-IDcheckout-flow-42
CountryX-Target-GeoUS
CityX-Target-CityNewYork
ISPX-Target-ISPComcast
ASNX-Target-ASNAS7922
Provider typeX-Provider-Typeresidential
Session durationX-Session-Duration30

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

Use these docs with AI

Start with the AI guide or hand llms.txt to your assistant.
Use with AI
llms.txt