地点地理编码请求和响应
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本页展示了用于检索地点 ID 对应地址的请求和响应。
必需参数
place_id
- 您要用来获取直观易懂的地址的地点 ID。地点 ID 是唯一标识符,可以与其他 Google API 搭配使用。例如,您可以使用 Roads API 返回的 placeID
来获取贴合点的地址。如需详细了解地点 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"
}
如需了解响应中各个字段的说明,请参阅地理编码响应。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[[["\u003cp\u003eThis page explains how to retrieve a human-readable address for a given place ID using the Google Maps Geocoding API.\u003c/p\u003e\n"],["\u003cp\u003eYou need to provide a \u003ccode\u003eplace_id\u003c/code\u003e and your API \u003ccode\u003ekey\u003c/code\u003e as required parameters in the request.\u003c/p\u003e\n"],["\u003cp\u003eOptional parameters for refining the request are available and shared with reverse geocoding.\u003c/p\u003e\n"],["\u003cp\u003eA successful response includes detailed address components, formatted address, location coordinates, and more.\u003c/p\u003e\n"],["\u003cp\u003eRefer to the provided links for details on place IDs, API keys, optional parameters, and response fields.\u003c/p\u003e\n"]]],["To retrieve a place's address, you need the `place_id` and your API `key`. These parameters are used in a query, which is sent as a request. The response returns the address components, including the street number, name, neighborhood, city, state, country, and postal code. It also provides a formatted address and the place's geographic coordinates. The `place_id` uniquely identifies the location and can be obtained from other Google APIs.\n"],null,["# Place geocoding request and response\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\nThis page shows you requests and responses to retrieve an address for a place ID.\n\nRequired parameters\n-------------------\n\n- `place_id` --- The place ID of the place for which you wish 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 ID overview](/maps/documentation/places/web-service/place-id)..\n- `key` --- Your application's API key. This key identifies your application for purposes of quota management. Learn how to [get a key](/maps/documentation/geocoding/get-api-key).\n\nThe optional parameters are the same as those for\n[reverse geocoding](/maps/documentation/geocoding/requests-reverse-geocoding).\n\nThe following query contains the place ID of a place in Brooklyn: \n\n https://maps.googleapis.com/maps/api/geocode/json?place_id=ChIJd8BlQ2BZwokRAFUEcm_qrcA\n &key=YOUR_API_KEY\n\nThe above query returns the following result: \n\n {\n \"results\" : [\n {\n \"address_components\" : [\n {\n \"long_name\" : \"277\",\n \"short_name\" : \"277\",\n \"types\" : [ \"street_number\" ]\n },\n {\n \"long_name\" : \"Bedford Avenue\",\n \"short_name\" : \"Bedford Ave\",\n \"types\" : [ \"route\" ]\n },\n {\n \"long_name\" : \"Williamsburg\",\n \"short_name\" : \"Williamsburg\",\n \"types\" : [ \"neighborhood\", \"political\" ]\n },\n {\n \"long_name\" : \"Brooklyn\",\n \"short_name\" : \"Brooklyn\",\n \"types\" : [ \"political\", \"sublocality\", \"sublocality_level_1\" ]\n },\n {\n \"long_name\" : \"Kings County\",\n \"short_name\" : \"Kings County\",\n \"types\" : [ \"administrative_area_level_2\", \"political\" ]\n },\n {\n \"long_name\" : \"New York\",\n \"short_name\" : \"NY\",\n \"types\" : [ \"administrative_area_level_1\", \"political\" ]\n },\n {\n \"long_name\" : \"United States\",\n \"short_name\" : \"US\",\n \"types\" : [ \"country\", \"political\" ]\n },\n {\n \"long_name\" : \"11211\",\n \"short_name\" : \"11211\",\n \"types\" : [ \"postal_code\" ]\n }\n ],\n \"formatted_address\" : \"277 Bedford Ave, Brooklyn, NY 11211, USA\",\n \"geometry\" : {\n \"location\" : {\n \"lat\" : 40.7142205,\n \"lng\" : -73.9612903\n },\n \"location_type\" : \"ROOFTOP\",\n \"viewport\" : {\n \"northeast\" : {\n \"lat\" : 40.71556948029149,\n \"lng\" : -73.95994131970849\n },\n \"southwest\" : {\n \"lat\" : 40.7128715197085,\n \"lng\" : -73.9626392802915\n }\n }\n },\n \"place_id\" : \"ChIJd8BlQ2BZwokRAFUEcm_qrcA\",\n \"types\" : [ \"street_address\" ]\n }\n ],\n \"status\" : \"OK\"\n }\n\nFor a description of the fields in the response, see\n[Geocoding responses](/maps/documentation/geocoding/requests-geocoding#responses)."]]