Geocoding API
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
将地址转换为地理坐标(地理编码),然后,您可以使用这些坐标在地图上放置标记或在地图上定位。您还可以使用此 API 将地理坐标转换为地址(反向地理编码)。
服务:geocoding-backend.googleapis.com
如果您的应用需要使用您自己的库来调用此服务,则在发出 API 请求时应使用以下信息。
发现文档
发现文档是用于说明和使用 REST API 的机器可读规范。它用于构建客户端库、IDE 插件以及与 Google API 交互的其他工具。一项服务可能会提供多个发现文档。此服务提供了以下发现文档:
服务端点
服务端点是指定 API 服务的网络地址的基本网址。一项服务可能有多个服务端点。此服务具有以下服务端点,下面的所有 URI 都与此服务端点相关:
https://geocode.googleapis.com
方法 |
geocodePlace |
GET /v4beta/geocode/{place=places/*}
此方法使用地点 ID 执行地理编码查找。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-13。
[null,null,["最后更新时间 (UTC):2025-08-13。"],[],[],null,["# Geocoding API\n\nConvert addresses into geographic coordinates (geocoding), which you can use to place markers or position the map. This API also allows you to convert geographic coordinates into an address (reverse geocoding).\n\n- [REST Resource: v4beta.geocode.address](#v4beta.geocode.address)\n- [REST Resource: v4beta.geocode.location](#v4beta.geocode.location)\n- [REST Resource: v4beta.geocode.places](#v4beta.geocode.places)\n- [REST Resource: v4alpha.geocode.destinations](#v4alpha.geocode.destinations)\n\nService: geocoding-backend.googleapis.com\n-----------------------------------------\n\nIf your application needs to use your own libraries to call this service, use the following information when you make the API requests.\n\n### Discovery document\n\nA [Discovery Document](https://developers.google.com/discovery/v1/reference/apis) is a machine-readable specification for describing and consuming REST APIs. It is used to build client libraries, IDE plugins, and other tools that interact with Google APIs. One service may provide multiple discovery documents. This service provides the following discovery documents:\n\n- \u003chttps://geocoding-backend.googleapis.com/$discovery/rest?version=v4beta\u003e\n- \u003chttps://geocoding-backend.googleapis.com/$discovery/rest?version=v4alpha\u003e\n\n### Service endpoint\n\nA [service endpoint](https://cloud.google.com/apis/design/glossary#api_service_endpoint) is a base URL that specifies the network address of an API service. One service might have multiple service endpoints. This service has the following service endpoint and all URIs below are relative to this service endpoint:\n\n- `https://geocode.googleapis.com`\n\nREST Resource: [v4beta.geocode.address](/maps/documentation/geocoding/reference/rest/v4beta/geocode.address)\n------------------------------------------------------------------------------------------------------------\n\n| Methods ||\n|----------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|\n| [geocodeAddress](/maps/documentation/geocoding/reference/rest/v4beta/geocode.address/geocodeAddress) | `GET /v4beta/geocode/address` This method performs an address geocode, which maps an address to a LatLng. |\n| [geocodeAddressQuery](/maps/documentation/geocoding/reference/rest/v4beta/geocode.address/geocodeAddressQuery) | `GET /v4beta/geocode/address/{addressQuery}` This method performs an address geocode, which maps an address to a LatLng. |\n\nREST Resource: [v4beta.geocode.location](/maps/documentation/geocoding/reference/rest/v4beta/geocode.location)\n--------------------------------------------------------------------------------------------------------------\n\n| Methods ||\n|-------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------|\n| [geocodeLocation](/maps/documentation/geocoding/reference/rest/v4beta/geocode.location/geocodeLocation) | `GET /v4beta/geocode/location` This method performs a location geocode, which maps a LatLng to an address. |\n| [geocodeLocationQuery](/maps/documentation/geocoding/reference/rest/v4beta/geocode.location/geocodeLocationQuery) | `GET /v4beta/geocode/location/{locationQuery}` This method performs a location geocode, which maps a LatLng to an address. |\n\nREST Resource: [v4beta.geocode.places](/maps/documentation/geocoding/reference/rest/v4beta/geocode.places)\n----------------------------------------------------------------------------------------------------------\n\n| Methods ||\n|-------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|\n| [geocodePlace](/maps/documentation/geocoding/reference/rest/v4beta/geocode.places/geocodePlace) | `GET /v4beta/geocode/{place=places/*}` This method performs a geocode lookup using a place ID. |\n\nREST Resource: [v4alpha.geocode.destinations](/maps/documentation/geocoding/reference/rest/v4alpha/geocode.destinations)\n------------------------------------------------------------------------------------------------------------------------\n\n| Methods ||\n|--------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|\n| [searchDestinations](/maps/documentation/geocoding/reference/rest/v4alpha/geocode.destinations/searchDestinations) | `POST /v4alpha/geocode/destinations` This method performs a destination lookup and returns a list of destinations. |"]]