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%20IL
  • dentists%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): Always google_maps
  • query (string): The decoded search text
  • places (array): An array of place objects
    • position (number): Rank within the result set, starting at 1
    • name (string): The name of the place
    • data_id (string): Google's internal identifier for the place
    • place_id (string): The Places API identifier, when available
    • google_maps_url (string): A link to the place on Google Maps
    • website (string | null): The place's own website
    • domain (string | null): The bare hostname of website
    • address (string | null): The full formatted address
    • address_lines (array[string]): The address split into display lines
    • district (string | null): Neighborhood or district name
    • latitude (number): Latitude in decimal degrees
    • longitude (number): Longitude in decimal degrees
    • rating (number | null): Average star rating out of 5
    • review_count (number | null): Number of reviews
    • review_url (string | null): A link to the reviews listing
    • categories (array[string]): Human-readable category labels
    • category_ids (array[string]): Google category identifiers, usually empty
    • phone (string | null): Phone number as displayed
    • phone_e164 (string | null): The same number in E.164 format
    • timezone (string | null): IANA timezone name
    • thumbnail (string | null): A photo URL
    • opening_hours (object | null): Day name to hours string
    • reviews (array | null): Only on the first reviews places when reviews is set. Up to 5 reviews, or null if that place's lookup failed. See Review Fields
  • result_count (number): The number of places returned
  • parsed_at (string): ISO 8601 timestamp of when the response was parsed
  • metadata (object): Details about how the result was produced. With reviews set it also has reviews_requested (places looked up) and reviews_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, num outside 1-200, reviews outside 0-5, or a malformed hl or gl
  • 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 review
  • rating (number | null): Stars, 1 to 5
  • text (string | null): The review text in its original language. null for a rating without text
  • text_translated (string | null): Google's translation into hl, when the original is in another language
  • language (string | null): Language code of the original text
  • relative_date (string | null): When it was posted, as Google displays it (a month ago), in the hl language
  • published_at (string | null): ISO 8601 UTC timestamp of when the review was posted
  • updated_at (string | null): ISO 8601 UTC timestamp of the last edit
  • author (object): name, id, profile_url, photo, and summary (such as Local Guide · 51 reviews); any of them can be null
  • images (array[string]): Photo URLs attached to the review
  • owner_response (object | null): The business's reply, with text, relative_date, published_at, and language

Status Codes

  • 200 OK - Successful response. reviews can be empty: some places (landmarks, neighborhoods) have none
  • 400 Bad Request - data_id is not in the 0x...:0x... form, or hl or gl is 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.