Documentation

Geo Targeting

Country-tagged proxies, sticky routing and per-engine behaviour.

A country request is only as good as the exit IP behind it. Tag proxies with a country and the API routes matching requests through them.

Tagging proxies

PROXY_POOL_URLS=[
  "http://user:pass@gate.example.com:10000#country=us",
  "http://user:pass@gate.example.com:10001#country=de",
  "http://user:pass@gate.example.com:10002?country=gb",
  "http://user:pass@gate.example.com:10003"
]

#us, #country=us, #geo=us and ?country=us are all accepted. Untagged entries stay in the rotation for requests that do not ask for a country, and act as a fallback when the requested country is missing.

What each engine can do

EngineCountry via URLNeeds a matching proxy
google_searchgl, plus uule for locationNo
bing_searchcc and market (en-DE)Yes — Bing answers an unmatched cc with an empty page
yahoo_searchNoneYes — localization comes from the exit IP
brave_searchNoneYes — localization comes from the exit IP

A country the pool cannot serve returns 400 ERR_PARAM_002 instead of silently empty results.

Sticky routing

Selection is hashed from engine, country and device, so the same work keeps the same exit IP between pages. That matters for multi-page checks, where a mid-run IP change can reshuffle results. Failed proxies are skipped for 30 seconds and dropped after three consecutive failures.

Examples

# Google, German market, no proxy requirement
curl -H "X-API-Key: $OPENSERP_KEY"   "http://localhost:7000/v1/search?q=serp+api&engine=google_search&country=de"

# Bing, German market through a #country=de proxy
curl -H "X-API-Key: $OPENSERP_KEY"   "http://localhost:7000/v1/search?q=serp+api&engine=bing_search&country=de"

The response reports what actually happened: metadata.geo.proxyCountry, proxyMatched and urlParameter. Check GET /proxies for the countries your pool covers.