Address Validation API 概览
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
简介
Address Validation API 是一项接受地址的服务。它会识别地址组成部分并验证这些组成部分。该服务还会对地址进行标准化处理以方便邮寄,并找到地址的最优纬度/经度坐标。
(可选)对于美国和波多黎各的地址,您可以启用
编码准确性支持系统 (CASS™)。
为何要使用 Address Validation API
借助地址验证 API,您可以提高送达可预测性并减少送达失败的情况,从而提升客户体验。为此,您可以捕获无效地址,并更好地了解地址特征。
如果您不需要验证各个地址组成部分,地理编码 API 可能更符合您的需求。Geocoding API 可将地址转换为纬度和经度坐标。Address Validation API 会验证地址的正确性。如需详细比较,请参阅架构中心的使用 Google Maps Platform 构建位置验证功能。
您可以使用 Address Validation API 执行哪些操作
input试用演示版
借助 Address Validation API,您可以确定地址是否指向真实地点。如果地址不是指真实地点,API 可以识别可能错误的组成部分,您可以向客户展示这些部分以进行更正。以下是使用该 API 的示例工作流程:
客户输入地址 - 下图显示了一个基本表单,客户可以在其中输入地址,这可能是结账流程的一部分。
应用将地址发送到 API - 应用将此地址作为输入传递给 Address Validation API。

API 验证并标准化地址 - Address Validation API 会在其响应中返回由 API 确定的完整地址,或指明缺少哪些信息。
客户确认或更正地址 - 根据 API 返回的内容,您可以向客户提供以下提示:A.确认建议的地址。B. 提供缺失的信息。
C. 修正地址。


