Short answer: uule is the URL parameter that tells Google which place a search is made from. With /google/search you do not have to build it: send "location":"Austin,Texas,United States" and the request goes to Google with the right uule. If you already have a uule string, you can send that as it is.
gl picks a country. It does not pick a city, and for anything local — "coffee shops", "plumber", "pizza" — the city is what decides the results.
Step 1: look up the exact name
Google only accepts its own canonical names. The lookup is a GET and costs nothing:
curl 'https://api.serpbase.dev/google/locations?q=austin&limit=5' \
-H 'X-API-Key: YOUR_API_KEY'
On 27 November 2026 this returned five places called Austin, among them Austin,Quebec,Canada, Austin,Indiana,United States and the one most people mean, Austin,Texas,United States. Each has canonical_name, name, country_code and target_type (City, Municipality and so on). Add country_code=DE to narrow it: q=munich&country_code=DE returned Munich,Bavaria,Germany and Taufkirchen,Munich,Bavaria,Germany.
Step 2: search from that place
curl -X POST 'https://api.serpbase.dev/google/search' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR_API_KEY' \
-d '{"q":"coffee shops","gl":"us","hl":"en","location":"Austin,Texas,United States"}'
What we measured
Same query, coffee shops, two cities, same day:
location | local_results addresses | First organic title |
|---|---|---|
Austin,Texas,United States | 715 Red River St; 80 Rainey St; 411 Brazos St | The Best Coffee Shops in Austin to Get Your Work On |
Boston,Massachusetts,United States | 665 Washington St; 290-296 Hanover St; 255 Hanover St | My 14 Favorite Coffee Shops In Boston (By a Local) |
The search_url in the Austin answer showed what was sent to Google: uule=w+CAIQICIaQXVzdGluLFRleGFzLFVuaXRlZCBTdGF0ZXM=.
Your own uule. We also sent "uule":"w+CAIQICIiQm9zdG9uLE1hc3NhY2h1c2V0dHMsVW5pdGVkIFN0YXRlcw==" with q=pizza and no location. The local results were Boston pizzerias (168 Cambridge St, 1252 Washington St, 280 Cambridge St).
How a uule string is built
For a place name it is a fixed prefix, one character that encodes the length of the name, and the name in base64:
import base64
ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
def uule(canonical_name):
key = ALPHABET[len(canonical_name)]
b64 = base64.b64encode(canonical_name.encode()).decode()
return "w+CAIQICI" + key + b64
print(uule("Austin,Texas,United States"))
# w+CAIQICIaQXVzdGluLFRleGFzLFVuaXRlZCBTdGF0ZXM=
That prints the same string we saw in search_url above. The name is 26 characters long, and character 26 of the alphabet is a.
Python: one keyword across several cities
import time, requests
CITIES = ["Austin,Texas,United States", "Boston,Massachusetts,United States"]
for city in CITIES:
r = requests.post(
"https://api.serpbase.dev/google/search",
headers={"X-API-Key": "YOUR_API_KEY"},
json={"q": "coffee shops", "gl": "us", "hl": "en", "location": city},
timeout=60,
).json()
if r["status"] != 0:
print(city, "failed:", r.get("error"))
continue
for p in r.get("local_results", []):
print(city.split(",")[0], "|", p["title"], "|", p.get("address"))
time.sleep(1)
Things that trip people up
- A name that is not in Google's list is not sent, per the docs, and the search runs as if you had not set a location. Look the name up first; do not guess
Austin, TX. - Send
locationoruule, not both. - Keep the default (mobile) device for
location. Per the docs it takes effect on mobile; on desktop Google places the search by network address. - Match
glandhlto the place. A German city withgl=usgives you an odd mix. - Check
search_urlin the answer. If there is nouule=in it, your location was not applied. - Same credit with or without a location. The lookup is free; the search is 1 credit.
Related reading
Localized Google results covers country and language. For the places themselves see the local pack.
Cost and limits
Each search costs 1 credit; failed requests are not charged. The response is always HTTP 200 with a status field: 0 means success, anything else comes with an error string. Credits cost $0.25–$0.50 per 1,000 depending on the plan, and new accounts get 500 free credits without a card.
- Parameters and the full response: Google web search docs
- Try it in the browser: Google web search
- Credit packs: pricing