Method: geocode.location.geocodeLocationQuery
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Metode ini melakukan geocode lokasi, yang memetakan LatLng ke alamat. API ini juga memberikan informasi terstruktur tentang alamat.
Permintaan HTTP
GET https://geocode.googleapis.com/v4beta/geocode/location/{locationQuery}
URL menggunakan sintaksis gRPC Transcoding.
Parameter jalur
Parameter |
Parameter gabungan location_input . Lokasi yang akan di-geocode. location_input hanya dapat berupa salah satu dari berikut: |
locationQuery |
string
Lokasi dalam format string "lat,lng". Misalnya, "64.7611872,-18.4705364".
|
Parameter kueri
Parameter |
languageCode |
string
Opsional. Bahasa yang digunakan untuk menampilkan hasil.
|
regionCode |
string
Opsional. Kode wilayah. Kode wilayah, yang ditentukan sebagai nilai dua karakter ccTLD ("domain level teratas"). Parameter ini memengaruhi hasil berdasarkan hukum yang berlaku.
|
types[] |
string
Opsional. Kumpulan tag jenis untuk membatasi hasil. Hasil yang tidak memiliki jenis yang ditentukan akan dihapus. Untuk daftar lengkap kemungkinan nilai, lihat Tabel A dan Tabel B di https://developers.google.com/maps/documentation/places/web-service/place-types.
|
granularity[] |
enum (GeocodeResult.Granularity )
Opsional. Filter dari satu atau beberapa enum perincian lokasi.
|
Parameter gabungan location_input . Lokasi yang akan di-geocode. location_input hanya dapat berupa salah satu dari berikut: |
location |
object (LatLng )
Lokasi dalam format terstruktur.
|
Isi permintaan
Isi permintaan harus kosong.
Isi respons
Jika berhasil, isi respons memuat instance GeocodeLocationResponse
.
Cakupan otorisasi
Memerlukan salah satu cakupan OAuth berikut:
https://www.googleapis.com/auth/cloud-platform
https://www.googleapis.com/auth/maps-platform.geocode
https://www.googleapis.com/auth/maps-platform.geocode.location
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-08-31 UTC.
[null,null,["Terakhir diperbarui pada 2025-08-31 UTC."],[],[],null,["# Method: geocode.location.geocodeLocationQuery\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n\nThis method performs a location geocode, which maps a LatLng to an address. It also provides structured information about the address.\n\n### HTTP request\n\n`GET https://geocode.googleapis.com/v4beta/geocode/location/{locationQuery}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|-----------------|-------------------------------------------------------------------------------------------------|\n| Union parameter `location_input`. The location to geocode. `location_input` can be only one of the following: ||\n| `locationQuery` | `string` The location in the format of \"lat,lng\" string. For example, \"64.7611872,-18.4705364\". |\n\n### Query parameters\n\n| Parameters ||\n|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `languageCode` | `string` Optional. Language in which the results should be returned. |\n| `regionCode` | `string` Optional. Region code. The region code, specified as a ccTLD (\"top-level domain\") two-character value. The parameter affects results based on applicable law. |\n| `types[]` | `string` Optional. A set of type tags to restrict the results. Results that do not have any of the specified types are removed. For the complete list of possible values, see Table A and Table B at \u003chttps://developers.google.com/maps/documentation/places/web-service/place-types\u003e. |\n| `granularity[]` | `enum (`[GeocodeResult.Granularity](/maps/documentation/geocoding/reference/rest/v4beta/GeocodeResult.Granularity)`)` Optional. A filter of one or more location granularity enums. |\n| Union parameter `location_input`. The location to geocode. `location_input` can be only one of the following: ||\n| `location` | `object (`[LatLng](/maps/documentation/geocoding/reference/rest/Shared.Types/LatLng)`)` The location in the structured format. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains an instance of [GeocodeLocationResponse](/maps/documentation/geocoding/reference/rest/v4beta/GeocodeLocationResponse).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n- `\n https://www.googleapis.com/auth/maps-platform.geocode`\n- `\n https://www.googleapis.com/auth/maps-platform.geocode.location`"]]