ภาพรวม Address Validation API
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
นักพัฒนาแอปในเขตเศรษฐกิจยุโรป (EEA)
บทนำ
Address Validation API เป็นบริการที่ยอมรับที่อยู่
โดยจะระบุส่วนประกอบของที่อยู่และตรวจสอบความถูกต้อง นอกจากนี้ ยังกำหนดรูปแบบ
ที่อยู่สำหรับการจัดส่งทางไปรษณีย์และค้นหาพิกัดละติจูด/ลองจิจูดที่รู้จักกันดีที่สุดสำหรับที่อยู่นั้นด้วย
คุณเลือกเปิดใช้
ระบบสนับสนุนความถูกต้องในการเข้ารหัส (CASS™) สำหรับที่อยู่ในสหรัฐอเมริกาและเปอร์โตริโกได้
เหตุใดจึงต้องใช้ Address Validation API
Address Validation API ช่วยให้คุณปรับปรุงความสามารถในการคาดการณ์การนำส่งและลด
การนำส่งที่ไม่สำเร็จ ซึ่งจะช่วยปรับปรุงประสบการณ์ของลูกค้า คุณทำได้โดยการตรวจจับที่อยู่ที่ไม่ถูกต้องและเพิ่มความตระหนักถึงลักษณะของที่อยู่
Geocoding API อาจเหมาะกับความต้องการของคุณมากกว่าหากคุณ
ไม่จำเป็นต้องตรวจสอบคอมโพเนนต์ของที่อยู่แต่ละรายการ Geocoding API
แปลงที่อยู่เป็นพิกัดละติจูดและลองจิจูด Address Validation API จะตรวจสอบความถูกต้องของที่อยู่ ดูการเปรียบเทียบแบบละเอียดได้ที่
การสร้างความสามารถในการตรวจสอบความถูกต้องของสถานที่โดยใช้แพลตฟอร์ม Google Maps
ในศูนย์สถาปัตยกรรม
สิ่งที่คุณทำได้ด้วย Address Validation API
inputลองใช้เวอร์ชันเดโม
Address Validation API ช่วยให้คุณระบุได้ว่าที่อยู่
อ้างอิงถึงสถานที่จริงหรือไม่ หากที่อยู่ไม่ได้อ้างอิงถึงสถานที่จริง
API จะระบุคอมโพเนนต์ที่อาจไม่ถูกต้องซึ่งคุณสามารถนำเสนอต่อ
ลูกค้าเพื่อแก้ไขได้ ตัวอย่างเวิร์กโฟลว์ที่ใช้ API มีดังนี้
ลูกค้าป้อนที่อยู่ - รูปภาพต่อไปนี้แสดงแบบฟอร์มพื้นฐาน
ที่อนุญาตให้ลูกค้าป้อนที่อยู่ ซึ่งอาจเป็นส่วนหนึ่งของขั้นตอนการชำระเงิน
แอปส่งที่อยู่ไปยัง API - แอปพลิเคชันส่งที่อยู่นี้
เป็นอินพุตไปยัง Address Validation API

API จะตรวจสอบและกำหนดรูปแบบที่อยู่ให้เป็นมาตรฐาน - ในการตอบกลับ Address Validation API จะแสดงที่อยู่ที่สมบูรณ์ตามที่ API กำหนด หรือระบุตำแหน่งที่ไม่มีข้อมูล
ลูกค้ายืนยันหรือแก้ไขที่อยู่ - คุณสามารถแสดงข้อความต่อไปนี้ต่อลูกค้าได้โดยขึ้นอยู่กับ
สิ่งที่ API แสดงผล
ก. ยืนยันที่อยู่ที่แนะนำ ข. ระบุข้อมูลที่ขาดหายไป
ค. แก้ไขที่อยู่


