Skip to documentation
ScraperData

SERP API

Google Maps

The same /v1/search endpoint with engine=google_maps returns Google Maps places as JSON: discover businesses near a point, or collect one place from its Google Maps URL.

Send the API key in the X-API-Key header, or as the api_key query parameter (Authentication). Google Maps searches can also run as async tasks with pingback_url.

Parameters

FieldTypeDescription
enginestringrequired Set it to google_maps.Values:google_maps
typestringoptional discover: businesses near a point. collect: one place from its Google Maps URL. Any other value answers 400 invalid_type.Values:discovercollectDefault: discover
qstringoptional type=discover: what to look for, like restaurants, dentist or hotels. Required for discover.Example: pizza
latnumberoptional type=discover: latitude of the centre of the search, from -90 to 90. Required for discover.Example: 40.7128
lonnumberoptional type=discover: longitude of the centre of the search, from -180 to 180. Required for discover.Example: -74.006
zoomintegeroptional type=discover: how wide to search, like the Google Maps zoom: 10 is about 150 km, 12 about 40 km, 14 about 10 km, 16 about 2.5 km, 18 about 0.6 km. Google may widen a search that finds too few places.Default: 14
distance_maxnumberoptional type=discover: the search radius in km (above 0, up to 200), instead of zoom. When both are sent, zoom wins.Example: 5
numintegeroptional type=discover: the most places to return, from 1 to 200.Default: 200
urlstringoptional type=collect: a Google Maps place URL: a place link (with @lat,lon), ?cid=, place_id:, maps.app.goo.gl or goo.gl/maps. Required for collect.Example: https://www.google.com/maps/place/Taj+Mahal/@27.1751448,78.0421422,17z
hlstringoptional Language of names, categories, addresses and opening hours, as a code (en, hi, ja, de, fr, ko, pt, es, ar, zh...).Default: en
glstringoptional Country, as a two-letter code. It changes how Google ranks the places.Default: us
response_typestringoptional json: the places. html: Google's raw answer as text in html, without places. both: the places and html.Values:jsonhtmlbothDefault: json
pingback_urlstringoptional Queue the search and get the answer later; see Async tasks.

One call

page and num_pages are not used: one call returns up to 200 places, or one place by URL.

What comes back

FieldTypeDescription
search_metadataobjectAbout this request.
idstringA unique id for the search.
statusstringSuccess when Google Maps answered.
created_atstringWhen the search ran, in ISO 8601 (UTC).
pagesintegerAlways 1.
credits_chargedintegerCredits this request cost: 1.
task_idstringOnly for async tasks: the task the result belongs to.
search_parametersobjectWhat the search used: engine, type, q, lat, lon, zoom or distance_max, num (discover) or url (collect), hl, gl and response_type.
search_informationobjecttype=discover: query_displayed and total_results (how many places came back).
local_resultsarraytype=discover: the places, each with position (1, 2, 3...) and the fields below.
name, category, all_categoriesstring / arrayThe business name, its main category and every category Google gives it.
address, location_infostringThe full address, and extra place text when Google shows it (like "Agra, Uttar Pradesh, India").
phone_number, open_websitestringThe phone number and the website, when the business lists them (empty otherwise).
lat, lonnumberWhere the place is.
rating, reviews_countnumber / integerThe average star rating (0.0 means no ratings yet) and the number of Google reviews.
review_distributionobject / nullReviews by stars: 1_star_reviews to 5_star_reviews. They add up to reviews_count.
open_hoursobject / nullOpening hours by day, Monday to Sunday ("10:00 AM - 2:00 AM" or "Closed"); null when Google shows none.
place_id, cid, fid_locationstringGoogle's ids for the place: place_id for other Google APIs, cid for https://maps.google.com/?cid=<cid>.
urlstringThe place on Google Maps.
country_code, countrystringThe two-letter country code and the country's name.
description, thumbnailstringGoogle's short description and a photo of the place, when there are some (empty otherwise).
is_claimed, permanently_closed, temporarily_closedbooleanWhether the owner manages the listing, and whether the place is closed.
place_resultsobjecttype=collect: the one place, with the same fields.
htmlstringresponse_type html or both: Google's raw answer, as text.

Collect one place from its URL

Request
curl -G "https://api.scraperdata.com/v1/search" \
  -H "X-API-Key: YOUR_API_KEY" \
  --data-urlencode "engine=google_maps" \
  --data-urlencode "type=collect" \
  --data-urlencode "url=https://www.google.com/maps/place/Taj+Mahal/@27.1751448,78.0421422,17z"
200 OK
{
  "search_parameters": {
    "engine": "google_maps",
    "type": "collect",
    "url": "https://www.google.com/maps/place/Taj+Mahal/@27.1751448,78.0421422,17z",
    "hl": "en",
    "gl": "us",
    "response_type": "json"
  },
  "place_results": {
    "name": "Taj Mahal",
    "category": "Monument",
    "all_categories": ["Monument", "Historical place", "Tourist attraction"],
    "address": "Taj Mahal, Dharmapuri, Forest Colony, Tajganj, Agra, Uttar Pradesh 282001, India",
    "phone_number": "+91 562 222 6431",
    "rating": 4.6,
    "reviews_count": 253756,
    "place_id": "ChIJbf8C1yFxdDkR3n12P4DkKt0",
    "country_code": "IN",
    "country": "India",
    "open_hours": null,
    "review_distribution": { "1_star_reviews": 9856, "2_star_reviews": 3771, "3_star_reviews": 9890, "4_star_reviews": 31012, "5_star_reviews": 199227 },
    "location_info": "Agra, Uttar Pradesh, India"
  }
}

Errors

Errors never cost credits. Every error code is on the Errors page; these are the Google Maps ones:

FieldTypeDescription
invalid_type400type is not discover or collect.
missing_query400type=discover without q.
missing_location, invalid_location400type=discover without lat and lon, or with values out of range.
invalid_zoom, invalid_distance, invalid_num400zoom is not 10 to 18, distance_max is not above 0 and up to 200, or num is not 1 to 200.
missing_url, invalid_url400type=collect without url, or a URL that is not a Google Maps place.
invalid_response_type400response_type is not json, html or both.
place_not_found404The URL was read, but Google Maps has no such place (an old or deleted link).
upstream_error, upstream_unavailable, upstream_timeout502 / 503 / 504Google Maps could not be reached in time. Retry in a few seconds.
400 Bad Request
{
  "error": {
    "code": "missing_location",
    "message": "Google Maps discover needs lat and lon: the centre of the search, like lat=40.7128&lon=-74.006."
  },
  "charged": false
}

Credits

Each call costs one credit, discover or collect, whatever the number of places. Failed searches and places that are not found are free.