場所のジオコーディング
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
プレイス ジオコーディングを使用すると、プレイス ID から住所を取得できます。
プレイス ID は、Google プレイスのデータベースおよび Google マップで特定の場所を一意に識別する ID です。住所をジオコーディングする際に、プレイス ID を取得します。プレイス ID は、Place Details(新版)、Text Search(新版)、Nearby Search(新版) など、他の多くの API から取得することもできます。
プレイス ジオコーディング リクエスト
場所のジオコーディング リクエストは、次の形式の HTTP GET リクエストです。
https://geocode.googleapis.com/v4beta/geocode/places/PLACE_ID
ここで、PLACE_ID には対象の場所のプレイス ID が含まれます。
他のすべてのパラメータは、URL パラメータとして渡すか、API キーやフィールド マスクなどのパラメータの場合は、GET リクエストの一部としてヘッダーで渡します。次に例を示します。
https://geocode.googleapis.com/v4beta/geocode/places/ChIJj61dQgK6j4AR4GeTYWZsKWw?key=API_KEY
または、curl コマンドで次の操作を行います。
curl -X GET -H 'Content-Type: application/json' \
-H "X-Goog-Api-Key: API_KEY" \
"https://geocode.googleapis.com/v4beta/geocode/places/ChIJj61dQgK6j4AR4GeTYWZsKWw"
OAuth を使用してリクエストを行う
Geocoding API v4 は、認証に OAuth 2.0 をサポートしています。Geocoding API で OAuth を使用するには、OAuth トークンに正しいスコープが割り当てられている必要があります。Geocoding API は、プレイス ジオコーディングで使用する次のスコープをサポートしています。
https://www.googleapis.com/auth/maps-platform.geocode
— すべての Geocoding API エンドポイントで使用します。
https://www.googleapis.com/auth/maps-platform.geocode.place
— プレイス ジオコーディングでは GeocodePlace
とのみ使用します。
また、すべての Geocoding API エンドポイントに一般的な https://www.googleapis.com/auth/cloud-platform
スコープを使用することもできます。このスコープは、すべてのエンドポイントへのアクセスを許可する一般的なスコープであるため、開発時には便利ですが、本番環境では使用できません。
詳細と例については、OAuth を使用するをご覧ください。
プレイス ジオコーディングのレスポンス
プレイス ジオコーディングは、プレイス ID に対応する場所を表す GeocodeResult
オブジェクトを返します。
完全な JSON オブジェクトは次の形式です。
{
"place": "//places.googleapis.com/places/ChIJj61dQgK6j4AR4GeTYWZsKWw",
"placeId": "ChIJj61dQgK6j4AR4GeTYWZsKWw",
"location": {
"latitude": 37.4220541,
"longitude": -122.08532419999999
},
"granularity": "ROOFTOP",
"viewport": {
"low": {
"latitude": 37.4209489697085,
"longitude": -122.08846930000001
},
"high": {
"latitude": 37.4236469302915,
"longitude": -122.0829156
}
},
"formattedAddress": "1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA",
"postalAddress": {
"regionCode": "US",
"languageCode": "en",
"postalCode": "94043",
"administrativeArea": "CA",
"locality": "Mountain View",
"addressLines": [
"1600 Amphitheatre Pkwy"
]
},
"addressComponents": [
{
"longText": "1600",
"shortText": "1600",
"types": [
"street_number"
]
},
{
"longText": "Amphitheatre Parkway",
"shortText": "Amphitheatre Pkwy",
"types": [
"route"
],
"languageCode": "en"
},
{
"longText": "Mountain View",
"shortText": "Mountain View",
"types": [
"locality",
"political"
],
"languageCode": "en"
},
{
"longText": "Santa Clara County",
"shortText": "Santa Clara County",
"types": [
"administrative_area_level_2",
"political"
],
"languageCode": "en"
},
{
"longText": "California",
"shortText": "CA",
"types": [
"administrative_area_level_1",
"political"
],
"languageCode": "en"
},
{
"longText": "United States",
"shortText": "US",
"types": [
"country",
"political"
],
"languageCode": "en"
},
{
"longText": "94043",
"shortText": "94043",
"types": [
"postal_code"
]
}
],
"types": [
"establishment",
"point_of_interest"
]
}
必須パラメータ
place
- 人が読める形式の住所を取得する場所の ID。プレイス ID は、Google の他の API で使用できる一意の識別子です。たとえば、Roads API から返される placeID
を使用して、スナップ ポイントの住所を取得できます。プレイス ID について詳しくは、プレイス ID をご覧ください。
オプション パラメータ
languageCode
結果を返す言語。
-
サポートされている言語の一覧をご覧ください。サポート対象の言語は頻繁に更新されるため、このリストで網羅されていない場合があります。
-
languageCode
が指定されていない場合、API はデフォルトで en
になります。無効な言語コードを指定すると、API は INVALID_ARGUMENT
エラーを返します。
-
API は、ユーザーと地元住民の両方が読める番地を可能な限り提供します。この目標を達成するため、優先言語を考慮し、必要に応じてユーザーが読める文字に音訳して、現地の言語で住所を返します。その他の住所はすべて、優先言語で返されます。住所コンポーネントはすべて同じ言語で返されます。この言語は最初のコンポーネントから選択されます。
-
優先言語で名前が使用できない場合、API は最も近い一致を使用します。
-
優先言語は、API が返す結果のセットと、それらが返される順序にわずかな影響を与えます。ジオコーダーは、言語に応じて略語(通りの種類を表す略語や、ある言語では有効だが別の言語では無効な同義語など)を異なる方法で解釈します。
regionCode
2 文字の CLDR コード値で表される地域コード。デフォルト値はありません。ほとんどの CLDR コードは ISO 3166-1 コードと同一です。
住所のジオコーディング(順方向ジオコーディング)を行う場合、このパラメータは、サービスから返される結果を特定の地域に制限するものではありませんが、その地域を優先して結果を返すように影響を与えることができます。位置情報または場所のジオコーディング、リバース ジオコーディング、場所のジオコーディングを行う際に、このパラメータを使用して住所の形式を指定できます。いずれの場合も、このパラメータは適用される法律に基づいて結果に影響を与える可能性があります。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-09-05 UTC。
[null,null,["最終更新日 2025-09-05 UTC。"],[],[],null,["# Place geocoding\n\n**European Economic Area (EEA) developers** If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](/maps/comms/eea/faq).\n\nPlace geocoding lets you retrieve an address from a [place\nID](/maps/documentation/places/web-service/place-id).\n\nPlace IDs uniquely identify a place in the Google Places database and on Google\nMaps. Retrieve place IDs when you [Geocode an\naddress](/maps/documentation/geocoding). You can also retrieve a place ID from many other APIs, such as\n[Place Details (New)](/maps/documentation/places/web-service/place-details),\n[Text Search (New)](/maps/documentation/places/web-service/text-search),\nand [Nearby Search\n(New)](/maps/documentation/places/web-service/nearby-search).\n\nPlace geocoding requests\n------------------------\n\nA\n[place geocoding](/maps/documentation/geocoding/reference/rest/v4beta/geocode.places)\nrequest is an HTTP GET request in the form: \n\n```scdoc\nhttps://geocode.googleapis.com/v4beta/geocode/places/PLACE_ID\n```\n\nWhere \u003cvar translate=\"no\"\u003ePLACE_ID\u003c/var\u003e contains the place ID of the location of interest.\n\nPass all other parameters as URL parameters or, for parameters such as the API\nkey or field mask, in headers as part of the GET request. For example: \n\n```html\nhttps://geocode.googleapis.com/v4beta/geocode/places/ChIJj61dQgK6j4AR4GeTYWZsKWw?key=API_KEY\n```\n\nOr in a curl command: \n\n```\ncurl -X GET -H 'Content-Type: application/json' \\\n-H \"X-Goog-Api-Key: API_KEY\" \\\n\"https://geocode.googleapis.com/v4beta/geocode/places/ChIJj61dQgK6j4AR4GeTYWZsKWw\"\n```\n\n### Use OAuth to make a request\n\nGeocoding API v4 supports [OAuth\n2.0](/maps/documentation/geocoding/oauth-token) for authentication. To use OAuth\nwith the Geocoding API, the OAuth token must be assigned the correct scope.\nGeocoding API supports the following scopes for use with place geocoding:\n\n- `https://www.googleapis.com/auth/maps-platform.geocode` --- Use with all Geocoding API endpoints.\n- `https://www.googleapis.com/auth/maps-platform.geocode.place` --- Use only with `GeocodePlace` for place geocoding.\n\nAlso, you can use the general `https://www.googleapis.com/auth/cloud-platform`\nscope for all Geocoding API endpoints. That scope is useful during\ndevelopment, but not production, because it is a general scope that allows\naccess to all endpoints.\n\nFor more information and examples, see [Use\nOAuth](/maps/documentation/geocoding/oauth-token).\n\nPlace geocoding responses\n-------------------------\n\nPlace geocoding returns a\n[`GeocodeResult`](/maps/documentation/geocoding/reference/rest/v4beta/GeocodeResult)\nobject that represents the place corresponding to the place ID.\n\nThe complete JSON object is in the form: \n\n```json\n{\n \"place\": \"//places.googleapis.com/places/ChIJj61dQgK6j4AR4GeTYWZsKWw\",\n \"placeId\": \"ChIJj61dQgK6j4AR4GeTYWZsKWw\",\n \"location\": {\n \"latitude\": 37.4220541,\n \"longitude\": -122.08532419999999\n },\n \"granularity\": \"ROOFTOP\",\n \"viewport\": {\n \"low\": {\n \"latitude\": 37.4209489697085,\n \"longitude\": -122.08846930000001\n },\n \"high\": {\n \"latitude\": 37.4236469302915,\n \"longitude\": -122.0829156\n }\n },\n \"formattedAddress\": \"1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA\",\n \"postalAddress\": {\n \"regionCode\": \"US\",\n \"languageCode\": \"en\",\n \"postalCode\": \"94043\",\n \"administrativeArea\": \"CA\",\n \"locality\": \"Mountain View\",\n \"addressLines\": [\n \"1600 Amphitheatre Pkwy\"\n ]\n },\n \"addressComponents\": [\n {\n \"longText\": \"1600\",\n \"shortText\": \"1600\",\n \"types\": [\n \"street_number\"\n ]\n },\n {\n \"longText\": \"Amphitheatre Parkway\",\n \"shortText\": \"Amphitheatre Pkwy\",\n \"types\": [\n \"route\"\n ],\n \"languageCode\": \"en\"\n },\n {\n \"longText\": \"Mountain View\",\n \"shortText\": \"Mountain View\",\n \"types\": [\n \"locality\",\n \"political\"\n ],\n \"languageCode\": \"en\"\n },\n {\n \"longText\": \"Santa Clara County\",\n \"shortText\": \"Santa Clara County\",\n \"types\": [\n \"administrative_area_level_2\",\n \"political\"\n ],\n \"languageCode\": \"en\"\n },\n {\n \"longText\": \"California\",\n \"shortText\": \"CA\",\n \"types\": [\n \"administrative_area_level_1\",\n \"political\"\n ],\n \"languageCode\": \"en\"\n },\n {\n \"longText\": \"United States\",\n \"shortText\": \"US\",\n \"types\": [\n \"country\",\n \"political\"\n ],\n \"languageCode\": \"en\"\n },\n {\n \"longText\": \"94043\",\n \"shortText\": \"94043\",\n \"types\": [\n \"postal_code\"\n ]\n }\n ],\n \"types\": [\n \"establishment\",\n \"point_of_interest\"\n ]\n}\n```\n\nRequired parameters\n-------------------\n\n- `place` --- The place ID of the place for which you want to obtain the human-readable address. The place ID is a unique identifier that can be used with other Google APIs. For example, you can use the `placeID` returned by the [Roads API](/maps/documentation/roads/snap) to get the address for a snapped point. For more information about place IDs, see the [Place IDs](/maps/documentation/places/web-service/place-id).\n\nOptional parameters\n-------------------\n\n-\n\n ### languageCode\n\n The language in which to return results.\n - See the [list of supported languages](/maps/faq#languagesupport). Google often updates the supported languages, so this list may not be exhaustive.\n - If `languageCode` is not supplied, the API defaults to `en`. If you specify an invalid language code, the API returns an `INVALID_ARGUMENT` error.\n - The API does its best to provide a street address that is readable for both the user and locals. To achieve that goal, it returns street addresses in the local language, transliterated to a script readable by the user if necessary, observing the preferred language. All other addresses are returned in the preferred language. Address components are all returned in the same language, which is chosen from the first component.\n - If a name is not available in the preferred language, the API uses the closest match.\n - The preferred language has a small influence on the set of results that the API chooses to return, and the order in which they are returned. The geocoder interprets abbreviations differently depending on language, such as the abbreviations for street types, or synonyms that may be valid in one language but not in another.\n-\n\n ### regionCode\n\n The region code as a\n [two-character CLDR code](https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html) value. There is no default value. Most CLDR codes are identical to ISO 3166-1 codes.\n\n When geocoding an address, *forward geodcoding* , this parameter can influence, but not\n fully restrict, results from the service to the specified region. When geocoding a location or a\n place, *reverse geocoding* or *place geocoding*, this parameter can be used to\n format the address. In all cases, this parameter can affect results based on applicable law."]]