Proxies & geolocation
Route a request through a specific country.
The Web Access API picks a standard or premium proxy tier for each request, and the tier sets the price. You control
the country with countryCode.
countryCode
An ISO 3166-1 alpha-2 country code routes the request through a proxy in that country. Useful for geo-restricted or geo-personalized content.
curl https://request.usestring.ai/v1/fetch \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "url": "https://example.com", "countryCode": "US" }'The value is validated against the list of supported country codes and normalized to uppercase. When a request can't be routed from the country you asked for, it fails with one of the errors below rather than going out from another country.
Proxy tier affects price
A request on the premium tier costs more than one on standard. The
x-billed-request-type header says which tier a request was
billed at. See Pricing.
Errors
Both errors use the standard error shape, with the code in error.
error | Status | Meaning | Fix |
|---|---|---|---|
unsupported_geography | 400 | Requests can't be routed from this country, for example KP or AQ. | Send a different countryCode, or omit it. |
geography_unavailable | 503 | No exit in this country was available for this request. | Retry, or omit countryCode. |