<iframe src="https://developers.devsite.google/frame/maps/documentation/javascript/reference/address-validation_276a77a5842a31a961af3e8d61b75d188b1920feec1f089582060656653af51b.frame" class="framebox inherit-locale redirect-iframe" allow="clipboard-write https://developers.devsite.google" allowfullscreen is-upgraded></iframe>

## [AddressValidation](https://developers.google.com/maps/documentation/javascript/reference/address-validation.md.txt#AddressValidation)
class


class
`google.maps.addressValidation.AddressValidation`

library `"addressValidation"`

Static class for accessing the AddressValidation APIs.

```javascript
const {AddressValidation} = await google.maps.importLibrary("addressValidation");
```

| ### Static Methods ||
|---|---|
| `fetchAddressValidation` | `fetchAddressValidation(request)` **Parameters:** - `request: AddressValidationRequest` **Return Value:** `Promise<AddressValidation>` Validates an address. See <https://developers.google.com/maps/documentation/javascript/address-validation/validate-address>. |

| ### Properties ||
|---|---|
| `address` readonly | **Type:** `Address optional` Information about the address itself as opposed to the geocode. |
| `geocode` readonly | **Type:** `Geocode optional` Information about the location and place that the address geocoded to. |
| `metadata` readonly | **Type:** `AddressMetadata optional` Other information relevant to deliverability. `metadata` is not guaranteed to be fully populated for every address sent to the Address Validation API. |
| `responseId` readonly | **Type:** `string optional` The UUID that identifies this response. If the address needs to be re-validated, this UUID *must* accompany the new request. |
| `uspsData` readonly | **Type:** `USPSData optional` Extra deliverability flags provided by USPS. Only provided in region `US` and `PR`. |
| `verdict` readonly | **Type:** `Verdict optional` Overall verdict flags |

| ### Methods ||
|---|---|

## [AddressValidationRequest](https://developers.google.com/maps/documentation/javascript/reference/address-validation.md.txt#AddressValidationRequest)
interface


interface
`google.maps.addressValidation.AddressValidationRequest`

Request interface for `AddressValidation.fetchAddressValidation`.

| ### Properties ||
|---|---|
| `address` | **Type:** `PostalAddressLiteral` The address being validated. Unformatted addresses should be submitted via `PostalAddress.addressLines`. |
| `internalUsageAttributionIds` optional | **Type:** `Iterable<string> optional` Identifiers used to attribute calls to specific packages or OSS libraries. |
| `placeAutocompleteElement` optional | **Type:** `PlaceAutocompleteElement optional` If using a PlaceAutocompleteElement, include it here to link the AddressValidation API calls with the autocomplete session token. |
| `previousResponseId` optional | **Type:** `string optional` This field must not be set for the first address validation request. If more requests are necessary to fully validate a single address (for example if the changes the user makes after the initial validation need to be re-validated), then each followup request must populate this field with the `AddressValidation.responseId` from the very first response in the validation sequence. |
| `sessionToken` optional | **Type:** `AutocompleteSessionToken optional` A token which identifies an Autocomplete session for billing purposes. |
| `uspsCASSEnabled` optional | **Type:** `boolean optional` Enables USPS CASS compatible mode. This affects *only* the `AddressValidation.uspsData` field of `AddressValidation`. Note: for USPS CASS enabled requests for addresses in Puerto Rico, a `PostalAddress.regionCode` of the `address` must be provided as "PR", or an `PostalAddress.administrativeArea` of the `address` must be provided as "Puerto Rico" (case-insensitive) or "PR". |

## [Address](https://developers.google.com/maps/documentation/javascript/reference/address-validation.md.txt#Address)
class


class
`google.maps.addressValidation.Address`

library `"addressValidation"`

Details of the post-processed address. Post-processing includes correcting misspelled parts of the address, replacing incorrect parts, and inferring missing parts.

```javascript
const {Address} = await google.maps.importLibrary("addressValidation");
```

