Google Maps
Search Google Maps and retrieve structured place records in JSON format, optionally with reviews. To look up one place you already know, see Place Details and Reviews.
Endpoint
GET /v1/maps/search/{query}
Description
The Google Maps endpoint returns structured place records for a location or category search: name, address, coordinates, rating, categories, phone, timezone, and opening hours.
This endpoint carries its search text differently from the rest of the API. Elsewhere the text is the q parameter (/v1/search/?q=coffee+shops&num=100). Here it is the path segment itself, URL-encoded, while num, hl, and gl stay ordinary query parameters:
https://api.serply.io/v1/maps/search/coffee%20shops%20in%20Chicago%2C%20IL?num=20&hl=en&gl=us
A leading q= inside the path segment is accepted but not required. Anything after an & inside the path segment is ignored, so refinements must go after the ? to take effect.
Responses are cached for 10 minutes. A cached response does not consume prepaid credits.
Authentication
All requests require authentication using the X-Api-Key header. See the Authentication guide for more details.
Path Parameters
query (required)
Type: string
The place or category to search for, URL-encoded.
Examples:
coffee%20shops%20in%20Chicago%2C%20ILdentists%20near%20Austin%20TX
Query Parameters
num (optional)
Type: integer
How many places to return. Defaults to 20. Accepts 1 to 200. Google often returns fewer places than requested.
hl (optional)
Type: string
Interface language code. Defaults to en.
gl (optional)
Type: string
Two-letter country code. Defaults to us.
reviews (optional)
Type: integer
Attach reviews to the first reviews places in the result. Defaults to 0 (no reviews). Accepts 0 to 5. Each of those places gets a reviews array with up to 5 of its reviews, the ones Google shows first. The Place Details and Reviews section describes the review fields.
Every place with reviews costs one extra lookup on our side, so reviews=5 adds about half a second. If one lookup fails, that place gets "reviews": null and the rest of the response is unaffected.
Request Headers
X-Proxy-Location and X-User-Agent are not supported on this endpoint. It reads Google's non-JavaScript Maps transport directly rather than going through a proxy, so there is no proxy region or device to select. Use gl and hl to control locale instead.
Request Example
Using cURL
curl --request GET \
--url 'https://api.serply.io/v1/maps/search/coffee%20shops%20in%20Chicago%2C%20IL?num=20&hl=en&gl=us' \
--header 'X-Api-Key: YOUR_API_KEY'
Using JavaScript/Node.js
const query = encodeURIComponent('coffee shops in Chicago, IL');
const params = new URLSearchParams({ num: '20', hl: 'en', gl: 'us' });
const response = await fetch(
`https://api.serply.io/v1/maps/search/${query}?${params}`,
{
headers: {
'X-Api-Key': 'YOUR_API_KEY'
}
}
);
const data = await response.json();
console.log(data);
Using Python
import requests
from urllib.parse import quote
query = quote('coffee shops in Chicago, IL')
response = requests.get(
f'https://api.serply.io/v1/maps/search/{query}',
params={'num': 20, 'hl': 'en', 'gl': 'us'},
headers={'X-Api-Key': 'YOUR_API_KEY'}
)
data = response.json()
print(data)
Response
The API returns a JSON object containing an array of place records.
Response Structure
{
"search_engine": "google_maps",
"query": "coffee shops in Chicago, IL",
"places": [
{
"position": 1,
"name": "Place Name",
"data_id": "0x880e2cb109470fb1:0x1bfa35f0425ae540",
"place_id": "ChIJsQ9HCbEsDogRQOVaQvA1-hs",
"google_maps_url": "https://www.google.com/maps/search/?api=1&query=...",
"website": "https://example.com/",
"domain": "example.com",
"address": "346 N Clark St Unit 4709, Chicago, IL 60654",
"address_lines": ["346 N Clark St Unit 4709", "Chicago, IL 60654"],
"district": "Near North Side",
"latitude": 41.8887579,
"longitude": -87.6312297,
"rating": 4.6,
"review_count": null,
"review_url": null,
"categories": ["Coffee shop", "Espresso bar"],
"category_ids": [],
"phone": null,
"phone_e164": null,
"timezone": "America/Chicago",
"thumbnail": "https://lh3.googleusercontent.com/...",
"opening_hours": { "Friday": "7 AM-5 PM" },
"reviews": [
{
"review_id": "Ci9DQUlRQUNvZENodHljRjlvT21wTUxXWTJVRlJmUzFkVExWQkRNbk10V1ZOTU1YYxAB",
"rating": 5,
"text": "Great espresso and friendly staff.",
"relative_date": "a month ago",
"published_at": "2026-10-01T14:19:07.914446+00:00",
"author": { "name": "Jane Doe", "summary": "Local Guide · 51 reviews" }
}
]
}
],
"result_count": 20,
"parsed_at": "2026-08-14T20:32:17.293873Z",
"metadata": {
"schema": "tbm-map-positional-v1",
"transport": "direct",
"requested_count": 20,
"language": "en",
"country": "us",
"reviews_requested": 1,
"reviews_failed": 0
}
}
The reviews entries above are shortened; see Review Fields for every field.
Response Fields
search_engine(string): Alwaysgoogle_mapsquery(string): The decoded search textplaces(array): An array of place objectsposition(number): Rank within the result set, starting at 1name(string): The name of the placedata_id(string): Google's internal identifier for the placeplace_id(string): The Places API identifier, when availablegoogle_maps_url(string): A link to the place on Google Mapswebsite(string | null): The place's own websitedomain(string | null): The bare hostname ofwebsiteaddress(string | null): The full formatted addressaddress_lines(array[string]): The address split into display linesdistrict(string | null): Neighborhood or district namelatitude(number): Latitude in decimal degreeslongitude(number): Longitude in decimal degreesrating(number | null): Average star rating out of 5review_count(number | null): Number of reviewsreview_url(string | null): A link to the reviews listingcategories(array[string]): Human-readable category labelscategory_ids(array[string]): Google category identifiers, usually emptyphone(string | null): Phone number as displayedphone_e164(string | null): The same number in E.164 formattimezone(string | null): IANA timezone namethumbnail(string | null): A photo URLopening_hours(object | null): Day name to hours stringreviews(array | null): Only on the firstreviewsplaces whenreviewsis set. Up to 5 reviews, ornullif that place's lookup failed. See Review Fields
result_count(number): The number of places returnedparsed_at(string): ISO 8601 timestamp of when the response was parsedmetadata(object): Details about how the result was produced. Withreviewsset it also hasreviews_requested(places looked up) andreviews_failed(lookups that failed)
Treat every place field except position, name, data_id, latitude, and longitude as optional. review_count and review_url in particular are frequently null on broad category searches and populated on narrow ones.
Values in opening_hours come verbatim from Google and can contain non-ASCII characters such as narrow no-break spaces and en dashes. Normalize them before display.
Status Codes
- 200 OK - Successful response
- 400 Bad Request - Empty query,
numoutside 1-200,reviewsoutside 0-5, or a malformedhlorgl - 429 Too Many Requests - Rate limit exceeded
- 502 Bad Gateway - Google Maps structured search is temporarily unavailable
A 502 means the upstream fetch or the response parse failed. The underlying format is positional and undocumented, so a Google-side layout change surfaces as a 502 rather than as a partial result.
Place Details and Reviews
GET /v1/maps/place/{data_id}
Returns one place's details and up to 5 of its reviews. data_id is the data_id value of a place from /v1/maps/search (for example 0x89c259ab3c1ef289:0x3b67a41175949f55). The place object has the same fields as a search result, without position.
Up to 5 reviews are returned: the ones Google shows first ("most relevant"). Pagination and other sort orders are not available. Responses are cached for 30 minutes.
Path Parameters
data_id (required)
Type: string
The place's data_id: two hexadecimal numbers separated by a colon, each starting with 0x. The colon may be sent as-is or URL-encoded as %3A.
Query Parameters
hl (optional)
Type: string
Language for review dates and translations. Defaults to en. With hl=de, relative_date reads vor 3 Wochen.
gl (optional)
Type: string
Two-letter country code. Defaults to us.
Request Example
curl --request GET \
--url 'https://api.serply.io/v1/maps/place/0x89c259ab3c1ef289:0x3b67a41175949f55?hl=en' \
--header 'X-Api-Key: YOUR_API_KEY'
import requests
data_id = '0x89c259ab3c1ef289:0x3b67a41175949f55' # from /v1/maps/search
response = requests.get(
f'https://api.serply.io/v1/maps/place/{data_id}',
params={'hl': 'en'},
headers={'X-Api-Key': 'YOUR_API_KEY'}
)
for review in response.json()['reviews']:
print(review['rating'], review['relative_date'], review['text'])
Response Structure
{
"place": {
"name": "Joe's Pizza Broadway",
"data_id": "0x89c259ab3c1ef289:0x3b67a41175949f55",
"place_id": "ChIJifIePKtZwokRVZ-UdRGkZzs",
"address": "Joe's Pizza Broadway, 1435 Broadway, New York, NY 10018",
"latitude": 40.7546795,
"longitude": -73.9870291,
"rating": 4.4,
"review_count": 27582,
"categories": ["Pizza restaurant"]
},
"reviews": [
{
"review_id": "Ci9DQUlRQUNvZENodHljRjlvT21wTUxXWTJVRlJmUzFkVExWQkRNbk10V1ZOTU1YYxAB",
"rating": 5,
"text": "Great experience, we came back twice!",
"text_translated": null,
"language": "en",
"relative_date": "a month ago",
"published_at": "2026-10-01T14:19:07.914446+00:00",
"updated_at": "2026-10-01T14:19:07.914446+00:00",
"author": {
"name": "Jane Doe",
"id": "117764912388138697775",
"profile_url": "https://www.google.com/maps/contrib/117764912388138697775",
"photo": "https://lh3.googleusercontent.com/...",
"summary": "Local Guide · 51 reviews"
},
"images": ["https://lh3.googleusercontent.com/..."],
"owner_response": {
"text": "Thanks for visiting!",
"relative_date": "3 weeks ago",
"published_at": "2026-10-10T09:00:00+00:00",
"language": "en"
}
}
],
"metadata": {
"reviews_returned": 1,
"schema": "maps-preview-place-v1",
"transport": "direct",
"language": "en",
"country": "us"
}
}
The place object above is shortened; it carries every place field listed under Response Fields.
Review Fields
review_id(string): Google's identifier for the reviewrating(number | null): Stars, 1 to 5text(string | null): The review text in its original language.nullfor a rating without texttext_translated(string | null): Google's translation intohl, when the original is in another languagelanguage(string | null): Language code of the original textrelative_date(string | null): When it was posted, as Google displays it (a month ago), in thehllanguagepublished_at(string | null): ISO 8601 UTC timestamp of when the review was postedupdated_at(string | null): ISO 8601 UTC timestamp of the last editauthor(object):name,id,profile_url,photo, andsummary(such asLocal Guide · 51 reviews); any of them can benullimages(array[string]): Photo URLs attached to the reviewowner_response(object | null): The business's reply, withtext,relative_date,published_at, andlanguage
Status Codes
- 200 OK - Successful response.
reviewscan be empty: some places (landmarks, neighborhoods) have none - 400 Bad Request -
data_idis not in the0x...:0x...form, orhlorglis malformed - 404 Not Found - Google has no place with this
data_id. Do not retry - 429 Too Many Requests - Rate limit exceeded
- 502 Bad Gateway - Google Maps place lookup is temporarily unavailable; retry once
Error Responses
See the Errors guide for information on error response formats.