WebScrapingAPI Docs
Web Scraping APIAdvanced API Features

Geolocation

Route WebScrapingAPI requests through a specific country, city, or ASN.

Use geolocation parameters when the target site serves different content by visitor location. Add country to choose a proxy country, then optionally narrow the request with city, state, or asn.

For Google scraping, prefer the Google gl parameter for search-country targeting. Do not combine Google gl with WebScrapingAPI country on the same request.

Request

curl --get "https://api.webscrapingapi.com/v2" \
  --data-urlencode "api_key=YOUR_API_KEY" \
  --data-urlencode "url=https://httpbin.org/ip" \
  --data-urlencode "country=de" \
  --data-urlencode "city=berlin" \
  --data-urlencode "asn=3320"

Parameters

NameRequiredDescription
api_key✅Your WebScrapingAPI key.
url✅Target URL.
country❌Two-letter country code, such as de, us, or gb.
city❌Lowercase city name without spaces. Use with country.
state❌State code for locations where city names need disambiguation.
asn❌Autonomous System Number used to target a specific network.

Response

The API returns the target response body. With httpbin.org/ip, the returned IP is useful for checking the selected route.

{
  "origin": "203.0.113.42"
}

Targeting availability can vary by plan, geography, and network. If a city or ASN is unavailable, retry with a broader country-level request or contact support for coverage options.

On this page