Short answer: search the business name on POST /google/maps/search and read place_id, data_id, cid and kgmid from the first place. A precise name with an address or a map point usually returns exactly one place, so you get every Google identifier for it in one 2-credit request.
Why you need the IDs
Google uses several identifiers for the same place, and different tools ask for different ones:
| Field | Example | Used for |
|---|---|---|
place_id | ChIJy9ZRwbJqkFQRHJ8-Y18dRGA | Google's Places ID; our place details endpoint takes it as id |
data_id | 0x54906ab2c151d6cb:0x60441d5f633e9f1c | The Maps feature ID; our reviews endpoint takes it |
cid | 6936701621581553436 | The customer ID in maps.google.com/?cid= links |
kgmid | /m/02k953 | The Knowledge Graph entity ID |
Request 1: a landmark with a map point
curl -X POST 'https://api.serpbase.dev/google/maps/search' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR_API_KEY' \
-d '{"q":"Pike Place Market","lat":47.6097,"lng":-122.3422,"zoom":15}'
On 30 November 2026 this returned one place:
{
"title": "Pike Place Market",
"address": "Pike Place Market, Seattle, WA",
"latitude": 47.6096659,
"longitude": -122.3421672,
"place_id": "ChIJy9ZRwbJqkFQRHJ8-Y18dRGA",
"data_id": "0x54906ab2c151d6cb:0x60441d5f633e9f1c",
"cid": "6936701621581553436",
"kgmid": "/m/02k953"
}
Request 2: a small business by name and street
curl -X POST 'https://api.serpbase.dev/google/maps/search' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR_API_KEY' \
-d '{"q":"Coffee Astronaut 400 Pine St Seattle"}'
This also returned exactly one place, with rating 4.9, type "Coffee shop" and the same place_id (ChIJ7eXuIgBrkFQRqQhr3Gvl0Lo) and data_id that the same shop had in a plain coffee search around downtown Seattle. The IDs are stable across queries, so you can store them.
A small lookup function
import requests
def find_place_ids(name, lat=None, lng=None):
body = {"q": name}
if lat is not None and lng is not None:
body.update({"lat": lat, "lng": lng, "zoom": 15})
data = requests.post("https://api.serpbase.dev/google/maps/search",
headers={"X-API-Key": "YOUR_API_KEY"},
json=body, timeout=60).json()
if data["status"] != 0 or not data.get("places"):
return None
p = data["places"][0]
return {k: p.get(k) for k in ("title", "place_id", "data_id", "cid", "kgmid")}
print(find_place_ids("Pike Place Market", 47.6097, -122.3422))
When the name is vague (just "Starbucks"), you get a list; compare address_components or the coordinates before you pick one.
Then fetch details or reviews
# details by place_id
curl -X POST 'https://api.serpbase.dev/google/maps/detail' \
-H 'Content-Type: application/json' -H 'X-API-Key: YOUR_API_KEY' \
-d '{"id":"ChIJy9ZRwbJqkFQRHJ8-Y18dRGA"}'
# reviews by data_id
curl -X POST 'https://api.serpbase.dev/google/maps/reviews' \
-H 'Content-Type: application/json' -H 'X-API-Key: YOUR_API_KEY' \
-d '{"data_id":"0x54906b0022eee5ed:0xbad0e56bdc6b08a9"}'
Both ran on the same day: the details call for the market's place_id answered with status 0, and the reviews call for the coffee shop's data_id returned its first five reviews. Each is 2 credits.
Things that trip people up
- Add the street or a map point. A bare chain name matches many branches.
- Not every place has every field. The landmark above had no rating in the search answer; the shop did. Check for missing keys.
latandlnggo together. Sending one of them is refused with status1000and not charged.
Related
Searching an area by coordinates: Google Maps search API. Place details: hours, phone and website as JSON. Reviews: Google Maps reviews API.
Cost
Maps searches are 2 credits. Credits cost $0.25–$0.50 per 1,000 depending on the plan; new accounts get 500 free credits. See pricing.