SerpBase

Location, language & device

Google answers the same query differently by country, language, city and device. Four parameters choose which version you get.

gl · hl · location · device

NameWhat it does
glCountry of the results, as a two-letter code: us, gb, de, jp…
hlLanguage of the page: en, de, ja, pt-BR… Pair it with gl for the same market.
locationSearch as if from a city or region, e.g. "Munich,Bavaria,Germany". Phone results only; names come from GET /google/locations.
devicemobile (default) or pc. The two layouts differ: some blocks appear on only one of them.

gl and hl apply to most Google endpoints; device and location to Google Web Search. Each endpoint's parameter table lists what it accepts. None of them changes the price.

BASH
curl -X POST https://api.serpbase.dev/google/search \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"q": "coffee shops", "gl": "de", "hl": "de", "location": "Munich,Bavaria,Germany"}'
Search locations

Look up the values Google Search's location parameter accepts. Each result's canonical_name can be passed as location on /google/search. This request does not consume credits.

GET
0 credits
/google/locations?q=munich&country_code=de&limit=5

q (required) matches the place name or canonical name, case-insensitive; country_code filters by ISO 3166-1 alpha-2 code; limit is 1-100 (default 20). Exact names come first, then broader places before narrower ones. Many towns share a name (Paris, France and Paris, Texas), so pass country_code to find the right one. Pass the key in the X-API-Key header.

BASH
curl "https://api.serpbase.dev/google/locations?q=munich&country_code=de&limit=2" \
  -H "X-API-Key: your_api_key"

curl -X POST https://api.serpbase.dev/google/search \
  -H "X-API-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"q":"crossfit software","gl":"de","hl":"de","device":"mobile","location":"Munich,Bavaria,Germany"}'
JSON
{
  "status": 0,
  "locations": [
    {
      "canonical_name": "Munich,Bavaria,Germany",
      "name": "Munich",
      "country_code": "DE",
      "target_type": "City"
    },
    {
      "canonical_name": "Taufkirchen,Munich,Bavaria,Germany",
      "name": "Taufkirchen",
      "country_code": "DE",
      "target_type": "City"
    }
  ]
}
Country locationglCity example
United StatesusNew York,New York,United States
United KingdomgbLondon,England,United Kingdom
GermanydeMunich,Bavaria,Germany
AustriaatVienna,Vienna,Austria
SwitzerlandchZurich,Zurich,Switzerland
FrancefrParis,Ile-de-France,France
ItalyitMilan,Lombardy,Italy
SpainesMadrid,Community of Madrid,Spain
PolandplWarsaw,Masovian Voivodeship,Poland
CanadacaToronto,Ontario,Canada
AustraliaauSydney,New South Wales,Australia
JapanjpTokyo,Tokyo,Japan
IndonesiaidJakarta,Jakarta,Indonesia
PhilippinesphManila,Metro Manila,Philippines
BrazilbrSao Paulo,State of Sao Paulo,Brazil
MexicomxMexico City,Mexico City,Mexico

Limited to 60 lookups per minute per account. A location that is not in this list is ignored rather than rejected: the search still runs, without it. location takes effect only on mobile searches (device mobile, the default).