No KYC — no ID, no selfie, no documents. Pay in crypto: BTC, USDT, USDC, ETH, SOL, LTC
Language: English
Get an API key

Docs · Locations · API v1

Locations and languages: gl, hl, location, google_domain and device

Four parameters decide whose results you get: the country, the interface language, the city and the device. This page explains each one and lists the codes for 25 common markets.

Last updated: · 5 min read

Quick answer

How do I get Google results for a specific country and city through a SERP API?

With SerpCrypto, set gl to the country code, hl to the language and location to a city written City, Region, Country, such as Austin, Texas, United States. Add device=mobile for phone results. Each combination is one search at 1 credit, from $0.30/1K searches, and the answer echoes the settings it applied. Paid in crypto, with no KYC.

What does each location parameter do?

Country (gl), language (hl), Google domain and a city-level location string, on desktop or mobile.

ParameterDefaultEffect
glusCountry of the results. Two letters, ISO 3166-1, lower case. Use gb for the United Kingdom.
hlenLanguage of the interface: labels, People Also Ask and some snippets follow it.
locationnoneA precise place inside the country, for local packs and city-level rankings.
google_domaindomain of glWhich Google domain runs the search, such as google.de. Ignored for Bing.
devicedesktopdesktop or mobile: layouts and local blocks differ between the two.

What is the difference between gl, hl and location?

gl says which country's results you want. hl says which language the person reads, which changes the interface and often the questions and snippets. location narrows the country down to a city or region, which matters as soon as a query has a local intent.

They combine freely. A French speaker in Switzerland is gl=ch, hl=fr. An English-language search from Berlin is gl=de, hl=en, location=Berlin, Berlin, Germany. Keep gl and the country of location the same: a city in one country with gl of another gives results that no real visitor sees.

How do I target a city?

Write the place in English, from the smallest unit to the largest: City, Region, Country. Examples: Austin, Texas, United States, Manchester, England, United Kingdom, Munich, Bavaria, Germany, Lyon, Auvergne-Rhone-Alpes, France. Use the name of the city, not a street or a postcode.

Check search_parameters.location in the answer: it shows the place that was applied. A value that cannot be used returns 400 invalid_parameter and costs nothing, so you can test a list of places cheaply.

curl + jq: the local pack for one query in two cities
# The same query from two cities: compare the local packs
for city in "Austin, Texas, United States" "Denver, Colorado, United States"; do
  curl -sG "https://serpcrypto.com/api/v1/search" \
    -H "Authorization: Bearer $SERPCRYPTO_API_KEY" \
    --data-urlencode "q=emergency plumber" \
    --data-urlencode "location=$city" \
    -d gl=us -d hl=en -d device=mobile \
    | jq -r --arg city "$city" '.local_results[]? | "\($city)\t\(.position)\t\(.title)"'
done

Which codes should I use for common markets?

25 frequent markets. google_domain defaults to the domain of gl, so you rarely need to set it.

CountryglTypical hlGoogle domain
United Statesusengoogle.com
United Kingdomgbengoogle.co.uk
Canadacaen, frgoogle.ca
Australiaauengoogle.com.au
Irelandieengoogle.ie
New Zealandnzengoogle.co.nz
Germanydedegoogle.de
Francefrfrgoogle.fr
Spainesesgoogle.es
Italyititgoogle.it
Netherlandsnlnlgoogle.nl
Switzerlandchde, fr, itgoogle.ch
Polandplplgoogle.pl
Swedensesvgoogle.se
Turkeytrtrgoogle.com.tr
Brazilbrpt-BRgoogle.com.br
Mexicomxesgoogle.com.mx
Argentinaaresgoogle.com.ar
Indiainen, higoogle.co.in
Japanjpjagoogle.co.jp
South Koreakrkogoogle.co.kr
Indonesiaididgoogle.co.id
Vietnamvnvigoogle.com.vn
Singaporesgengoogle.com.sg
South Africazaengoogle.co.za

Language codes are the ones Google uses in its interface; for a bilingual country, pick the language your audience reads.

Which Google domain should I use?

Usually none: leave google_domain out and the API uses the domain of the gl country, as in the table above. Set it only to reproduce a specific setup, for example google.com with gl=gb.

The domain alone does not define the country of the results. gl and location do most of the work, which is why the answer records all three in search_parameters.

Do mobile and desktop results differ?

Often, yes. The mobile page can order blocks differently, show more local results for nearby intents and cut snippets shorter. If your visitors mostly use phones, track device=mobile; for a full picture, track both and store the device with each ranking.

Each device is a separate search, so tracking both doubles the credits for those keywords. At $0.56/1K searches on the 100,000 searches pack, 1,000 keywords on two devices for 30 days use 60,000 searches.

How do I compare several countries in one script?

Loop over a list of markets and keep what the API applied. The Python example sends one query to three countries with a city each and prints the domain used and the first link.

Python: one query, three markets
import os

import requests

MARKETS = [
    {"gl": "de", "hl": "de", "location": "Munich, Bavaria, Germany"},
    {"gl": "fr", "hl": "fr", "location": "Lyon, Auvergne-Rhone-Alpes, France"},
    {"gl": "br", "hl": "pt-BR", "location": "Curitiba, State of Parana, Brazil"},
]

for market in MARKETS:
    r = requests.get(
        "https://serpcrypto.com/api/v1/search",
        params={"q": "running shoes", **market},
        headers={"Authorization": "Bearer " + os.environ["SERPCRYPTO_API_KEY"]},
        timeout=60,
    )
    r.raise_for_status()
    applied = r.json()["search_parameters"]
    top = r.json().get("organic_results", [])[:1]
    print(applied["gl"], applied.get("google_domain"), [x["link"] for x in top])

Does Bing take the same parameters?

Yes for q, gl, hl, device and page: use the same codes with engine=bing. google_domain does not apply to Bing and is ignored. The answer has the same frame, with organic_results and related_searches; see the Bing page for its use cases.

Location questions

Can I search from a ZIP code or GPS coordinates?

Not in version 1. location takes a city-level place name. For results around a point on a map, use engine=google_maps with a query that names the area, such as dentist Brooklyn.

Why do I get English labels with gl=de?

Because hl defaults to en. Set hl=de as well to get the German interface, questions and labels a person in Germany sees.

No. Every search costs 1 credit, whatever the country, city, language or device. Prepaid search credits never expire: unused searches stay on your account until you use them.

Which code is the United Kingdom?

Use gb, its ISO 3166-1 code. The Google domain for it is google.co.uk, which the API picks for you when gl=gb.

From $0.30/1K searches · no KYC

Get an API key