When people visit a search engine and perform a search, they often assume the only thing they’ve “sent” to the search engine is the query itself: "How is chocolate made?" or "Best vehicle in MarioKart?".

In reality, every search is packed with implicit metadata: your device, your language, your rough geolocation, (sometimes even your movement patterns) and search engines uses all of it to personalise your SERP (Search Engine Results Page).

This is why two people can search the exact same query at the exact same time and get totally different results.

Among all personalisation signals, location is one of the strongest. Search engines wants to show the result that is locally relevant, not just globally popular.

How Does the Engine Know Where I Am?

It can be disconcerting when you start to learn how much information is available to providers like Google, or Bing - but it's always a good idea to become aware of the various clues that give those search engines enough certainty to tailor results for a more relevant experience.

Let's take a look at some of those now - along with how we can use SerpApi's parameters to help us replicate the kinds of results we'd get directly from the browser:

IP Address (Network-Level Location)

An IP address (Internet Protocol address) is a unique numerical label assigned to every device (like a computer, phone, or router) connected to a computer network that uses the Internet Protocol for communication.

Think of it as the digital address for your device. Its primary functions are:

  1. Identification: It uniquely identifies your device within a network.
  2. Location Addressing: It provides the location of the device within the network infrastructure, allowing data packets to be routed correctly from a sender to a specific destination.

There are two main versions of the Internet Protocol, IPv4 (version 4) and IPv6 (version 6). Here are some examples:

  • IPv4 address: 203.0.113.45
  • IPv6 address: 2001:0db8:85a3:0000:0000:8a2e:0370:7334

Your IP address leaks a surprising amount of location data. Google can infer:

  • Approximate geographic location (typically city-level accuracy)
  • Your ISP or carrier
  • Network contextual info such as:
    • Home vs. corporate vs. school network
    • Mobile carrier CGNAT
    • VPN/proxy usage
    • Datacenter IP ranges (strong spam/fraud signals)

Search engines uses IP-derived metadata to infer:

  • Local preferences (e.g., British English vs US English)
  • Expected intent (e.g., searching “football” in Spain vs the US produces very different results)
  • Local commerce (nearby stores, currency, inventory)
  • Whether you’re traveling (IPs changing city/country quickly)

SerpApi Parameters To The Rescue!

SerpApi offers a set of parameters which are designed to help you approximate IP-Based Location - let's take a look at those now:

Engine: google
Parameter: location

Purpose: This parameter is a human-readable location string that SerpApi translates into a lat/long precise enough for Google.

NOTE: even the difference of a single city can alter up to 50-60% of the SERP!!!

Examples:
  • "Paris, France"
  • "Austin, Texas, United States"
  • "Berlin"

This is usually the closest match to what Google does with IP.

Engine: google
Parameter: uule

Purpose: UULE is an encoded location parameter used by Google internally. This parameter is often more specific than the location string, sometimes carrying more precise latitude and longitude data, or representing a more stable geocoding. It has historically been Google's preferred method for highly specific location targeting in search!

uule is often used for highly precise or technical geographic targeting, whereas location is the user-friendly approximation.

SerpApi provides tools to allow you to encode/decode your own uule values!

Engine: google
Parameter: google_domain

Purpose: Specifies the country-specific Google domain.

Examples:

  • google.co.uk
  • google.es
  • google.com.br

The country-level domain is used by Google as a strong localisation signal. While Google currently prioritise gl to infer the user's intended country, it's highly recommended to use both gl and google_domain together (ensuring both values are congruent).

Try this:
  1. Search with "coffee" using location="London, UK"
  2. Repeat with "New York, NY"
  3. Compare local info, news snippets, and shopping results

Headers (Language, Device, Browser Context)

When your browser makes a request, it does so via the protocol http.

Part of a http request involves headers: key-value pairs that carry metadata about the request (or response) to provide the server (or client) with information necessary for communication, such as:

  • The content type
  • Authorisation credentials
  • Caching instructions.

Included in the information headers transmit are:

  • User-Agent (desktop Chrome vs iPhone Safari - resulting in significant UI differences)
  • Accept-Language (e.g., "en-GB", "es-ES")
  • Cookies (history, personalisation, A/B experiments)

