Making sense of Google Maps longitude, latitude and zoom to better guide your SerpApi `ll` parameter for data scraping

Justin O'Hara
SerpApi
Published in
3 min readMay 17, 2021
SerpApi’s Google Maps API playground highlighting the `ll` parameter and `search_parameters`

In parallel with the blog I wrote last week titled “Geographic Location and Localization parameters on SerpApi’s Google Search API” . I decided to focus on, explain and make sense of the ll parameter that is used on SerpApi’s Google Maps API.

Geographic Location card found on SerpApi’s playground

When you open up the playground from the Google Maps Api docs you can see that there is a Geographic Location parameter card in the top left hand corner. It has an ll displayed parameter that equates to GPS Coordinates.

There is a string = @40.7455096,-74.0083012,14z in the field for the playground. Based on the HTML displayed, I know that this string of GPS Coordinates is referring to Manhattan, New York City. And although I am not much of a cartographer, I knew it had to have been longitude, latitude and some other field.

When you hover over the question mark next to the GPS Coordinates label the following text pops up:

Parameter defines GPS coordinates of location where you want your q (query) to be applied. It has to be constructed in the next sequence:
@ + latitude + , + longitude + , + zoom

This will form a string that looks like this:
e.g. @40.7455096,-74.0083012,14z. The zoom parameter is optional but recommended for higher precision (it ranges from 3z, map completely zoomed out - to 21z, map completely zoomed in). The parameter should only be used when type is set to search.

* Parameter is required when using pagination.

This snippet explains what the number followed by z means. And also gives us a better understanding of what we need to do to get to the next step of our custom search.

Not all searches that users want are in Manhattan…so when I am using the SerpApi playground to match the parameters, it’s important to source the longitude, latitude and zoom for a specific search zone. As a general rule of thumb, I always like to match up url parameters from Google to the SerpApi playground demonstration area. I open up a browser to the url that I would want to scrape and see if there are any extraneous url encoded parameters to better specify a search.

Google Maps set to Austin, Texas

After opening Google Maps in your browser there may be a cookie/session to create a position to your location.

I copied over that specific string for Austin, Texas and moved it into the ll parameter to get the results for “coffee” in Austin.

SerpApi’s Google Maps Api playground querying “coffee” set to Austin, Texas

There is a big difference between the localization parameters of searches between Google Maps API and Google Organic Search. To understand the ll parameter for SerpApi’s Google Maps API can lead you to great customizable searches and plenty of data for businesses and other places.

You can sign-up for SerpApi here: https://serpapi.com/

You can find the SerpApi user forum here: https://forum.serpapi.com/

You can find the API documentation here: https://serpapi.com/search-api/

--

--