トラブルシューティング
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
一般的な問題のトラブルシューティングのヒントを以下に示します。
精度半径が非常に大きいのはなぜですか?
位置情報応答の精度フィールドに非常に高い値が表示される場合、サービスは Wi-Fi アクセス ポイントや基地局ではなく、リクエスト IP に基づいて位置情報を特定している可能性があります。このようなレスポンスは、サービスが携帯基地局やアクセス ポイントを認識していない場合に発生する可能性があります。
サービスがアクセス ポイントの位置情報を特定できなかったことを確認するには、リクエストで considerIp
を false に設定します。レスポンスが 404 の場合、wifiAccessPoints オブジェクトと cellTowers オブジェクトの位置情報を取得できなかったことが確認できます。
レスポンス エラーのトラブルシューティングを行うにはどうすればよいですか?
リクエストでエラーが発生すると、システムは標準形式のエラー レスポンス本文を返し、HTTP ステータス コードをエラー ステータスに設定します。
エラー レスポンスには、次のキーを持つ単一のエラー オブジェクトを含むオブジェクトが含まれます。
code
: レスポンスの HTTP ステータスと同じです。
message
: エラーの簡単な説明。
errors
: 発生したエラーのリスト。各エラーには、エラーのタイプ(理由)の識別子と簡単な説明(メッセージ)が含まれています。
たとえば、無効な JSON を送信すると、次のエラーが返されます。
{
"error": {
"errors": [
{
"domain": "global",
"reason": "parseError",
"message": "Parse Error",
}
],
"code": 400,
"message": "Parse Error"
}
}
追加のテストを行う場合は、次の SDK と API を使用してデバイスから情報を収集できます。
エラーの説明
発生する可能性のあるエラーとその説明は次のとおりです。
理由 |
ドメイン |
HTTP ステータス コード |
説明 |
dailyLimitExceeded |
usageLimits |
403 |
1 日の上限を超えています。 |
keyInvalid |
usageLimits |
400 |
API キーが Geolocation API で有効ではありません。キー全体を含めるようにしてください。また、API を購入するか、課金を有効にして API を有効にすることで、割り当てを無料で取得していることを確認してください。 |
userRateLimitExceeded |
usageLimits |
403 |
Google Cloud コンソールで構成したリクエストの上限を超えています。通常、この上限は、1 日あたりのリクエスト数、100 秒あたりのリクエスト数、ユーザーごとの 100 秒あたりのリクエスト数として設定されます。制限を構成して、1 人または少数のユーザーが 1 日の割り当てを使い果たすのを防ぎながら、すべてのユーザーが妥当なアクセスをできるようにする必要があります。これらの上限を構成するには、API 使用量の上限設定をご覧ください。 |
notFound |
geolocation |
404 |
リクエストは有効ですが、結果が返されませんでした。 |
parseError |
global |
400 |
リクエスト本文が有効な JSON ではありません。各フィールドの詳細については、リクエスト本文セクションをご覧ください。 |
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-31 UTC。
[null,null,["最終更新日 2025-08-31 UTC。"],[[["\u003cp\u003eThe Geolocation API uses IP addresses, WiFi points, and cell towers to determine location, with large accuracy radius often indicating IP-based geolocation.\u003c/p\u003e\n"],["\u003cp\u003eTroubleshooting involves examining the error response, which includes an error code, message, and a list of errors with reasons and descriptions.\u003c/p\u003e\n"],["\u003cp\u003eYou can gather additional testing information from devices using the Android Location APIs, Places SDK for Android and iOS.\u003c/p\u003e\n"],["\u003cp\u003ePossible errors include exceeding daily or user request limits, using an invalid API key, and requests returning no results despite being valid.\u003c/p\u003e\n"]]],["If a large accuracy radius is shown, the service may be using the request IP instead of cell towers or WiFi. Test by setting `considerIp` to false; a 404 response confirms no access points were found. Error responses include a `code` (HTTP status), `message`, and an `errors` list with `reason` and `message`. Common errors include `dailyLimitExceeded` (403), `keyInvalid` (400), `userRateLimitExceeded` (403), `notFound` (404), and `parseError` (400) due to invalid JSON.\n"],null,["# Troubleshoot\n\nHere are some tips on troubleshooting common issues.\n\nWhy is the accuracy radius very large?\n--------------------------------------\n\nIf your Geolocation response shows a very high value in the accuracy field, the\nservice may be geolocating based on the request IP, instead of WiFi points or\ncell towers. These kinds of responses can happen if the service does not\nrecognize any cell towers or access points.\n\nTo confirm that the service could not geolocate your access points, set\n`considerIp` to false in your request. If the response is a 404, you've\nconfirmed that your wifiAccessPoints and cellTowers objects could not be geolocated.\n\nHow do I troubleshoot a response error?\n---------------------------------------\n\nIf your request generates an error, the system returns a standard format error\nresponse body and sets the HTTP status code to an error status.\n\nThe error response contains an object with a single error object with the\nfollowing keys:\n\n- `code`: This is the same as the HTTP status of the response.\n- `message`: A short description of the error.\n- `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).\n\nFor example, sending invalid JSON returns the following error: \n\n {\n \"error\": {\n \"errors\": [\n {\n \"domain\": \"global\",\n \"reason\": \"parseError\",\n \"message\": \"Parse Error\",\n }\n ],\n \"code\": 400,\n \"message\": \"Parse Error\"\n }\n }\n\nGather testing information from devices\n---------------------------------------\n\nFor additional testing, you can gather information from your device using the\nfollowing SDKs and APIs:\n\n- **Android devices** : Go to [Places SDK for Android](/maps/documentation/places/android-sdk/current-place), and [Android\n Location APIs](https://developer.android.com/training/location/index.html).\n\n- **iOS devices** : Go to [Places SDK for iOS](/maps/documentation/places/ios-sdk/current-place).\n\nError descriptions\n------------------\n\nHere are the possible errors you might encounter with descriptions.\n\n| Reason | Domain | HTTP Status Code | Description |\n|-------------------------|---------------|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `dailyLimitExceeded` | `usageLimits` | 403 | You have exceeded your [daily limit](/maps/documentation/geolocation/usage-and-billing#other-usage-limits). |\n| `keyInvalid` | `usageLimits` | 400 | Your API key is not valid for the Geolocation API. Be sure to include the entire key, and that you've either purchased the API or have [enabled billing and activated the API](/maps/documentation/geolocation/get-api-key) to obtain the quota at no charge. |\n| `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](https://cloud.google.com/apis/docs/capping-api-usage) to configure these limits. |\n| `notFound` | `geolocation` | 404 | The request was valid, but no results were returned. |\n| `parseError` | `global` | 400 | The request body is not valid JSON. Refer to the [Request Body](/maps/documentation/geolocation/requests-geolocation#body) section for details on each field. |"]]