Search engines use header-derived metadata to infer:

  • Preferred language
  • Preferred region
  • Device form factor
  • Any experimental SERP layout buckets you fall into

SerpApi Parameters for Header-Level Localisation

SerpApi mirrors the important header signals through explicit parameters:

Engine: google
Parameter: hl (Host Language)

Purpose: Controls UI language and some ranking preferences.

Examples:

  • hl=en - English
  • hl=es - Spanish
  • hl=fr - French

Engine: google
Parameter: gl (Global Location)

Purpose: Affects ranking, local pack, and shopping data.

Examples:

  • gl=us - United States
  • gl=uk - United Kingdom
  • gl=de - Germany

NOTE: hl controls the interface language, whereas gl controls the region Google ranks for. These should usually be set together.

Good combinations for consistency:
  • Searching as a UK user: hl=en + gl=uk + location="London"
  • Searching as a Spanish user: hl=es + gl=es + location="Madrid"
  • Searching as a German-speaking Swiss user: hl=de + gl=ch + location="Zurich, Switzerland"
  • Searching as a French-speaking Swiss user: hl=fr + gl=ch + location="Geneva,Switzerland"
  • Searching as an Italian-speaking Swiss user: hl=it + gl=ch + location="Ticino,Switzerland"

Engine: google
Parameter: device

Purpose: Device is another localisation factor (mobile and desktop SERPs differ dramatically). Possible values: desktop or mobile.

Try this:

Run the query "best restaurants" with:

  1. hl=en, gl=us, location="Chicago"
  2. hl=en, gl=uk, location="Manchester"

You should see a completely different set of top ten results per location!

Real-Time Context (Time, Travel, Weather, Activity)

This is the “invisible layer” of personalisation most folks overlook.

Google also knows:

  • Local time
  • Local weather
  • Holiday periods
  • City-level travel patterns (airport → hotel)
  • Mobile IP handoff (moving between towers)

Examples:

  • query: "cricket"
    • In India → sport
    • In the U.S. → insect
  • query: "football"
    • US → NFL
    • EU → Soccer
  • query: "restaurants open now"
    • Depends entirely on local time

SerpApi Parameters for Real-Time Context

SerpApi doesn’t inject weather or travel data, but time zone and local context are indirectly reflected via location information.

If users want the same SERP they see in their browser, the most reliable trio is:

location=...
hl=...
gl=...

This combination gets very close to browser accuracy.

Localisation in SERPs (Where You’ll See Differences Most)

Location dramatically affects:

1. Local Results (Maps)
  • Nearby restaurants
  • Local services
  • “Near me” queries
  • Hours, distance, and directions
2. Organic Results
  • Regional ranking systems
  • Different news publishers
  • Different Wikipedia language versions
3. Shopping Results
  • Local stock
  • Local seller options
  • Currency
  • Delivery times
4. Image/Video Results & Top Stories
  • Strongly tied to country and language

Even changing from one city to another can alter 50–60% of visible results, even for non-local queries.

Summary:

If your goal is:

“Make SerpApi give me the same results I see when I search from my computer”

Then the following combinations should be observed:

Purpose SerpApi Param Notes
Region to rank for gl Must match your country
Interface language hl Typically mirrors browser default
Physical city location Most important signal
Device type device Desktop vs. mobile
Google endpoint google_domain Often google.

Below are some examples of parameter sets for similar searches, across two different locations & devices:

Example: Replicating a UK Chrome Desktop user in London
{
  "engine": "google",
  "q": "best restaurants",
  "hl": "en",
  "gl": "uk",
  "location": "London, England",
  "device": "desktop",
  "google_domain": "google.co.uk"
}
Example: Replicating a Spanish mobile user in Barcelona
{
  "engine": "google",
  "q": "mejores restaurantes",
  "hl": "es",
  "gl": "es",
  "location": "Barcelona, España",
  "device": "mobile",
  "google_domain": "google.es"
}

I hope you found this article helpful. If you have any questions, don't hesitate to reach out to me at roi@serpapi.com.