La richiesta deve anche passare un corpo della richiesta JSON alla richiesta che
definisce l'indirizzo da convalidare. Il seguente corpo della richiesta contiene un campo
e tre campi secondari:
Il corpo della richiesta è costituito da un unico campo:
address: un campo di tipo PostalAddress, che deve contenere almeno una voce in addressLines.
Quando invii il campo address all'API Address Validation, devi fornire un solo campo: addressLines. Tuttavia, la richiesta di indirizzo più semplice
deve contenere i seguenti campi secondari:
regionCode: consigliato. Si tratta di un campo facoltativo, ma se omesso, l'API Address Validation deduce la regione dall'indirizzo. Tuttavia, per ottenere risultati
ottimali, includi regionCode se lo conosci.
Per l'elenco delle regioni supportate, consulta Regioni supportate.
addressLines: obbligatorio. Un array con indirizzi che descrivono la struttura inferiore
dell'indirizzo.
United States Postal Service® (USPS®)1 utilizza il
Coding Accuracy Support System (CASS™) per supportare e certificare
i fornitori di convalida degli indirizzi.
Solo per le regioni Stati Uniti e Porto Rico, puoi attivare l'elaborazione CASS impostando
enableUspsCass su true nel corpo della richiesta. Per ottenere risultati ottimali quando utilizzi
CASS, fornisci un indirizzo che includa la via e il numero civico, nonché
la città, la provincia e il codice postale:
L'Explorer API ti consente di effettuare richieste di esempio per
familiarizzare con l'API e le relative opzioni.
Seleziona l'icona API api
sul lato destro della pagina.
(Facoltativo) Modifica i parametri della richiesta.
Seleziona il pulsante Esegui. Nella finestra di dialogo, scegli l'account
che vuoi utilizzare per effettuare la richiesta.
Nel riquadro Explorer API, seleziona l'icona a schermo intero
fullscreen per espandere la finestra di Explorer API.
Google Maps Platform è un licenziatario non esclusivo di United States
Postal Service®. I seguenti marchi sono di proprietà di United States
Postal Service® e vengono utilizzati dietro autorizzazione: United States Postal Service®,
CASS™, CASS Certified™. ↩
[null,null,["Ultimo aggiornamento 2025-08-31 UTC."],[[["\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)"]]