Address Validation (beta) Stay organized with collections Save and categorize content based on your preferences.
AddressValidationclass
google.maps.addressValidation.AddressValidationclass
Notice: Available only in thev=beta channel.
Static class for accessing the AddressValidation APIs.
Access by callingconst {AddressValidation} = await google.maps.importLibrary("addressValidation").
SeeLibraries in the Maps JavaScript API.
Static Methods | |
|---|---|
fetchAddressValidation | fetchAddressValidation(request)Parameters:
Return Value: Promise<AddressValidation>Validates an address. Seehttps://developers.google.com/maps/documentation/javascript/address-validation/validate-address. |
Properties | |
|---|---|
address | Type: AddressoptionalInformation about the address itself as opposed to the geocode. |
geocode | Type: GeocodeoptionalInformation about the location and place that the address geocoded to. |
metadata | Type: AddressMetadataoptionalOther information relevant to deliverability. metadata is not guaranteed to be fully populated for every address sent to the Address Validation API. |
responseId | Type: stringoptionalThe UUID that identifies this response. If the address needs to be re-validated, this UUIDmust accompany the new request. |
uspsData | Type: USPSDataoptionalExtra deliverability flags provided by USPS. Only provided in region US andPR. |
verdict | Type: VerdictoptionalOverall verdict flags |
Methods | |
|---|---|
toJSON | toJSON()Parameters: None Return Value: ObjectConverts the AddressValidation class to a JSON object with the same properties. |
AddressValidationRequestinterface
google.maps.addressValidation.AddressValidationRequestinterface
Notice: Available only in thev=beta channel.
Request interface forAddressValidation.fetchAddressValidation.
Properties | |
|---|---|
address | Type: PostalAddressLiteralThe address being validated. Unformatted addresses should be submitted via PostalAddress.addressLines. |
placeAutocompleteElementoptional | Type: PlaceAutocompleteElementoptionalIf using a PlaceAutocompleteElement, include it here to link the AddressValidation API calls with the autocomplete session token. |
previousResponseIdoptional | Type: stringoptionalThis 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. |
sessionTokenoptional | Type: AutocompleteSessionTokenoptionalA token which identifies an Autocomplete session for billing purposes. |
uspsCASSEnabledoptional | Type: booleanoptionalEnables USPS CASS compatible mode. This affectsonly the AddressValidation.uspsData field ofAddressValidation. Note: for USPS CASS enabled requests for addresses in Puerto Rico, aPostalAddress.regionCode of theaddress must be provided as "PR", or anPostalAddress.administrativeArea of theaddress must be provided as "Puerto Rico" (case-insensitive) or "PR". |
Addressclass
google.maps.addressValidation.Addressclass
Notice: Available only in thev=beta channel.
Details of the post-processed address. Post-processing includes correcting misspelled parts of the address, replacing incorrect parts, and inferring missing parts.
Access by callingconst {Address} = await google.maps.importLibrary("addressValidation").
SeeLibraries in the Maps JavaScript API.
Properties | |
|---|---|
components | 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 | Type: stringoptionalThe post-processed address, formatted as a single-line address following the address-formatting rules of the region where the address is located. |
missingComponentTypes | 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, oraddress_components. An example might be['street_number', 'route'] for an input like "Boulder, Colorado, 80301, USA". The list of possible types can be foundhere. |
postalAddress | Type: PostalAddressoptionalThe post-processed address represented as a postal address. |
unconfirmedComponentTypes | 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 theaddress_components to find the types of all the components where theAddressComponent.confirmationLevel is notConfirmationLevel.CONFIRMED or theAddressComponent.inferred flag is not set totrue. The list of possible types can be foundhere. |
unresolvedTokens | 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. |
AddressComponentclass
google.maps.addressValidation.AddressComponentclass
Notice: Available only in thev=beta channel.
Represents a single component of an address (ex. street name, city).
Access by callingconst {AddressComponent} = await google.maps.importLibrary("addressValidation").
SeeLibraries in the Maps JavaScript API.
Properties | |
|---|---|
componentName | Type: stringoptionalThe component name text. For example, "5th Avenue" for a street name or "1253" for a street number, |
componentNameLanguageCode | Type: stringoptionalThe 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 | Type: stringoptionalThe type of the address component. SeeTable 2: Additional types returned by the Places service for a list of possible types. |
confirmationLevel | Type: ConfirmationLeveloptionalIndicates the level of certainty that the component is correct. |
inferred | Type: booleanIf 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 | Type: booleanIndicates 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 | Type: booleanIndicates 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 | Type: booleanIf 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. |
AddressMetadataclass
google.maps.addressValidation.AddressMetadataclass
Notice: Available only in thev=beta channel.
The metadata for the address. AddressMetadata is not guaranteed to be fully populated for every address sent to the Address Validation API.
Access by callingconst {AddressMetadata} = await google.maps.importLibrary("addressValidation").
SeeLibraries in the Maps JavaScript API.
Properties | |
|---|---|
business | Type: boolean |
poBox | Type: boolean |
residential | Type: boolean |
ConfirmationLevelconstants
google.maps.addressValidation.ConfirmationLevelconstants
Notice: Available only in thev=beta channel.
The different possible values indicating the level of certainty that the component is correct.
Access by callingconst {ConfirmationLevel} = await google.maps.importLibrary("addressValidation").
SeeLibraries in the Maps JavaScript API.
Constants | |
|---|---|
CONFIRMED | |
UNCONFIRMED_AND_SUSPICIOUS | |
UNCONFIRMED_BUT_PLAUSIBLE | |
Geocodeclass
google.maps.addressValidation.Geocodeclass
Notice: Available only in thev=beta channel.
Contains information about the place the input was geocoded to.
Access by callingconst {Geocode} = await google.maps.importLibrary("addressValidation").
SeeLibraries in the Maps JavaScript API.
Properties | |
|---|---|
bounds | Type: LatLngBoundsoptionalThe bounds of the geocoded place. |
featureSizeMeters | Type: numberoptionalThe 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 | Type: LatLngAltitudeoptionalThe geocoded location of the input. |
placeId | Type: stringoptionalThe 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 | 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 theGeocoding API documentation. |
plusCode | Type: PlusCodeoptionalThe 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. |
Granularityconstants
google.maps.addressValidation.Granularityconstants
Notice: Available only in thev=beta channel.
The various granularities that an address or a geocode can have. When used to indicate granularity for anaddress, 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 aPREMISE while something like "Redwood City, CA, 94061" identifies aLOCALITY. However, if we are unable to find a geocode for "123 Main Street" in Redwood City, the geocode returned might be ofLOCALITY granularity even though the address is more granular.
Access by callingconst {Granularity} = await google.maps.importLibrary("addressValidation").
SeeLibraries in the Maps JavaScript API.
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. |
PossibleNextActionconstants
google.maps.addressValidation.PossibleNextActionconstants
Notice: Available only in thev=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.
Access by callingconst {PossibleNextAction} = await google.maps.importLibrary("addressValidation").
SeeLibraries in the Maps JavaScript API.
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 thepostal_code address component wasreplaced. 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 theverdict.validation_granularity isOTHER. Prompting your customer to edit the address could help improve the quality of the address. |
USPSAddressclass
google.maps.addressValidation.USPSAddressclass
Notice: Available only in thev=beta channel.
USPS representation of a US address.
Access by callingconst {USPSAddress} = await google.maps.importLibrary("addressValidation").
SeeLibraries in the Maps JavaScript API.
Properties | |
|---|---|
city | Type: stringoptionalThe city name. |
cityStateZipAddressLine | Type: stringoptionalThe address line containing the city, state, and zip code. |
firm | Type: stringoptionalThe name of the firm. |
firstAddressLine | Type: stringoptionalThe first line of the address. |
secondAddressLine | Type: stringoptionalThe second line of the address. |
state | Type: stringoptionalThe 2-letter state code. |
urbanization | Type: stringoptionalThe Puerto Rican urbanization name. |
zipCode | Type: stringoptionalThe Postal code, e.g. "10009". |
zipCodeExtension | Type: stringoptionalThe 4-digit postal code extension, e.g. "5023". |
USPSDataclass
google.maps.addressValidation.USPSDataclass
Notice: Available only in thev=beta channel.
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.
Access by callingconst {USPSData} = await google.maps.importLibrary("addressValidation").
SeeLibraries in the Maps JavaScript API.
Properties | |
|---|---|
abbreviatedCity | Type: stringoptionalAbbreviated city. |
addressRecordType | Type: stringoptionalType of the address record that matches the input address. |
carrierRoute | Type: stringoptionalThe carrier route code. A four character code consisting of a one letter prefix and a three digit route designator. |
carrierRouteIndicator | Type: stringoptionalCarrier route rate sort indicator. |
cassProcessed | Type: booleanIndicator that the request has been CASS processed. |
county | Type: stringoptionalCounty name. |
deliveryPointCheckDigit | Type: stringoptionalThe 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 | Type: stringoptionalThe 2-digit delivery point code. |
dpvCMRA | Type: stringoptionalIndicates if the address is a CMRA (Commercial Mail Receiving Agency)--a private business receiving mail for clients. Returns a single character. |
dpvConfirmation | Type: stringoptionalThe possible values for DPV confirmation. Returns a single character or returns no value. |
dpvDoorNotAccessible | Type: stringoptionalFlag indicates addresses where USPS cannot knock on a door to deliver mail. Returns a single character. |
dpvDrop | Type: stringoptionalFlag indicates mail is delivered to a single receptable at a site. Returns a single character. |
dpvEnhancedDeliveryCode | Type: stringoptionalIndicates that more than one DPV return code is valid for the address. Returns a single character. |
dpvFootnote | Type: stringoptionalThe footnotes from delivery point validation. Multiple footnotes may be strung together in the same string. |
dpvNonDeliveryDays | Type: stringoptionalFlag indicates mail delivery is not performed every day of the week. Returns a single character. |
dpvNonDeliveryDaysValues | Type: numberoptionalInteger 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 | Type: stringoptionalFlag indicates door is accessible, but package will not be left due to security concerns. Returns a single character. |
dpvNoStat | Type: stringoptionalIndicates 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 | Type: numberoptionalIndicates the NoStat type. Returns a reason code as int. |
dpvPBSA | Type: stringoptionalIndicates the address was matched to PBSA record. Returns a single character. |
dpvThrowback | Type: stringoptionalIndicates that mail is not delivered to the street address. Returns a single character. |
dpvVacant | Type: stringoptionalIndicates whether the address is vacant. Returns a single character. |
elotFlag | Type: stringoptionaleLOT Ascending/Descending Flag (A/D). |
elotNumber | Type: stringoptionalEnhanced Line of Travel (eLOT) number. |
errorMessage | Type: stringoptionalError message for USPS data retrieval. This is populated when USPS processing is suspended because of the detection of artificially created addresses. |
fipsCountyCode | Type: stringoptionalFIPS county code. |
hasDefaultAddress | Type: booleanIndicator that a default address was found, but more specific addresses exist. |
hasNoEWSMatch | Type: booleanThe delivery address is matchable, but the EWS file indicates that an exact match will be available soon. |
lacsLinkIndicator | Type: stringoptionalLACSLink indicator. |
lacsLinkReturnCode | Type: stringoptionalLACSLink return code. |
pmbDesignator | Type: stringoptionalPMB (Private Mail Box) unit designator. |
pmbNumber | Type: stringoptionalPMB (Private Mail Box) number. |
poBoxOnlyPostalCode | Type: booleanPO Box only postal code. |
postOfficeCity | Type: stringoptionalMain post office city. |
postOfficeState | Type: stringoptionalMain post office state. |
standardizedAddress | Type: USPSAddressoptionalUSPS standardized address. |
suiteLinkFootnote | Type: stringoptionalFootnotes from matching a street or highrise record to suite information. If business name match is found, the secondary number is returned. |
Verdictclass
google.maps.addressValidation.Verdictclass
Notice: Available only in thev=beta channel.
Represents the post-processed address for the supplied address.
Access by callingconst {Verdict} = await google.maps.importLibrary("addressValidation").
SeeLibraries in the Maps JavaScript API.
Properties | |
|---|---|
addressComplete | Type: booleanThe address is considered complete if there are no unresolved tokens, no unexpected or missing address components. If unset, indicates that the value is false. SeeAddress.missingComponentTypes,Address.unresolvedTokens orAddressComponent.unexpected fields for more details. |
geocodeGranularity | Type: GranularityoptionalInformation about the granularity of the Geocode. This can be understood as the semantic meaning of how coarse or fine the geocoded location is. |
hasInferredComponents | Type: booleanAt least one address component was inferred (i.e. added) that wasn't in the input, see AddressComponent for details. |
hasReplacedComponents | Type: booleanoptionalAt least one address component was replaced - see AddressComponent for details. |
hasUnconfirmedComponents | Type: booleanAt least one address component cannot be categorized or validated, see AddressComponent for details. |
inputGranularity | Type: GranularityoptionalThe granularity of theinput address. This is the result of parsing the input address and does not give any validation signals. For validation signals, refer to validationGranularity. |
possibleNextAction | Type: PossibleNextActionoptionalA possible next action to take based on other fields in the API response. See PossibleNextAction for details. |
validationGranularity | Type: GranularityoptionalThe granularity level that the API can fullyvalidate the address to. For example, a validationGranularity ofPREMISE indicates all address components at the level ofPREMISE and broader can be validated. |
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-11-21 UTC.