Address Validation API 的运作方式
地址验证功能接受以 JSON 正文形式包含地址的 POST 请求。它会将地址拆分为各个组成部分,然后尝试执行以下操作:
- 更正 - 提供组件级验证检查,包括子场所(如有)。
- 完成 - 尝试推断缺失或不正确的地址组成部分。
- 格式 - 清理并标准化地址组成部分的格式。
资源
下表汇总了通过 Address Validation API 提供的资源及其返回的数据。如需了解具体详情,请参阅 Address Validation API 参考文档。
数据资源 |
返回的数据 |
JSON 格式的地址组成部分。
请参阅验证地址。
|
完整且经过验证的地址(如果可能)。
每个地址组件的验证状态。
如果地址可使用以下服务,则:
请参阅了解验证响应。
|
如何使用 Address Validation API
1 |
试用演示版 |
探索演示,其中包含各种正确和不正确的地址格式。
此演示提供了一种有用的方式来探索服务返回的值以及 JSON 格式的 API 响应。 |
2 |
检查覆盖率 |
查看覆盖范围详细信息,了解 Address Validation API 支持哪些国家/地区。 |
3 |
开始设置 |
首先设置您的 Google Cloud 项目,然后完成后续说明。 |
4 |
申请地址验证 |
首先使用基本地址,然后为了提高准确性,您可以启用 CASS(仅适用于美国和波多黎各的地址)。请参阅请求地址验证。 |
5 |
处理回答 |
Address Validation API 响应提供两个属性,您需要以不同的方式使用这两个属性。
请参阅了解基本回答。 |
6 |
提高验证准确性 |
您可以针对 Address Validation API 响应提供反馈,帮助我们提高地址准确性。请参阅处理更新后的地址。 |
可用的客户端库
如需查看适用于 Address Validation API 的可用客户端库的列表,请参阅客户端库。
CASS™ 简介
美国邮政服务公司 (USPS®)1 维护编码准确性支持系统 (CASS™),以支持地址验证提供商并为其提供认证。经过 CASS Certified™ 认证的服务(例如 Address Validation API)已确认能够填写地址中缺失的信息、对地址进行标准化处理并更新地址,从而为您提供最新且最准确的地址。
CASS 默认处于未启用状态,仅支持“美国”和“波多黎各”地区。如需启用 CASS,请在验证请求中将 enableUspsCass
设置为 true
。如需了解详情,请参阅验证地址。
在您使用 USPS 服务期间,USPS 会评估人工创建的地址的请求。如果 USPS 认定某个输入地址是人为创建的,Google 必须停止为相应客户验证地址,并且必须向 USPS 报告该客户的联系信息(姓名和地址)、相关输入地址以及汇总的使用情况数据。使用该 API 即表示您同意遵守这些特定于服务的条款。
后续步骤
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[[["\u003cp\u003eThe Address Validation API validates, standardizes, and geocodes addresses, improving delivery predictability and customer experience.\u003c/p\u003e\n"],["\u003cp\u003eIt identifies address components, validates them for correctness, and provides suggestions for corrections, unlike the Geocoding API, which only converts addresses to coordinates.\u003c/p\u003e\n"],["\u003cp\u003eAddresses are processed by correcting, completing, and formatting components, with CASS™ support for US and Puerto Rico addresses for enhanced accuracy (requires enabling).\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can access resources like a demo, coverage details, setup instructions, validation requests, response understanding, and client libraries to utilize the API effectively.\u003c/p\u003e\n"],["\u003cp\u003eUSPS evaluates requests for artificially created addresses, and Google is obligated to stop validation and report relevant information to USPS in such cases.\u003c/p\u003e\n"]]],["The Address Validation API validates and standardizes addresses, identifying components and correcting errors. It can infer missing information, and determine if an address is a real place. The API accepts an address, validates it, and returns a complete address or flags missing information. Users can confirm, correct, or provide missing details. For US and Puerto Rico addresses, CASS can be enabled for enhanced accuracy. The Geocoding API may be preferred if address component validation is not needed.\n"],null,["**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\nIntroduction The Address Validation API is a service that accepts an address. It identifies address components and validates them. It also standardizes the address for mailing and finds the best known latitude/longitude coordinates for it. Optionally, for addresses in the United States and Puerto Rico, you can enable the [Coding Accuracy Support System (CASS™)](https://developers.google.com/maps/documentation/address-validation/overview#about-cass).\n\nWhy use the Address Validation API\n\nWith the Address Validation API, you can improve delivery predictability and reduce\ndelivery failures, thereby providing improved customer experience. You do this\nby catching bad addresses and obtaining better awareness of address\ncharacteristics.\n\nThe Geocoding API might be a better match for your needs if you\ndon't need to validate the individual address components. The Geocoding API\n**converts** addresses into latitude and longitude coordinates. The\nAddress Validation API validates addresses for **correctness** . See\n[Building location validation capability using Google Maps Platform](https://developers.google.com/maps/architecture/geocoding-address-validation)\nin the Architecture Center for a detailed comparison.\n\nWhat you can do with the Address Validation API\n\n[inputTry the demo](/maps/documentation/address-validation/demo) [](/maps/documentation/address-validation/demo)\n\nWith the Address Validation API, you can determine if an address\nrefers to a real place. If the address does not refer to a real\nplace, the API can identify possibly wrong components that you can present to\nyour customers to correct. Here is a sample workflow using the API:\n\n1. **Customer enters an address** -- The following image shows a basic form\n that allows a customer to enter an address, possibly as part of a checkout\n flow.\n\n2. **App sends the address to the API** -- The application passes this address\n as the input to the Address Validation API.\n\n3. **API validates and standardizes the address** -- In its response, the\n Address Validation API returns the complete address as determined by the API, or\n indicates where information is missing.\n\n4. **Customer confirms or corrects the address** -- Depending on\n what the API returns, you can provide the following prompts to the customer:\n **A.** Confirm the recommended address. **B.** Provide missing information.\n **C.** Fix the address.\n\nHow the Address Validation API works\n\nThe address validation accepts a POST request with the address in the form\nof a JSON body. It separates the address into its individual components, and\nthen attempts the following:\n\n- **Corrects**---Provides component-level validation checks, including sub-premises where available.\n- **Completes**---Attempts to infer missing or incorrect address components.\n- **Formats**---Cleans up and standardizes the format for address components.\n\nResources\n\nThe following table summarizes the resources available through the\nAddress Validation API along with the data it returns. For specific details, see the\n[Address Validation API reference](./reference/rest).\n\n\u003cbr /\u003e\n\n| Data resources | Data returned |\n|-------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Address components in JSON format.** See [Validate an address](/maps/documentation/address-validation/requests-validate-address). | Complete, validated address (if possible). Validation status of each address component. Where available for an address: - Geocode - Address precision - Postal services data, where available. See [Understand the validation response](/maps/documentation/address-validation/understand-response). |\n\n\u003cbr /\u003e\n\nHow to use the Address Validation API\n\n|---|-----------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| 1 | **Try the demo** | [Explore the demo](/maps/documentation/address-validation/demo) with a variety of address forms, both correct and incorrect. The demo provides a useful way to explore both the return values from the service, as well as the JSON formatted API response. |\n| 2 | **Check coverage** | Review [coverage details](/maps/documentation/address-validation/coverage) to see which countries and regions the Address Validation API supports. |\n| 3 | **Get set up** | Start with [Set up your Google Cloud project](/maps/documentation/address-validation/cloud-setup) and complete the instructions that follow. |\n| 4 | **Request an address validation** | Start with a basic address and then, for additional accuracy, you can enable CASS (for US and PR addresses only). See [Request an address validation.](/maps/documentation/address-validation/requests-validate-address) |\n| 5 | **Process a response** | The Address Validation API response provides two properties, each of which you use in different ways. See [Understand a basic response.](/maps/documentation/address-validation/understand-response) |\n| 6 | **Improve validation accuracy** | You can help improve address accuracy by providing feedback on Address Validation API responses. See [Handle updated addresses](/maps/documentation/address-validation/handle-updated-address). |\n\nAvailable client libraries\n\nFor a list of the available client libraries for Address Validation API,\nsee\n[Client libraries](/maps/documentation/address-validation/client_libraries).\n\nAbout CASS™\n\nThe United States Postal Service® (USPS®)^[1](#fn1)^ maintains the\n[Coding Accuracy Support System (CASS™)](https://postalpro.usps.com/certifications/cass)\nto support and certify address validation providers. A CASS Certified™ service,\nsuch as the Address Validation API, has been confirmed for its\nability to fill in information missing from an address, standardize it, and\nupdate it to give you the most current and most accurate address.\n\nCASS is not enabled by default and is only supported for the \"US\" and \"PR\"\nregions. To enable CASS, set `enableUspsCass` to `true` as part of a validation\nrequest. For more information, see\n[Validate an address](/maps/documentation/address-validation/requests-validate-address#enable-cass).\n\nAs part of our use of USPS services, USPS evaluates requests for artificially\ncreated addresses. If USPS identifies an input address as being artificially\ncreated, Google is required to stop validating addresses for the customer and\nmust report the customer's contact information (name and address), the relevant\ninput address, and aggregated usage data to USPS. By using the API you consent\nto these\n[Service Specific Terms](https://cloud.google.com/maps-platform/terms/maps-service-terms).\n\nWhat's next\n\n- **Try the demo** : Go to [Demo](/maps/documentation/address-validation/demo)\n- **Review coverage areas** : Go to [Country and region coverage details](/maps/documentation/address-validation/coverage)\n- **Try your first validation request** : Go to [Send an address validation request](/maps/documentation/address-validation/requests-validate-address)\n- **Process addresses at high volume** : Go to [Use Address Validation API to process addresses at high volume](/maps/architecture/high-volume-address-validation)\n\n*** ** * ** ***\n\n1. Google Maps Platform is a non-exclusive Licensee of the United States\n Postal Service®. The following trademark(s) are owned by the United States\n Postal Service® and used with permission: United States Postal Service®,\n CASS™, CASS Certified™. [↩](#fnref1)"]]