Google 地圖平台是 United States Postal Service® 的非專屬授權使用者。以下商標由 United States Postal Service® 所有,並經過授權使用:United States Postal Service®、CASS™、CASS Certified™。↩
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-06-20 (世界標準時間)。"],[[["\u003cp\u003eThe Address Validation API validates addresses using a POST request to a specified endpoint with a JSON request body containing the address details.\u003c/p\u003e\n"],["\u003cp\u003eThe request body minimally requires the \u003ccode\u003eaddressLines\u003c/code\u003e field, while \u003ccode\u003eregionCode\u003c/code\u003e is recommended for improved accuracy.\u003c/p\u003e\n"],["\u003cp\u003eFor US and PR addresses, enabling the \u003ccode\u003eenableUspsCass\u003c/code\u003e option leverages the CASS™ system for enhanced validation and standardization.\u003c/p\u003e\n"],["\u003cp\u003eUsers can experiment with the API using the API Explorer, which allows for composing requests, customizing parameters, and executing them.\u003c/p\u003e\n"]]],["To validate an address, send a POST request to the provided REST or gRPC endpoint, including a JSON request body that defines the address. The request body must contain the `address` field, a `PostalAddress` type with at least one entry in `addressLines`. Recommended subfields are `regionCode` and `addressLines`; the simplest request should have both. For US and PR regions, enabling `enableUspsCass` will use USPS CASS processing. Use the APIs Explorer to make sample requests.\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\nSend an address validation request by issuing a POST request to one of the\nfollowing endpoints:\n\n- [validateAddress](/maps/documentation/address-validation/reference/rest/v1/TopLevel/validateAddress) (REST)\n- [ValidateAddress](/maps/documentation/address-validation/reference/rpc/google.maps.addressvalidation.v1#google.maps.addressvalidation.v1.AddressValidation.ValidateAddress) (gRPC)\n\n| **Note:** This documentation uses REST for its examples, but the approach is similar with [gRPC](https://www.grpc.io/).\n\nYour request should also pass a [JSON request body](/maps/documentation/address-validation/reference/rest/v1/TopLevel/validateAddress#request-body) to the request that\ndefines the address to validate. The following request body contains one field\nand three subfields: \n\n```json\ncurl -X POST -d '{\n \"address\": {\n \"regionCode\": \"US\",\n \"locality\": \"Mountain View\",\n \"addressLines\": [\"1600 Amphitheatre Pkwy\"]\n }\n}' \\\n-H 'Content-Type: application/json' \\\n\"https://addressvalidation.googleapis.com/v1:validateAddress?key=\u003cvar translate=\"no\"\u003eAPI_KEY\u003c/var\u003e\"\n```\n\nYou can also omit `locality` and specify it as an element in\nthe `addressLines` array: \n\n {\n \"address\": {\n \"regionCode\": \"US\",\n \"addressLines\": [\"1600 Amphitheatre Pkwy\", \"Mountain View, CA, 94043\"]\n },\n }\n\nThe APIs Explorer lets you make live requests so that you can get familiar with\nthe API and the API options: \n[Try it!](#try_it)\n\nAddress request fields\n\nThe request body consists of a single field:\n\n- `address` --- a field of type [`PostalAddress`](/maps/documentation/address-validation/reference/rest/v1/TopLevel/validateAddress#postaladdress), which must contain at least one entry in `addressLines`.\n\nWhen sending the `address` field to the Address Validation API, you need only\nsupply one field: `addressLines`. However, the simplest address request\nshould contain the following subfields:\n\n- `regionCode` --- Recommended. This is an optional field, but if omitted, the Address Validation API infers the region from the address. However, for best results, include the `regionCode` if you know it. For the list of supported regions, see [supported regions](/maps/documentation/address-validation/coverage).\n- `addressLines` --- Required. An array with addresses describing the lower structure of the address.\n\n|----------------------------------------------------------------------------------------------------------------------------------------------|\n| See [PostalAddress](/maps/documentation/address-validation/reference/rest/v1/TopLevel/validateAddress#postaladdress) in the reference guide. |\n\nUSPS CASS™ option\n\nThe United States Postal Service® (USPS®)^[1](#fn1)^ maintains the\n[Coding Accuracy Support System (CASS™)](https://postalpro.usps.com/certifications/cass) to support and certify\naddress validation providers.\n| **Note:** The Address Validation API is confirmed as a CASS-Certified™ service. This means the service is confirmed for its ability to fill in missing address information, standardize it, and update it to the most current and accurate address.\n\nFor US and PR regions only, you can enable CASS processing by setting\n`enableUspsCass` to `true` in the request body. For best results when using\nCASS, provide an address that includes the street and street number along with\nthe city, state, and ZIP code: \n\n {\n \"address\": {\n \"regionCode\": \"US\",\n \"locality\": \"Mountain View\",\n \"administrativeArea\": \"CA\",\n \"postalCode\": \"94043\",\n \"addressLines\": [\"1600 Amphitheatre Pkwy\"]\n },\n \"enableUspsCass\": true\n }\n\n| **Note:** If you don't require CASS processing, or if you are validating addresses outside of the US and PR regions, Google does not recommend enabling this feature.\n\nTry it!\n\nThe APIs Explorer lets you make sample requests so\nthat you can get familiar with the API and the API options.\n\n1. Select the API icon api\n on the right side of the page.\n\n2. Optionally edit the request parameters.\n\n3. Select the **Execute** button. In the dialog, choose the account\n that you want to use to make the request.\n\n4. In the APIs Explorer panel, select the fullscreen icon\n fullscreen to expand the APIs Explorer window.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\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)"]]