Address Validation API 總覽
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
簡介
Address Validation API 是一項服務,可接受地址。
這項服務會識別並驗證地址元件,這項服務也會將地址標準化以利郵寄,並找出最合適的經緯度座標。(選用) 如果地址位於美國和波多黎各,可以啟用
編碼準確度支援系統 (CASS™)。
使用 Address Validation API 的原因
使用 Address Validation API,您可以提高送達預測準確度並減少送貨失敗情形,進而提升顧客體驗。方法是找出錯誤地址,並進一步瞭解地址特徵。
如果您不需要驗證個別地址元件,可能更適合使用 Geocoding API。Geocoding API 可將地址轉換為經緯度座標,Address Validation API 會驗證地址的正確性。如需詳細比較,請參閱 Architecture Center 的「使用 Google 地圖平台建構位置驗證功能」。
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 的運作方式
地址驗證會接受 POST 要求,並以 JSON 主體的形式提供地址。這項服務會將地址拆分成個別元件,然後嘗試執行下列操作:
- 正確:提供元件層級的驗證檢查,包括子場所 (如有)。
- 完成:嘗試推斷缺漏或不正確的地址元件。
- 格式:清理並標準化地址元件的格式。
資源
下表概略說明 Address Validation API 提供的資源,以及傳回的資料。如需具體詳細資料,請參閱地址驗證 API 參考資料。
資料資源 |
傳回的資料 |
JSON 格式的地址元件。
請參閱「驗證地址」。
|
完整且通過驗證的地址 (盡可能)。
每個地址元件的驗證狀態。
地址適用的國家/地區:
- Geocode
- 地址精確度
- 郵政服務資料 (如有)。
請參閱「瞭解驗證回應」。
|
如何使用 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 即表示您同意這些服務專屬條款。
後續步驟
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-31 (世界標準時間)。
[null,null,["上次更新時間: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)"]]