Here are some tips on troubleshooting common issues.
Why is the accuracy radius very large?
If your Geolocation response shows a very high value in the accuracy field, the service may be geolocating based on the request IP, instead of WiFi points or cell towers. These kinds of responses can happen if the service does not recognize any cell towers or access points.
To confirm that the service could not geolocate your access points, set
considerIp
to false in your request. If the response is a 404, you've
confirmed that your wifiAccessPoints and cellTowers objects could not be geolocated.
How do I troubleshoot a response error?
If your request generates an error, the system returns a standard format error response body and sets the HTTP status code to an error status.
The error response contains an object with a single error object with the following keys:
code
: This is the same as the HTTP status of the response.message
: A short description of the error.errors
: A list of errors that occurred. Each error contains an identifier for the type of error (the reason) and a short description (the message).
For example, sending invalid JSON returns the following error:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "parseError",
"message": "Parse Error",
}
],
"code": 400,
"message": "Parse Error"
}
}
Gather testing information from devices
For additional testing, you can gather information from your device using the following SDKs and APIs:
Android devices: Go to Places SDK for Android, and Android Location APIs.
iOS devices: Go to Places SDK for iOS.
Error descriptions
Here are the possible errors you might encounter with descriptions.
Reason | Domain | HTTP Status Code | Description |
---|---|---|---|
dailyLimitExceeded |
usageLimits |
403 | You have exceeded your daily limit. |
keyInvalid |
usageLimits |
400 | Your API key is not valid for the Geolocation API. Please ensure that you've included the entire key, and that you've either purchased the API or have enabled billing and activated the API to obtain the quota at no charge. |
userRateLimitExceeded |
usageLimits |
403 | You have exceeded the request limit that you configured in the Google Cloud Console. This limit is typically set as requests per day, requests per 100 seconds, and requests per 100 seconds per user. You should configure your limit to prevent a single or small group of users from exhausting your daily quota, while still allowing reasonable access to all users. See Capping API Usage to configure these limits. |
notFound |
geolocation |
404 | The request was valid, but no results were returned. |
parseError |
global |
400 | The request body is not valid JSON. Refer to the Request Body section for details on each field. |