Invita a un amigo: ganas el 15% de cada pedido y él un 10% de descuento
InicioDocumentación502 and 400: no exit available

502 and 400: no exit available

Both mean the gateway could not give you what you asked for. Neither is a fault in your credentials.

400, unknown country or city

The location you named has no addresses available at that moment. City-level requests produce this most often, because coverage follows the devices that happen to be online.

Check the spelling first: hyphens rather than spaces, upper-case country code. If the spelling is right, the pool is simply empty right now.

502, upstream refused

The gateway could not establish a route through any matching exit. A single 502 is normal background noise on a residential network and a retry usually succeeds.

A 502 that persists for more than a minute on the same targeting means the pool for that description is drained. Widen the targeting or switch country, and write to support if it continues.

Falling back properly

Drop granularity rather than retrying the same request. City to country, country to unrestricted, and record which level actually served the data so your dataset stays honest.

Never retry either error in a tight loop. On metered products every attempt costs traffic, and on all products it delays the fallback that would have worked.

A fallback ladder

for attempt in (city_level, country_level, no_geo):
    try:
        return fetch(url, proxy=attempt())
    except (GeoUnavailable, UpstreamRefused):
        continue
raise NoRouteAvailable

Telling stock problems from setup problems

Both errors describe the pool rather than your account, but they arrive for different reasons and one of them is worth retrying while the other is not.

A quick way to separate them: request the same targeting without the city, then without the country. If the bare login works, the problem is availability at the level you asked for.

Narrowing it down

curl -x login_c_US_city_New-York:pass@proxy.sotaproxy.com:10000 https://api.ipify.org   # 400?
curl -x login_c_US:pass@proxy.sotaproxy.com:10000 https://api.ipify.org                 # works?
curl -x login:pass@proxy.sotaproxy.com:10000 https://api.ipify.org                      # works?

# Works at country level  -> city pool is empty right now
# Fails at every level    -> write to support, that is not normal