Bridging Google Local API and Google Maps API
If you’ve ever tried to get structured business or location data from Google Maps or Google Local, you’ve probably run into roadblocks like inconsistent data or time constraints for researching so many locations. That’s where SerpApi comes in.
At SerpApi we scrape structured search engine results from search engines like Google, Bing, Baidu, Yahoo, and many more. Instead of dealing with trying to collect large amounts of data yourself, SerpApi provides clean and ready to use JSON data. We handle all the challenges like rotating proxies, solving captchas, and keeping up with frequent layout changes.
Among our APIs are options that specialize in location-based data. These can help you:
- Find nearby coffee shops to recommend to customers
- Identify hospitals in an area with emergency services
- Compare local businesses for marketing or competitive research
In this blog, we’ll look at two of the most useful APIs for working with local search data Google Local API and Google Maps API .
Google Maps vs Google Local data
Google Local focuses on helping users discover nearby businesses and services through localized search results, while Google Maps provides detailed navigation, directions, and geographic information globally.
You can see they are both generating a list of locations / businesses that match your query as well and your location specified.
For an introduction on Google Local API, review this blog post:
For an introduction on the Google Maps API, review this blog:
Now let's discuss how we connect the two APIs, as they are a bit different. We will need to begin with the ID types and how they differ, as well as how they relate.
Example Use Case: Why would I need to combine both the Google Maps API and the Google Local API?
Imagine you’re building an app that recommends coffee shops to users based on their location. Using the Google Local API, you can quickly get a list of nearby coffee shops, along with useful high level details: name, rating, price range, business type, and a short description. This gives you a starting point but it’s not enough if you want your app to be truly useful.
Users also care about details like:
- Opening hours
- Contact information
- Service options
- Photos and reviews
That’s where the Google Maps Place Results API comes in. By taking the IDs you get from Google Local and connecting them to Maps, you can pull the full business profile that users expect when they click on a location in Google Maps itself.
Within here we can access the hours for every day of the week, the phone number, service options, and everything else you would normally find on this page.
Lucky for us, Google Maps API suite includes a Google Maps Place results API. Even though it is part of Google Maps instead of Google Local, you can still use this API alongside Google Local API.
This is just 1 example of why you may need to combine the two APIs. Now let's discuss how to do just that.
ID Types
As the search engines search for locations differently, they also use different IDs. This includes the IDs they accept as input parameters, as well as the IDs that are in the results. Let's review the differences:
Google Maps API
- Outputs
place_id
: value used for Google Maps APIdata_cid
: value used for Google Maps API and Google Local API
- Inputs
place_id
: value retrieved from Google Maps APIdata_cid
: value retrieved from Google Maps API and Google Local API
Google Local API
- Outputs
data_cid
: value used for Google Maps API and Google Local API- NOTE: this is labeled in the output as
place_id
, however don't get confused with Google Mapsplace_id
- NOTE: this is labeled in the output as
- Inputs
ludocid
: value retrieved from Google Maps API (data_cid
) and Google Local API (place_id
)
Google Local API to Google Maps API
Step 1: Google Local API
First we will want to make our query to Google Local API to find the location(s) we are looking for. In this example we'll continue with searching for "Coffee".
Here is the implementation in Python:
from serpapi import GoogleSearch
import json
params = {
"api_key": YOUR_SECRET_API_KEY,
"engine": "google_local",
"q": "Coffee"
}
results = GoogleSearch(params).get_dict()
Make sure to replace YOUR_SECRET_API_KEY with your API key. To find your API key you can navigate here: https://serpapi.com/manage-api-key.
You can see the engine
is set for google_local
and I've included "Coffee" as my query.
Here is the first result from the local_results
field:
"local_results": [
{
"position": 1,
"rating": 4.8,
"reviews": 869,
"reviews_original": "(869)",
"price": "$1\u201310",
"description": "\"Their espresso is absolutely amazing \u2014 rich, smooth, and perfectly balanced.\"",
"lsig": "AB86z5USn8HGYrRM_vWudVVCTb2d",
"thumbnail": "https://serpapi.com/searches/68bb317701289babb4527979/images/3c15b6aa126bea84ac92d257a18af4cd939d44b6497a619105dfc1755e67ff5c.jpeg",
"place_id": "1308078187049883430",
"place_id_search": "https://serpapi.com/search.json?device=desktop&engine=google_local&gl=us&google_domain=google.com&hl=en&ludocid=1308078187049883430&q=Coffee",
"gps_coordinates": {
"latitude": 39.958496,
"longitude": -75.19319
},
"title": "Madis Coffee Roasters",
"type": "Coffee shop",
"address": "3527 Lancaster Ave"
},
When you review your Google Local API results, there will be a field labeled as place_id
, reminder you won't actually use this as a place_id
. Because it comes from Google Local API, it is actually returning the Google CID (customer identifier). In this case the value is 1308078187049883430, take note as we will need this value for the next step.
Step 2: Google Maps API
Reviewing our Google Maps API documentation, the first parameter you may see is the place_id
parameter. Even though in the Google Local API results, the value was labeled as place_id
, we must remember what we are actually receiving from Google Local is actually the Customer CID.
The next parameter you will see is the data_cid
parameter. Within the details you can see the data_cid
parameter is for the Google CID (customer identifier). It also mentions this can be found in the Google Local API, this confirms we are in the right place.
In summary for Google Maps API:
place_id
is the value you will use when coming from the Google Maps API.data_cid
is the customer identifier. In Google Local API that is the value we were provided.
So from our Google Local API we collected the Google CID from the place_id
field in the results. We are going to place that value into our data_cid
parameter in our Google Maps API. Let's take a look using the Google CID from above:
from serpapi import GoogleSearch
import json
params = {
"api_key": YOUR_SECRET_API_KEY,
"engine": "google_maps",
"data_cid": "1308078187049883430"
}
results = GoogleSearch(params).get_dict()
'
As always we have our API key required and in this case the engine
will be "google_maps". The last parameter I have listed is data_cid
, this is where you will put the value we took from our Google Local API from the place_id
field.
Here are the results, I've summarized some of the fields for readability, this is indicated by ".......................".
{
"search_metadata": {
"id": "68bb37a1e6cb30609518ef23",
"status": "Success",
"json_endpoint": "https://serpapi.com/searches/8b921870d5cfaa79/68bb37a1e6cb30609518ef23.json",
"created_at": "2025-09-05 19:18:57 UTC",
"processed_at": "2025-09-05 19:18:57 UTC",
"google_maps_url": "https://www.google.com/maps?cid=1308078187049883430&hl=en",
"raw_html_file": "https://serpapi.com/searches/8b921870d5cfaa79/68bb37a1e6cb30609518ef23.html",
"total_time_taken": 0.44
},
"search_parameters": {
"engine": "google_maps",
"type": "search",
"google_domain": "google.com",
"hl": "en",
"data_cid": "1308078187049883430"
},
"search_information": {
...
},
"place_results": {
"title": "Madis Coffee Roasters",
"place_id": "ChIJIf6Tbe_HxokRJpeLPS46JxI",
"data_id": "0x89c6c7ef6d93fe21:0x12273a2e3d8b9726",
"data_cid": "1308078187049883430",
"reviews_link": "https://serpapi.com/search.json?data_id=0x89c6c7ef6d93fe21%3A0x12273a2e3d8b9726&engine=google_maps_reviews&hl=en",
"photos_link": "https://serpapi.com/search.json?data_id=0x89c6c7ef6d93fe21%3A0x12273a2e3d8b9726&engine=google_maps_photos&hl=en",
"gps_coordinates": {
"latitude": 39.9585283,
"longitude": -75.1931625
},
"place_id_search": "https://serpapi.com/search.json?engine=google_maps&google_domain=google.com&hl=en&place_id=ChIJIf6Tbe_HxokRJpeLPS46JxI",
"provider_id": "/g/11jznxsmfy",
"thumbnail": "https://lh3.googleusercontent.com/p.........",
"serpapi_thumbnail": "https://serpapi.com/images/..........",
"rating_summary": [
{
"stars": 1,
"amount": 13
},
.......................
],
"rating": 4.8,
"reviews": 869,
"price": "$1\u201310",
"price_details": {
"distribution": [
{
"price": "$1\u201310",
"percentage": 56.57894736842105,
"reported_count": 258
},
.......................
],
"total_reported": 456
},
"type": [
"Coffee shop"
],
"type_ids": [
"coffee_shop"
],
"menu": {
"link": "https://madiscoffee.com/philadelphia-university-city-madis-coffee-food-menu",
"source": "madiscoffee.com"
},
"order_online_link": "https://www.google.com/viewer...........",
"extensions": [
{
"service_options": [
"Outdoor seating",
"No-contact delivery",
"Delivery",
"Onsite services",
"Takeout",
"Dine-in"
]
},
{
"highlights": [
"Great coffee",
"Great tea selection",
"Serves local specialty"
]
},
{
"popular_for": [
"Breakfast",
"Lunch",
"Solo dining",
"Good for working on laptop"
]
},
{
"accessibility": [
"Wheelchair accessible entrance",
"Wheelchair accessible restroom",
"Wheelchair accessible seating"
]
},
{
"offerings": [
"Coffee",
"Healthy options",
"Quick bite"
]
},
{
"dining_options": [
"Breakfast",
"Brunch",
"Lunch",
"Dessert",
"Seating"
]
},
{
"amenities": [
"Restroom",
"Wi-Fi"
]
},
{
"atmosphere": [
"Casual",
"Cozy",
"Trendy"
]
},
{
"crowd": [
"College students",
"Groups",
"Tourists"
]
},
{
"payments": [
"Credit cards",
"Debit cards",
"NFC mobile payments"
]
},
{
"children": [
"High chairs"
]
},
{
"parking": [
"Free street parking",
"Paid street parking",
"Usually plenty of parking"
]
},
{
"pets": [
"Dogs allowed outside"
]
}
],
"unsupported_extensions": [
{
"dining_options": [
"Table service"
]
},
{
"planning": [
"Accepts reservations"
]
}
],
"service_options": {
"dine_in": true,
"takeout": true,
"no_contact_delivery": true
},
"address": "3527 Lancaster Ave, Philadelphia, PA 19104",
"website": "http://madiscoffee.com/",
"phone": "(215) 222-1511",
"open_state": "Open \u22c5 Closes 6\u202fPM",
"plus_code": "XR54+CP Philadelphia, Pennsylvania",
"hours": [
{
"friday": "7\u202fAM\u20136\u202fPM"
},
..................
],
"images": [
{
"title": "All",
"thumbnail": "https://lh3.googleusercontent............",
"serpapi_thumbnail": "https://serpapi.com/images/url........."
},
],
"questions_and_answers": [
{
"question": {
"text": "What kind of coffee do they serve?",
"date": "Frequently searched on Google",
"language": "en"
},
"total_answers": 0
}
],
"user_reviews": {
"summary": [
{
"snippet": "\"Highly recommend the iced chai latte and bagel with cream cheese and salmon.\""
},
....................
],
"most_relevant": [
{
"username": "Benjamin Nakamura",
"rating": 5,
"contributor_id": "103884614158072507825",
"description": "My lovely wife Google searched...............,
"link": .......................,
"images": [
{
"thumbnail": .......................
},
.......................
]
},
"people_also_search_for": [
{
"search_term": "People also search for",
"local_results": [
{
"position": 1,
"title": "Arterial Coffee",
"data_id": "0x0:0x956e3574b6e244cc",
"data_cid": "10767602534490195148",
"reviews_link": "https://serpapi.com/search.json?data_id=0x0%3A0x956e3574b6e244cc&engine=google_maps_reviews&hl=en",
"photos_link": "https://serpapi.com/search.json?data_id=0x0%3A0x956e3574b6e244cc&engine=google_maps_photos&hl=en",
"gps_coordinates": {
"latitude": 39.9631809,
"longitude": -75.18756119999999
},
"place_id_search": "https://serpapi.com/search.json?data=%214m5%213m4%211s0x0%3A0x956e3574b6e244cc%218m2%213d39.9631809%214d-75.18756119999999&data_cid=1308078187049883430&engine=google_maps&google_domain=google.com&hl=en&type=place",
"rating": 4.8,
"reviews": 220,
"thumbnail": "https://lh3.googleusercontent.com/p/AF1QipO3taSNFjgg9HaFVTIqSZLZPjoQaUvNEqkY0s6E=w156-h156-n-k-no",
"type": [
"Coffee shop"
]
},
.......................
],
"popular_times": {
"graph_results": {
"sunday": [
{
"time": "6\u202fAM",
"busyness_score": 0
},
.......................
]
},
"live_hash": {
"info": "A little busy",
"time_spent": "People typically spend up to 1.5 hours here"
}
},
"web_results_link": .......................,
"serpapi_web_results_link": .......................
}
}
For more information on Google Maps Place Results API:
You can see the results are quite extensive and include everything you would be able to find on the place details on Google Maps. This will also give you all the information you require to then use Google Maps Reviews API, Google Maps Photos API, etc.
For information on scraping Google Maps reviews see this blog post:
Google Maps API to Google Local API
Step 1: Google Maps API
First we will want to make our query to Google Maps API to find the location(s) we are looking for. In this example we'll continue with searching for "Coffee".
Here is the implementation in Python:
from serpapi import GoogleSearch
import json
params = {
"api_key": YOUR_SECRET_API_KEY,
"engine": "google_maps",
"q": "Coffee"
}
results = GoogleSearch(params).get_dict()
You can see the engine
is set for google_local
, I've included "Coffee" as my query and as always include your API key.
Here is partial of the first result from the local_results
field:
"local_results": [
{
"position": 1,
"title": "Deb B's Family Espresso",
"place_id": "ChIJJTjFYCIBXYcRm4rUHnhGrs8",
"data_id": "0x875d012260c53825:0xcfae46781ed48a9b",
"data_cid": "14964976093526002331",
"reviews_link": "https://serpapi.com/search.json?data_id=0x875d012260c53825%3A0xcfae46781ed48a9b&engine=google_maps_reviews&hl=en",
"photos_link": "https://serpapi.com/search.json?data_id=0x875d012260c53825%3A0xcfae46781ed48a9b&engine=google_maps_photos&hl=en",
"gps_coordinates": {
"latitude": 41.7915905,
"longitude": -107.2158848
When you review your Google Maps API output, there will be a place_id
as well as a data_cid
listed. We of course already know place_id
is used for Google Maps API. In this case we want to continue in Google Local API so we are going to use the data_cid
.
Step 2: Google Local API
When you migrate into the Google Local API you will see there is a ludocid
parameter. Within the documentation it lets us know the ID to use for the ludocid
parameter can be found in the Google Maps API in the data_cid
field.
So from our Google Maps API results we collected the data_cid
. Moving into our Google Local API we are going to use that value and plug it into our ludocid
parameter. Here we are using the data_cid
from the example above:
from serpapi import GoogleSearch
import json
params = {
"api_key": "YOUR_SECRET_API_KEY",
"engine": "google_local",
"q": "Coffee",
"ludocid": "16877396319438804318"
}
results = GoogleSearch(params).get_dict()
You'll notice when using the Google Local API the q
parameter is still required.
Here are the results, I've summarized some of the fields for readability, this is indicated by ".......................".
{
"search_metadata": {
"id": "68c46c3210b5cf0246472b00",
"status": "Success",
"json_endpoint": "https://serpapi.com/searches/5c9e5167fa125065/68c46c3210b5cf0246472b00.json",
"created_at": "2025-09-12 18:53:38 UTC",
"processed_at": "2025-09-12 18:53:38 UTC",
"google_local_url": "https://www.google.com/search?q=coffee&hl=en&gl=us&ludocid=16877396319438804318&tbm=lcl",
"raw_html_file": "https://serpapi.com/searches/5c9e5167fa125065/68c46c3210b5cf0246472b00.html",
"total_time_taken": 0.77
},
"search_parameters": {
"engine": "google_local",
"q": "coffee",
"google_domain": "google.com",
"hl": "en",
"gl": "us",
"ludocid": "16877396319438804318",
"device": "desktop"
},
"local_results": [
{
"position": 1,
"rating": 4.5,
"reviews": 3400,
"reviews_original": "(3.4K)",
"price": "$10\u201320",
"lsig": "AB86z5Wb-onBnnvLSp17d08eKQdM",
"links": {
"website": "https://www.bygracestreet.com/",
"directions": "https://www.google.com/maps/dir//Grace+Street+Coffee+%26+Desserts,+17+W+32nd+St+14th+Floor,+New+York,+NY+10001/data=!4m6!4m5!1m1!4e2!1m2!1m1!1s0x89c259a8e1682bf5:0xea388e8841a2955e?sa=X&ved=2ahUKEwjZwYfg8tOPAxWkxskDHYBJH7MQ48ADegQIAhAA&hl=en&gl=us"
},
"place_id": "16877396319438804318",
"place_id_search": "https://serpapi.com/search.json?device=desktop&engine=google_local&gl=us&google_domain=google.com&hl=en&ludocid=16877396319438804318&q=coffee",
"gps_coordinates": {
"latitude": 40.74772,
"longitude": -73.98653
},
"title": "Grace Street Coffee & Desserts",
"type": "Dessert restaurant",
"address": "17 W 32nd St 14th Floor",
"phone": "(917) 540-2776",
"hours": "Open \u22c5 Closes 12 AM"
}
],
"pagination": {
.......................
},
"serpapi_pagination": {
}
}
You can see the results are quite a bit shorter than the Google Maps Places API results. This is because Google Local doesn't open the full page preview like Google Maps does. If you are requiring the full details for the location, whether coming from the Google Maps API or the Google Local API, I would recommend searching with the Google Maps Place Results API for full business / location information.
Conclusion
Google Maps API and Google Local API are both great options for searching for businesses and locations. Within these 2 APIs the IDs used are:
- Google Maps API:
place_id
ordata_cid
- Google Local API:
data_cid
(ludocid
) only
When crossing between the platforms it's important to understand what IDs are being provided and what IDs the APIs take as an input parameter.
When going from Google Local API to Google Maps API, you are able to pull detailed location information of a specific place. This will also provide you the information you need for other Google APIs such as Google Maps Reviews API, Google Maps Photos API and other useful location APIs.
When going from Google Maps API to Google Local API, you will get a similar preview to what you would see in the list of results without all of the expanded information.
How, when, and why you choose to use the APIs or combine them, is entirely up to you. Just know that they are fully compatible and can work together if used properly.
Want more insight or ideas into Google Maps or Google Local?
Review these resources:
- How AI Can Predict the Success of Your Business Using Data from Google Maps
- How To Make a Travel Guide Using SERP data and Python
- Gauge Business Popularities using Google Maps
- Web Scraping Google Maps Photos with Nodejs
- I wish Google worked this way
- Google Maps Phone Number Extractor Tool
Resources in other programming languages:
- Web Scraping Google Maps Place with Nodejs
- Scraping all business listings for an area in Google Maps using Node.js