Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Nhà phát triển ở Khu vực kinh tế Châu Âu (EEA)
Giới thiệu
Address Validation API là một dịch vụ chấp nhận địa chỉ.
Dịch vụ này xác định các thành phần của địa chỉ và xác thực chúng. Thao tác này cũng chuẩn hoá địa chỉ để gửi thư và tìm toạ độ vĩ độ/kinh độ chính xác nhất cho địa chỉ đó.
Bạn có thể bật Hệ thống hỗ trợ độ chính xác của mã (CASS™) cho địa chỉ ở Hoa Kỳ và Puerto Rico (không bắt buộc).
Lý do nên sử dụng Address Validation API
Với Address Validation API, bạn có thể cải thiện khả năng dự đoán việc giao hàng và giảm số lần giao hàng không thành công, từ đó nâng cao trải nghiệm của khách hàng. Bạn có thể thực hiện việc này bằng cách phát hiện địa chỉ không hợp lệ và nắm rõ hơn các đặc điểm của địa chỉ.
Geocoding API có thể phù hợp hơn với nhu cầu của bạn nếu bạn không cần xác thực từng thành phần địa chỉ. Geocoding API chuyển đổi địa chỉ thành toạ độ vĩ độ và kinh độ. Address Validation API xác thực địa chỉ để đảm bảo tính chính xác. Hãy xem bài viết Xây dựng khả năng xác thực vị trí bằng Google Maps Platform trong Trung tâm kiến trúc để biết thông tin so sánh chi tiết.
Những việc bạn có thể làm với Address Validation API
Với Address Validation API, bạn có thể xác định xem một địa chỉ có phải là địa điểm có thực hay không. Nếu địa chỉ không phải là một địa điểm thực, API có thể xác định các thành phần có thể không chính xác mà bạn có thể trình bày cho khách hàng để sửa. Sau đây là quy trình mẫu sử dụng API này:
Khách hàng nhập địa chỉ – Hình ảnh sau đây cho thấy một biểu mẫu cơ bản cho phép khách hàng nhập địa chỉ, có thể là một phần của quy trình thanh toán.
Ứng dụng gửi địa chỉ đến API – Ứng dụng truyền địa chỉ này làm dữ liệu đầu vào cho Address Validation API.
API xác thực và chuẩn hoá địa chỉ – Trong phản hồi của mình, Address Validation API sẽ trả về địa chỉ đầy đủ do API xác định hoặc cho biết thông tin bị thiếu.
Khách hàng xác nhận hoặc chỉnh sửa địa chỉ – Tuỳ thuộc vào thông tin mà API trả về, bạn có thể đưa ra các lời nhắc sau cho khách hàng:
A. Xác nhận địa chỉ được đề xuất. B. Cung cấp thông tin còn thiếu.
C. Sửa địa chỉ.
Cách hoạt động của Address Validation API
Quy trình xác thực địa chỉ chấp nhận yêu cầu POST có địa chỉ dưới dạng nội dung JSON. Dịch vụ này phân tách địa chỉ thành các thành phần riêng lẻ, sau đó thử thực hiện những việc sau:
Chính xác – Cung cấp các quy trình kiểm tra xác thực ở cấp thành phần, bao gồm cả cơ sở phụ (nếu có).
Hoàn tất – Cố gắng suy luận các thành phần địa chỉ bị thiếu hoặc không chính xác.
Định dạng – Dọn dẹp và chuẩn hoá định dạng cho các thành phần địa chỉ.
Tài nguyên
Bảng sau đây tóm tắt các tài nguyên có sẵn thông qua Address Validation API cùng với dữ liệu mà API này trả về. Để biết thông tin cụ thể, hãy xem Tài liệu tham khảo về Address Validation API.
Khám phá bản minh hoạ
với nhiều biểu mẫu địa chỉ, cả chính xác và không chính xác.
Bản minh hoạ này cung cấp một cách hữu ích để khám phá cả giá trị trả về từ dịch vụ, cũng như phản hồi API được định dạng JSON.
Bắt đầu bằng một địa chỉ cơ bản, sau đó, để tăng độ chính xác, bạn có thể bật CASS (chỉ dành cho địa chỉ ở Hoa Kỳ và Puerto Rico). Xem phần Yêu cầu xác thực địa chỉ.
5
Xử lý phản hồi
Phản hồi của Address Validation API cung cấp 2 thuộc tính, mỗi thuộc tính mà bạn sử dụng theo những cách khác nhau.
Xem phần Tìm hiểu về phản hồi cơ bản.
6
Cải thiện độ chính xác của quy trình xác thực
Bạn có thể giúp cải thiện độ chính xác của địa chỉ bằng cách cung cấp ý kiến phản hồi về các phản hồi của Address Validation API. Xem phần Xử lý địa chỉ được cập nhật.
Các thư viện ứng dụng hiện có
Để biết danh sách các thư viện ứng dụng hiện có cho Address Validation API, hãy xem phần Thư viện ứng dụng.
Giới thiệu về CASS™
Dịch vụ Bưu chính Hoa Kỳ® (USPS®)1 duy trì Hệ thống hỗ trợ độ chính xác của mã (CASS™) để hỗ trợ và chứng nhận các nhà cung cấp dịch vụ xác thực địa chỉ. Một dịch vụ được CASS Certified™ (Chứng nhận CASS), chẳng hạn như Address Validation API (API Xác thực địa chỉ), đã được xác nhận về khả năng điền thông tin còn thiếu trong địa chỉ, chuẩn hoá và cập nhật địa chỉ để cung cấp cho bạn địa chỉ mới nhất và chính xác nhất.
CASS không được bật theo mặc định và chỉ được hỗ trợ cho các khu vực "Hoa Kỳ" và "Puerto Rico". Để bật CASS, hãy đặt enableUspsCass thành true trong yêu cầu xác thực. Để biết thêm thông tin, hãy xem phần Xác thực địa chỉ.
Trong quá trình chúng tôi sử dụng các dịch vụ của USPS, USPS sẽ đánh giá các yêu cầu về địa chỉ được tạo nhân tạo. Nếu USPS xác định một địa chỉ đầu vào là do người dùng tạo ra một cách giả tạo, thì Google phải ngừng xác thực địa chỉ cho khách hàng và phải báo cáo thông tin liên hệ của khách hàng (tên và địa chỉ), địa chỉ đầu vào có liên quan và dữ liệu sử dụng tổng hợp cho USPS. Bằng việc sử dụng API này, bạn đồng ý với các Điều khoản cụ thể về dịch vụ này.
Nền tảng Google Maps là Bên được cấp phép không độc quyền của Dịch vụ Bưu chính Hoa Kỳ. (United States Postal Service®). (Các) nhãn hiệu sau đây thuộc sở hữu của Dịch vụ Bưu chính Hoa Kỳ và được sử dụng khi có sự cho phép: United States Postal Service®, CASS™, CASS Certified™. ↩
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-08-31 UTC."],[[["\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)"]]