วิธีการทำงานของ Address Validation API
การตรวจสอบที่อยู่ยอมรับคำขอ POST ที่มีที่อยู่ในรูปแบบเนื้อหา JSON โดยจะแยกที่อยู่ออกเป็นส่วนประกอบต่างๆ แล้วพยายามทำสิ่งต่อไปนี้
- แก้ไข - มีการตรวจสอบความถูกต้องระดับคอมโพเนนต์ รวมถึง
สถานที่ย่อยหากมี
- ทำให้สมบูรณ์ - พยายามอนุมานองค์ประกอบที่อยู่ซึ่งขาดหายไปหรือไม่ถูกต้อง
- รูปแบบ - ล้างและกำหนดรูปแบบมาตรฐานสำหรับคอมโพเนนต์ของที่อยู่
แหล่งข้อมูล
ตารางต่อไปนี้สรุปทรัพยากรที่พร้อมใช้งานผ่าน
Address Validation API พร้อมกับข้อมูลที่ส่งคืน โปรดดูรายละเอียดที่ข้อมูลอ้างอิงของ Address Validation API
วิธีใช้ Address Validation API
1 |
ลองใช้เวอร์ชันเดโม |
สำรวจเดโม
โดยใช้รูปแบบที่อยู่ต่างๆ ทั้งที่ถูกต้องและไม่ถูกต้อง
การสาธิตเป็นวิธีที่มีประโยชน์ในการสำรวจทั้งค่าที่ส่งคืนจากบริการ
และคำตอบของ API ที่จัดรูปแบบ JSON |
2 |
ตรวจสอบความครอบคลุม |
ดูรายละเอียดความครอบคลุม
เพื่อดูว่า Address Validation API รองรับประเทศและภูมิภาคใดบ้าง |
3 |
เริ่มต้นใช้งาน |
เริ่มต้นด้วยตั้งค่าโปรเจ็กต์ Google Cloud
และทําตาม
วิธีการที่ตามมาให้เสร็จสมบูรณ์ |
4 |
ขอการตรวจสอบที่อยู่ |
เริ่มต้นด้วยที่อยู่พื้นฐาน จากนั้นคุณจะ
เปิดใช้ CASS (สำหรับที่อยู่ในสหรัฐอเมริกาและเปอร์โตริโกเท่านั้น) เพื่อเพิ่มความแม่นยำได้ ดูขอการตรวจสอบที่อยู่ |
5 |
ประมวลผลการตอบกลับ |
การตอบกลับของ Address Validation API มีพร็อพเพอร์ตี้ 2 รายการ ซึ่งแต่ละรายการ
คุณใช้ในวิธีที่แตกต่างกัน
ดูทำความเข้าใจการตอบกลับพื้นฐาน |
6 |
ปรับปรุงความแม่นยำในการตรวจสอบ |
คุณช่วยปรับปรุงความถูกต้องของที่อยู่ได้โดยการแสดงความคิดเห็นเกี่ยวกับ
การตอบกลับของ Address Validation API ดูจัดการที่อยู่ที่อัปเดต |
ไลบรารีของไคลเอ็นต์ที่พร้อมใช้งาน
ดูรายการไลบรารีของไคลเอ็นต์ที่พร้อมใช้งานสำหรับ Address Validation API ได้ที่
ไลบรารีของไคลเอ็นต์
เกี่ยวกับ CASS™
United States Postal Service® (USPS®)1 มี
Coding Accuracy Support System (CASS™)
เพื่อสนับสนุนและรับรองผู้ให้บริการตรวจสอบความถูกต้องของที่อยู่ บริการที่ได้รับการรับรอง CASS™
เช่น Address Validation API ได้รับการยืนยันแล้วว่ามีความสามารถ
ในการกรอกข้อมูลที่ขาดหายไปจากที่อยู่ ทำให้เป็นมาตรฐาน และ
อัปเดตเพื่อให้คุณได้รับที่อยู่ที่ทันสมัยและแม่นยำที่สุด
ระบบไม่ได้เปิดใช้ CASS โดยค่าเริ่มต้น และรองรับเฉพาะภูมิภาค "US" และ "PR"
หากต้องการเปิดใช้ CASS ให้ตั้งค่า enableUspsCass
เป็น true
ซึ่งเป็นส่วนหนึ่งของคำขอ
การตรวจสอบ ดูข้อมูลเพิ่มเติมได้ที่
ตรวจสอบที่อยู่
ในส่วนของการใช้บริการของ USPS นั้น USPS จะประเมินคำขอสำหรับที่อยู่ที่สร้างขึ้นโดยไม่เป็นไปตามธรรมชาติ
หาก USPS ระบุว่าที่อยู่ที่ป้อนสร้างขึ้นโดยไม่เป็นไปตามธรรมชาติ
Google จะต้องหยุดตรวจสอบที่อยู่สำหรับลูกค้าและ
ต้องรายงานข้อมูลติดต่อของลูกค้า (ชื่อและที่อยู่) ที่อยู่ที่ป้อนที่เกี่ยวข้อง และข้อมูลการใช้งานที่รวบรวมแล้วให้ USPS การใช้ API แสดงว่าคุณยินยอม
ตามข้อกำหนดเฉพาะของบริการเหล่านี้
ขั้นตอนถัดไป
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-31 UTC
[null,null,["อัปเดตล่าสุด 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)"]]