| ### Properties ||
|---|---|
| `components` readonly | **Type:** `Array<AddressComponent>` The individual address components of the formatted and corrected address, along with validation information. This provides information on the validation status of the individual components. |
| `formattedAddress` readonly | **Type:** `string optional` The post-processed address, formatted as a single-line address following the address-formatting rules of the region where the address is located. |
| `missingComponentTypes` readonly | **Type:** `Array<string>` The types of components that were expected to be present in a correctly formatted mailing address but were not found in the input AND could not be inferred. Components of this type are not present in `formatted_address`, `postal_address`, or `address_components`. An example might be `['street_number', 'route']` for an input like "Boulder, Colorado, 80301, USA". The list of possible types can be found [here](https://developers.google.com/maps/documentation/geocoding/requests-geocoding#Types). |
| `postalAddress` readonly | **Type:** `PostalAddress optional` The post-processed address represented as a postal address. |
| `unconfirmedComponentTypes` readonly | **Type:** `Array<string>` The types of the components that are present in the `address_components` but could not be confirmed to be correct. This field is provided for the sake of convenience: its contents are equivalent to iterating through the `address_components` to find the types of all the components where the `AddressComponent.confirmationLevel` is not `ConfirmationLevel.CONFIRMED` or the `AddressComponent.inferred` flag is not set to `true`. The list of possible types can be found [here](https://developers.google.com/maps/documentation/geocoding/requests-geocoding#Types). |
| `unresolvedTokens` readonly | **Type:** `Array<string>` Any tokens in the input that could not be resolved. This might be an input that was not recognized as a valid part of an address (for example in an input like "123235253253 Main St, San Francisco, CA, 94105", the unresolved tokens may look like `["123235253253"]` since that does not look like a valid street number. |

| ### Methods ||
|---|---|

## [AddressComponent](https://developers.google.com/maps/documentation/javascript/reference/address-validation.md.txt#AddressComponent)
class


class
`google.maps.addressValidation.AddressComponent`

library `"addressValidation"`

Represents a single component of an address (ex. street name, city).

```javascript
const {AddressComponent} = await google.maps.importLibrary("addressValidation");
```

| ### Properties ||
|---|---|
| `componentName` readonly | **Type:** `string optional` The component name text. For example, "5th Avenue" for a street name or "1253" for a street number, |
| `componentNameLanguageCode` readonly | **Type:** `string optional` The BCP-47 language code. This will not be present if the component name is not associated with a language, such as a street number. |
| `componentType` readonly | **Type:** `string optional` The type of the address component. See [Table 2: Additional types returned by the Places service](https://developers.google.com/places/web-service/supported_types#table2) for a list of possible types. |
| `confirmationLevel` readonly | **Type:** `ConfirmationLevel optional` Indicates the level of certainty that the component is correct. |
| `inferred` readonly | **Type:** `boolean` If true, this component was not part of the input, but was inferred for the address location. Including this component is recommended for a complete address. |
| `replaced` readonly | **Type:** `boolean` Indicates the name of the component was replaced with a completely different one. For example, replacing a wrong postal code being with one that is correct for the address. This is not a cosmetic change; the input component has been changed to a different one. |
| `spellCorrected` readonly | **Type:** `boolean` Indicates a correction to a misspelling in the component name. The API does not always flag changes from one spelling variant to another, such as "centre" to "center". |
| `unexpected` readonly | **Type:** `boolean` If true, this component is not expected to be present in a postal address for the given region. It has been retained only because it was part of the input. |

## [AddressMetadata](https://developers.google.com/maps/documentation/javascript/reference/address-validation.md.txt#AddressMetadata)
class


class
`google.maps.addressValidation.AddressMetadata`

library `"addressValidation"`

The metadata for the address. AddressMetadata is not guaranteed to be fully populated for every address sent to the Address Validation API.

```javascript
const {AddressMetadata} = await google.maps.importLibrary("addressValidation");
```

| ### Properties ||
|---|---|
| `business` readonly | **Type:** `boolean` |
| `poBox` readonly | **Type:** `boolean` |
| `residential` readonly | **Type:** `boolean` |

| ### Methods ||
|---|---|

## [ConfirmationLevel](https://developers.google.com/maps/documentation/javascript/reference/address-validation.md.txt#ConfirmationLevel)
constants


constants
`google.maps.addressValidation.ConfirmationLevel`

library `"addressValidation"`

The different possible values indicating the level of certainty that the component is correct.

These constants are also usable as strings. In TypeScript, the string literals are defined by the `ConfirmationLevelString` type.

```javascript
const {ConfirmationLevel} = await google.maps.importLibrary("addressValidation");
```

| ### Constants ||
|---|---|
| `CONFIRMED` |   |
| `UNCONFIRMED_AND_SUSPICIOUS` |   |
| `UNCONFIRMED_BUT_PLAUSIBLE` |   |

## [Geocode](https://developers.google.com/maps/documentation/javascript/reference/address-validation.md.txt#Geocode)
class


class
`google.maps.addressValidation.Geocode`

library `"addressValidation"`

Contains information about the place the input was geocoded to.

```javascript
const {Geocode} = await google.maps.importLibrary("addressValidation");
```

| ### Properties ||
|---|---|
| `bounds` readonly | **Type:** `LatLngBounds optional` The bounds of the geocoded place. |
| `featureSizeMeters` readonly | **Type:** `number optional` The size of the geocoded place, in meters. This is another measure of the coarseness of the geocoded location, but in physical size rather than in semantic meaning. |
| `location` readonly | **Type:** `LatLngAltitude optional` The geocoded location of the input. |
| `placeId` readonly | **Type:** `string optional` The Place ID of the geocoded place. Using Place is preferred over using addresses, latitude/longitude coordinates, or plus codes. Using coordinates for routing or calculating driving directions will always result in the point being snapped to the road nearest to those coordinates. This may not be a road that will quickly or safely lead to the destination and may not be near an access point to the property. Additionally, when a location is reverse geocoded, there is no guarantee that the returned address will match the original. |
| `placeTypes` readonly | **Type:** `Array<string>` The type(s) of place that the input geocoded to. For example, `['locality', 'political']`. The full list of types can be found in the [Geocoding API documentation](https://developers.google.com/maps/documentation/geocoding/requests-geocoding#Types). |
| `plusCode` readonly | **Type:** `PlusCode optional` The plus code corresponding to the `location`. |

| ### Methods ||
|---|---|
| `fetchPlace` | `fetchPlace()` **Parameters:** None **Return Value:** None Returns a Place representation of this Geocode. To get full place details, a call to place.fetchFields() should be made. |

## [Granularity](https://developers.google.com/maps/documentation/javascript/reference/address-validation.md.txt#Granularity)
constants


constants
`google.maps.addressValidation.Granularity`

library `"addressValidation"`

The various granularities that an address or a geocode can have. When used to indicate granularity for an *address* , these values indicate with how fine a granularity the address identifies a mailing destination. For example, an address such as "123 Main Street, Redwood City, CA, 94061" identifies a `PREMISE` while something like "Redwood City, CA, 94061" identifies a `LOCALITY`. However, if we are unable to find a geocode for "123 Main Street" in Redwood City, the geocode returned might be of `LOCALITY` granularity even though the address is more granular.

These constants are also usable as strings. In TypeScript, the string literals are defined by the `GranularityString` type.

```javascript
const {Granularity} = await google.maps.importLibrary("addressValidation");
```

| ### Constants ||
|---|---|
| `BLOCK` | The address or geocode indicates a block. Only used in regions which have block-level addressing, such as Japan. |
| `OTHER` | All other granularities, which are bucketed together since they are not deliverable. |
| `PREMISE` | Building-level result. |
| `PREMISE_PROXIMITY` | A geocode that approximates the building-level location of the address. |
| `ROUTE` | The geocode or address is granular to route, such as a street, road, or highway. |
| `SUB_PREMISE` | Below-building level result, such as an apartment. |

## [PossibleNextAction](https://developers.google.com/maps/documentation/javascript/reference/address-validation.md.txt#PossibleNextAction)
constants


constants
`google.maps.addressValidation.PossibleNextAction`

library `"addressValidation"`

> [!WARNING]
> **Notice:** Available only in the [v=beta channel](https://developers.google.com/maps/documentation/javascript/versions.md.txt#choosing-the-beta-channel).

Offers an interpretive summary of the API response, intended to assist in determining a potential subsequent action to take. This field is derived from other fields in the API response and should not be considered as a guarantee of address accuracy or deliverability.

These constants are also usable as strings. In TypeScript, the string literals are defined by the `PossibleNextActionString` type.

```javascript
const {PossibleNextAction} = await google.maps.importLibrary("addressValidation");
```

| ### Constants ||
|---|---|
| `ACCEPT` | The API response does not contain signals that warrant one of the other PossibleNextAction values. You might consider using the post-processed address without further prompting your customer, though this does not guarantee the address is valid, and the address might still contain corrections. It is your responsibility to determine if and how to prompt your customer, depending on your own risk assessment. |
| `CONFIRM` | One or more fields of the API response indicate potential minor issues with the post-processed address, for example the `postal_code` address component was `replaced`. Prompting your customer to review the address could help improve the quality of the address. |
| `CONFIRM_ADD_SUBPREMISES` | The API response indicates the post-processed address might be missing a subpremises. Prompting your customer to review the address and consider adding a unit number could help improve the quality of the address. The post-processed address might also have other minor issues. Note: this enum value can only be returned for US addresses. |
| `FIX` | One or more fields of the API response indicate a potential issue with the post-processed address, for example the `verdict.validation_granularity` is `OTHER`. Prompting your customer to edit the address could help improve the quality of the address. |

## [USPSAddress](https://developers.google.com/maps/documentation/javascript/reference/address-validation.md.txt#USPSAddress)
class


class
`google.maps.addressValidation.USPSAddress`

library `"addressValidation"`

USPS representation of a US address.

```javascript
const {USPSAddress} = await google.maps.importLibrary("addressValidation");
```

| ### Properties ||
|---|---|
| `city` readonly | **Type:** `string optional` The city name. |
| `cityStateZipAddressLine` readonly | **Type:** `string optional` The address line containing the city, state, and zip code. |
| `firm` readonly | **Type:** `string optional` The name of the firm. |
| `firstAddressLine` readonly | **Type:** `string optional` The first line of the address. |
| `secondAddressLine` readonly | **Type:** `string optional` The second line of the address. |
| `state` readonly | **Type:** `string optional` The 2-letter state code. |
| `urbanization` readonly | **Type:** `string optional` The Puerto Rican urbanization name. |
| `zipCode` readonly | **Type:** `string optional` The Postal code, e.g. "10009". |
| `zipCodeExtension` readonly | **Type:** `string optional` The 4-digit postal code extension, e.g. "5023". |

| ### Methods ||
|---|---|

## [USPSData](https://developers.google.com/maps/documentation/javascript/reference/address-validation.md.txt#USPSData)
class


class
`google.maps.addressValidation.USPSData`

library `"addressValidation"`

The USPS data for the address. USPSData is not guaranteed to be fully populated for every US or PR address sent to the Address Validation API. It's recommended to integrate the backup address fields in the response if you utilize uspsData as the primary part of the response.

```javascript
const {USPSData} = await google.maps.importLibrary("addressValidation");
```

| ### Properties ||
|---|---|
| `abbreviatedCity` readonly | **Type:** `string optional` Abbreviated city. |
| `addressRecordType` readonly | **Type:** `string optional` Type of the address record that matches the input address. |
| `carrierRoute` readonly | **Type:** `string optional` The carrier route code. A four character code consisting of a one letter prefix and a three digit route designator. |
| `carrierRouteIndicator` readonly | **Type:** `string optional` Carrier route rate sort indicator. |
| `cassProcessed` readonly | **Type:** `boolean` Indicator that the request has been CASS processed. |
| `county` readonly | **Type:** `string optional` County name. |
| `deliveryPointCheckDigit` readonly | **Type:** `string optional` The delivery point check digit. This number is added to the end of the delivery_point_barcode for mechanically scanned mail. Adding all the digits of the delivery_point_barcode, delivery_point_check_digit, postal code, and ZIP+4 together should yield a number divisible by 10. |
| `deliveryPointCode` readonly | **Type:** `string optional` The 2-digit delivery point code. |
| `dpvCMRA` readonly | **Type:** `string optional` Indicates if the address is a CMRA (Commercial Mail Receiving Agency)--a private business receiving mail for clients. Returns a single character. |
| `dpvConfirmation` readonly | **Type:** `string optional` The possible values for DPV confirmation. Returns a single character or returns no value. |
| `dpvDoorNotAccessible` readonly | **Type:** `string optional` Flag indicates addresses where USPS cannot knock on a door to deliver mail. Returns a single character. |
| `dpvDrop` readonly | **Type:** `string optional` Flag indicates mail is delivered to a single receptable at a site. Returns a single character. |
| `dpvEnhancedDeliveryCode` readonly | **Type:** `string optional` Indicates that more than one DPV return code is valid for the address. Returns a single character. |
| `dpvFootnote` readonly | **Type:** `string optional` The footnotes from delivery point validation. Multiple footnotes may be strung together in the same string. |
| `dpvNonDeliveryDays` readonly | **Type:** `string optional` Flag indicates mail delivery is not performed every day of the week. Returns a single character. |
| `dpvNonDeliveryDaysValues` readonly | **Type:** `number optional` Integer identifying non-delivery days. It can be interrogated using bit flags: 0x40 -- Sunday is a non-delivery day 0x20 -- Monday is a non-delivery day 0x10 -- Tuesday is a non-delivery day 0x08 -- Wednesday is a non-delivery day 0x04 -- Thursday is a non-delivery day 0x02 -- Friday is a non-delivery day 0x01 -- Saturday is a non-delivery day |
| `dpvNoSecureLocation` readonly | **Type:** `string optional` Flag indicates door is accessible, but package will not be left due to security concerns. Returns a single character. |
| `dpvNoStat` readonly | **Type:** `string optional` Indicates whether the address is a no stat address or an active address. No stat addresses are ones which are not continuously occupied or addresses that the USPS does not service. Returns a single character. |
| `dpvNoStatReasonCode` readonly | **Type:** `number optional` Indicates the NoStat type. Returns a reason code as int. |
| `dpvPBSA` readonly | **Type:** `string optional` Indicates the address was matched to PBSA record. Returns a single character. |
| `dpvThrowback` readonly | **Type:** `string optional` Indicates that mail is not delivered to the street address. Returns a single character. |
| `dpvVacant` readonly | **Type:** `string optional` Indicates whether the address is vacant. Returns a single character. |
| `elotFlag` readonly | **Type:** `string optional` eLOT Ascending/Descending Flag (A/D). |
| `elotNumber` readonly | **Type:** `string optional` Enhanced Line of Travel (eLOT) number. |
| `errorMessage` readonly | **Type:** `string optional` Error message for USPS data retrieval. This is populated when USPS processing is suspended because of the detection of artificially created addresses. |
| `fipsCountyCode` readonly | **Type:** `string optional` FIPS county code. |
| `hasDefaultAddress` readonly | **Type:** `boolean` Indicator that a default address was found, but more specific addresses exist. |
| `hasNoEWSMatch` readonly | **Type:** `boolean` The delivery address is matchable, but the EWS file indicates that an exact match will be available soon. |
| `lacsLinkIndicator` readonly | **Type:** `string optional` LACSLink indicator. |
| `lacsLinkReturnCode` readonly | **Type:** `string optional` LACSLink return code. |
| `pmbDesignator` readonly | **Type:** `string optional` PMB (Private Mail Box) unit designator. |
| `pmbNumber` readonly | **Type:** `string optional` PMB (Private Mail Box) number. |
| `poBoxOnlyPostalCode` readonly | **Type:** `boolean` PO Box only postal code. |
| `postOfficeCity` readonly | **Type:** `string optional` Main post office city. |
| `postOfficeState` readonly | **Type:** `string optional` Main post office state. |
| `standardizedAddress` readonly | **Type:** `USPSAddress optional` USPS standardized address. |
| `suiteLinkFootnote` readonly | **Type:** `string optional` Footnotes from matching a street or highrise record to suite information. If business name match is found, the secondary number is returned. |

| ### Methods ||
|---|---|

## [Verdict](https://developers.google.com/maps/documentation/javascript/reference/address-validation.md.txt#Verdict)
class


class
`google.maps.addressValidation.Verdict`

library `"addressValidation"`

Represents the post-processed address for the supplied address.

```javascript
const {Verdict} = await google.maps.importLibrary("addressValidation");
```

| ### Properties ||
|---|---|
| `addressComplete` readonly | **Type:** `boolean` The address is considered complete if there are no unresolved tokens, no unexpected or missing address components. If unset, indicates that the value is `false`. See `Address.missingComponentTypes`, `Address.unresolvedTokens` or `AddressComponent.unexpected` fields for more details. |
| `geocodeGranularity` readonly | **Type:** `Granularity optional` Information about the granularity of the `Geocode`. This can be understood as the semantic meaning of how coarse or fine the geocoded location is. |
| `hasInferredComponents` readonly | **Type:** `boolean` At least one address component was inferred (i.e. added) that wasn't in the input, see `AddressComponent` for details. |
| `hasReplacedComponents` readonly | **Type:** `boolean optional` At least one address component was replaced - see `AddressComponent` for details. |
| `hasUnconfirmedComponents` readonly | **Type:** `boolean` At least one address component cannot be categorized or validated, see `AddressComponent` for details. |
| `inputGranularity` readonly | **Type:** `Granularity optional` The granularity of the **input** address. This is the result of parsing the input address and does not give any validation signals. For validation signals, refer to `validationGranularity`. |
| `![Beta](data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M20.21,17.64l-6.15-8.22V5.57h2.57V3H6.35v2.57h2.57v3.86l-6.3,8.4c-0.44,0.6-0.5,1.41-0.15,2.08C2.8,20.58,3.49,21,4.24,21h14.5c1.11,0,2.01-0.9,2.01-2.01C20.75,18.48,20.53,18,20.21,17.64z' fill='%2301579b'/%3E%3C/svg%3E "Beta")possibleNextAction` readonly | > [!WARNING] > **Notice:** Available only in the [v=beta channel](https://developers.google.com/maps/documentation/javascript/versions.md.txt#choosing-the-beta-channel). **Type:** `PossibleNextAction optional` A possible next action to take based on other fields in the API response. See `PossibleNextAction` for details. |
| `validationGranularity` readonly | **Type:** `Granularity optional` The granularity level that the API can fully **validate** the address to. For example, a `validationGranularity` of `PREMISE` indicates all address components at the level of `PREMISE` and broader can be validated. |