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
| Name | What it does |
|---|---|
gl | Country of the results, as a two-letter code: us, gb, de, jp… |
hl | Language of the page: en, de, ja, pt-BR… Pair it with gl for the same market. |
location | Search as if from a city or region, e.g. "Munich,Bavaria,Germany". Phone results only; names come from GET /google/locations. |
device | mobile (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.
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"}'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.
/google/locations?q=munich&country_code=de&limit=5q (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.
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"}'{
"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 location | gl | City example |
|---|---|---|
| United States | us | New York,New York,United States |
| United Kingdom | gb | London,England,United Kingdom |
| Germany | de | Munich,Bavaria,Germany |
| Austria | at | Vienna,Vienna,Austria |
| Switzerland | ch | Zurich,Zurich,Switzerland |
| France | fr | Paris,Ile-de-France,France |
| Italy | it | Milan,Lombardy,Italy |
| Spain | es | Madrid,Community of Madrid,Spain |
| Poland | pl | Warsaw,Masovian Voivodeship,Poland |
| Canada | ca | Toronto,Ontario,Canada |
| Australia | au | Sydney,New South Wales,Australia |
| Japan | jp | Tokyo,Tokyo,Japan |
| Indonesia | id | Jakarta,Jakarta,Indonesia |
| Philippines | ph | Manila,Metro Manila,Philippines |
| Brazil | br | Sao Paulo,State of Sao Paulo,Brazil |
| Mexico | mx | Mexico 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).