Scraping Google Maps Details
There are two main ways to scrape details from the Google Maps API: Search Results and Place Details.
We typically start by performing a search request for a specific type of business or point of interest and location, as described in our Google Maps Deep Crawl Tutorial. This will help us build a list of business from Google Maps that match our query, with their basic information that may be enough for our needs.
However, you may need to collect additional data about businesses than what is returned from the search results, such as website & phone number. To get the full details back, you’ll need to individually call the details endpoint (linked above) for every single Place ID from our search results and collect that additional data back.
Below is a summary showing the different fields that each of the two endpoints return, so you can see what you gain when making the details request:
Search Results | Place Details | |
---|---|---|
Business Status | ✅ | ✅ |
Formatted Address | ✅ | ✅ |
Latitude & Longitude | ✅ | ✅ |
Name | ✅ | ✅ |
Price Level | ✅ | ✅ |
Average Rating | ✅ | ✅ |
Number of Ratings | ✅ | ✅ |
Types | ✅ | ✅ |
Address Components | ❌ | ✅ |
Phone Number | ❌ | ✅ |
Opening Hours | ❌ | ✅ |
Recent Reviews | ❌ | ✅ |
Google Maps URL | ❌ | ✅ |
Timezone Offset | ❌ | ✅ |
Official Website | ❌ | ✅ |
Extra Data
We’ll quickly summarize the additional data that the details endpoint returns, using the sample data from the Official Google Maps Place Details Endpoint.
Address Components
Provided as address_components
in the response, this splits up the business address into individual components, which may be useful for analyzing bulk attributes, e.g. zip codes.
{"address_components":
[
{ "long_name": "48", "short_name": "48", "types": ["street_number"] },
{
"long_name": "Pirrama Road",
"short_name": "Pirrama Rd",
"types": ["route"],
},
{
"long_name": "Pyrmont",
"short_name": "Pyrmont",
"types": ["locality", "political"],
},
{
"long_name": "City of Sydney",
"short_name": "City of Sydney",
"types": ["administrative_area_level_2", "political"],
},
{
"long_name": "New South Wales",
"short_name": "NSW",
"types": ["administrative_area_level_1", "political"],
},
{
"long_name": "Australia",
"short_name": "AU",
"types": ["country", "political"],
},
{
"long_name": "2009",
"short_name": "2009",
"types": ["postal_code"],
},
]
}
Phone Number
Sent back as international_phone_number
as a string, e.g. +61 2 9374 4000
Opening Hours
Returned as structured data or as a list of human readable times.
{"opening_hours":
{
"open_now": false,
"periods":
[
{
"close": { "day": 1, "time": "1700" },
"open": { "day": 1, "time": "0900" },
},
...
],
"weekday_text":
[
"Monday: 9:00 AM – 5:00 PM",
"Tuesday: 9:00 AM – 5:00 PM",
"Wednesday: 9:00 AM – 5:00 PM",
"Thursday: 9:00 AM – 5:00 PM",
"Friday: 9:00 AM – 5:00 PM",
"Saturday: Closed",
"Sunday: Closed",
],
}
}
Recent Reviews
Up to 5 recent reviews of the business. This list is not a complete list and the Google Maps API does not have a way to return the full list of reviews. For this, you can check out SerpAPI Google Maps Reviews Scraping, which will get the full list of reviews.
{"reviews":
[
{
"author_name": "Luke Archibald",
"author_url": "https://www.google.com/maps/contrib/113389359827989670652/reviews",
"language": "en",
"profile_photo_url": "https://lh3.googleusercontent.com/a-/AOh14GhGGmTmvtD34HiRgwHdXVJUTzVbxpsk5_JnNKM5MA=s128-c0x00000000-cc-rp-mo",
"rating": 1,
"relative_time_description": "a week ago",
"text": "Called regarding paid advertising google pages to the top of its site of a scam furniture website misleading and taking peoples money without ever sending a product - explained the situation, explained I'd spoken to an ombudsman regarding it. Listed ticket numbers etc.\n\nThey left the advertisement running.",
"time": 1652286798,
},
...
]
}
Google Maps URL
Returned in the url
field, this provides a handy link to view the place on Google Maps. E.g. https://maps.google.com/?cid=10281119596374313554
Timezone Offset
Returned under utc_offset
, this is the number of minutes offset from UTC time of the location. This can be helpful if you need to know the timezone of a business.
Official Website
Sent back as the website
field, this is the official website of the business. This can be useful to use with the Hunter Email Search Workflow, where you can provide a list of websites and get back the email addresses.
Using the Place Details Endpoint
For every Google Maps Place you want to get the details for, you’ll need to look for the place_id
field and then make an API request to the following endpoint, substituting $PLACE_ID
with the individual place ID and $API_KEY
with your Google Maps API Key:
curl 'https://maps.googleapis.com/maps/api/place/details/json?placeid=$PLACE_ID&key=$API_KEY'
And you’ll get back the JSON response object described above, returning the additional fields we summarized.
No-Code Place Details Scraping
If you scroll up on this webpage, you’ll find a prompt where you can enter a Place ID, e.g. ChIJ7wzsxeFSwokRhvLXxTe087M
and our service will automatically query Google Maps on your behalf and return the data in a more usable format, allowing you to download the data as CSV files. For example, you may find it helpful to consume the address_components
in the following format instead of the raw JSON listed above:
Scraping a List of Place IDs
What’s more useful though, is if you want to scrape the details for a list of Place IDs. Instead of creating your own software to process the list of Place IDs one-by-one, you can simply use our Multiple Place ID Lookup Workflow and enter a list of Place IDs (one per line), and our service will look up the details and return everything together as a single CSV file for easier use.