Google Maps API: how to verify the accuracy of provided results
When you send a request to Google Maps API, it emulates the set location with high accuracy to ensure that you receive the same results that you would receive if you were physically located in the place from your request. To let you verify that the provided results are correct, the API returns a
check_url. With any other API, you could open the
check_url in an incognito window and make sure that we returned an accurate SERP.
However, it will not work in the case of Google Maps API. If you just copy the
check_url and paste it to the browser (whether in an incognito window or not), the location of your device will be taken into account and therefore you will see completely different results.
That’s why in today’s article we would like to show you how to verify the accuracy of Google Maps API responses the right way.
How to verify results provided by Google Maps API
1 Open your browser in an incognito mode and press Ctrl + Shift + J to launch the Console.
2 Click on the three dots icon in the upper right corner, go to More tools and click Sensors.
3 Click on the drop-down menu in the Location section and select Other.
4 Enter the latitude and longitude values from the
check_url into the corresponding fields.
Where the latitude is 40.7127837 and the longitude is -74.0059413.
5 Visit https://www.google.com/maps. Find the Show your location button in the bottom right corner and give Google Maps permission to use your location.
After that, the map should display the location from your API request.
6 Copy the
check_url from the API response, past it into the browser’s address bar, and press Enter. If you sent your request with
"device": "mobile", you should also click Toggle device toolbar in the console.
7 Scroll your mouse up and then down a little until the Search this area button appears. Click on the button.
Note: you may skip this step if you sent your request with
8 Compare the results with the API response.
We hope this information helps.