Box’a’Fox

Targeting

Country, state, city, ASN, ZIP and OS, and which network supports each.

Targeting is set with tokens in the proxy username (Connection strings) or with the matching query parameters of the list endpoints.

TokenList parameterValuesResidentialMobile
_c_countryISO-2, lowercaseYesYes
_st_stateAlias from the locations endpointYes; needs a country, not together with a cityNo
_city_cityAlias from the locations endpointYes; needs a countryYes; needs a country
_asn_asnAS numberYes; needs a countryYes; needs a country
_zip_zipPostal codeNoYes; needs a country
_os_oswindows, android, ios, macYesNo

A token the network does not support is refused: the list endpoints answer 400 bad_target, the gateway answers 400 with X-Proxy-Error: bad_target.

Finding the values

The locations endpoints return what can be targeted right now, with the exact aliases:

# Countries only
curl https://api.boxafox.com/v1/locations/residential -H "X-API-Key: $BOXAFOX_KEY"

# One country with its states, cities and ASNs
curl "https://api.boxafox.com/v1/locations/residential?country=de" -H "X-API-Key: $BOXAFOX_KEY"

The list is refreshed every 6 hours. The endpoints support ETag and If-None-Match, so a client can cache it and ask only whether it changed. supports in the answer says which targeting options the network has.

When no IP matches

If the network has no IP for the location you asked for, the gateway answers 503 with X-Proxy-Error: no_node_for_target. Widen the target (for example drop the city) or try again later.

On this page