此页面向您展示了检索地点 ID 的地址的请求和响应。
必需参数
place_id
- 表示哪个地点的地点 ID 您希望获取人类可读的地址。地点 ID 是唯一的 可以与其他 Google API 搭配使用的标识符。例如,您可以 使用由placeID
Roads API 以获取贴靠点的地址。关于地点的更多信息 ID,请参阅地点 ID 概览。key
- 您的应用的 API 密钥。此密钥用于标识 以便管理配额了解如何 获取密钥。
可选参数与 反向地理编码。
以下查询包含了布鲁克林某个位置的地点 ID:
https://maps.googleapis.com/maps/api/geocode/json?place_id=ChIJd8BlQ2BZwokRAFUEcm_qrcA
&key=YOUR_API_KEY
上述查询返回以下结果:
{
"results" : [
{
"address_components" : [
{
"long_name" : "277",
"short_name" : "277",
"types" : [ "street_number" ]
},
{
"long_name" : "Bedford Avenue",
"short_name" : "Bedford Ave",
"types" : [ "route" ]
},
{
"long_name" : "Williamsburg",
"short_name" : "Williamsburg",
"types" : [ "neighborhood", "political" ]
},
{
"long_name" : "Brooklyn",
"short_name" : "Brooklyn",
"types" : [ "political", "sublocality", "sublocality_level_1" ]
},
{
"long_name" : "Kings County",
"short_name" : "Kings County",
"types" : [ "administrative_area_level_2", "political" ]
},
{
"long_name" : "New York",
"short_name" : "NY",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "United States",
"short_name" : "US",
"types" : [ "country", "political" ]
},
{
"long_name" : "11211",
"short_name" : "11211",
"types" : [ "postal_code" ]
}
],
"formatted_address" : "277 Bedford Ave, Brooklyn, NY 11211, USA",
"geometry" : {
"location" : {
"lat" : 40.7142205,
"lng" : -73.9612903
},
"location_type" : "ROOFTOP",
"viewport" : {
"northeast" : {
"lat" : 40.71556948029149,
"lng" : -73.95994131970849
},
"southwest" : {
"lat" : 40.7128715197085,
"lng" : -73.9626392802915
}
}
},
"place_id" : "ChIJd8BlQ2BZwokRAFUEcm_qrcA",
"types" : [ "street_address" ]
}
],
"status" : "OK"
}
有关响应中字段的说明,请参阅 地理编码响应。