Geographic targeting
Select supported countries and optional region, city, or network targeting safely.
Target only as precisely as the workload requires
Start with country. Add a more precise target only when the selected proxy
type returns that option. Narrower targeting reduces the eligible address pool,
so it can reduce availability compared with country-only routing.
| Field | Requirement |
|---|---|
country | A two-letter country value returned by countries, such as US or GB. |
state | Requires country; send the exact value returned in states. |
city | Requires country; send the exact value returned in cities. It cannot be combined with state. |
asn | Requires country; send the exact network value returned in asns. |
operating_system | Optional network-device characteristic returned in operating_systems; it is not a geographic field. Send its value, not its display label. |
Load dependent options
Country selection determines the available states, cities, and ASNs. Query
options again after the customer chooses a country:
curl --fail-with-body --silent --show-error \
'https://api.raspbytes.com/api/v1/proxy/proxies/options/?proxy_type=residential&country=US' \
-H "X-API-Key: $RASPBYTES_API_KEY"Do not reuse state, city, or ASN values from another country or proxy type.
Refresh the options if the API rejects a previously accepted combination.
Create a targeted connection
This example uses a city value selected from the current options response:
curl --fail-with-body --silent --show-error \
-X POST 'https://api.raspbytes.com/api/v1/proxy/proxies/get_proxy/' \
-H "X-API-Key: $RASPBYTES_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"proxy_type": "residential",
"session_type": "rotating",
"country": "US",
"city": "new-york",
"protocol": "http"
}'If exact city continuity is unnecessary, omit city and use country-only
targeting. Omit all targeting fields when any available location is acceptable.
Updated 16 days ago

