Votre requête doit également transmettre un corps de requête JSON à la requête qui définit l'adresse à valider. Le corps de requête suivant contient un champ et trois sous-champs :
Le corps de la requête se compose d'un seul champ :
address : champ de type PostalAddress, qui doit contenir au moins une entrée dans addressLines.
Lorsque vous envoyez le champ address à l'API Address Validation, vous n'avez besoin de fournir qu'un seul champ : addressLines. Toutefois, la requête d'adresse la plus simple doit contenir les sous-champs suivants :
regionCode : recommandé. Ce champ est facultatif. Si vous l'omettez, l'API Address Validation déduit la région à partir de l'adresse. Toutefois, pour de meilleurs résultats, incluez le regionCode si vous le connaissez.
Pour obtenir la liste des régions compatibles, consultez Régions compatibles.
addressLines : obligatoire. Tableau contenant les adresses décrivant la structure inférieure de l'adresse.
Le service postal des États-Unis (United States Postal Service®)1 gère le système CASS™ (Coding Accuracy Support System) afin d'aider et de certifier les fournisseurs de validation d'adresse.
Pour les régions des États-Unis et de Porto Rico uniquement, vous pouvez activer le traitement CASS en définissant enableUspsCass sur true dans le corps de la requête. Pour obtenir les meilleurs résultats avec CASS, fournissez une adresse qui inclut la rue et le numéro de rue, ainsi que la ville, l'État et le code postal :
APIs Explorer vous permet d'effectuer des exemples de requêtes pour vous familiariser avec l'API et ses options.
Sélectionnez l'icône API api à droite de la page.
Vous pouvez également modifier les paramètres de la requête.
Sélectionnez le bouton Exécuter. Dans la boîte de dialogue, sélectionnez le compte que vous souhaitez utiliser pour envoyer la demande.
Dans le panneau APIs Explorer, sélectionnez l'icône plein écran fullscreen pour développer la fenêtre APIs Explorer.
Google Maps Platform est un licencié non exclusif du service postal des États-Unis(United States Postal Service®). La ou les marques suivantes appartiennent au service postal des États-Unis et sont utilisées avec son autorisation : United States Postal Service®, CASS™, CASS Certified™. ↩
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/08/31 (UTC).
[null,null,["Dernière mise à jour le 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)"]]