The Address capture and validation capability is a Mobility services toolkit
that helps address a number of common problems with delivery addressing, such as
inaccurate address entry from consumers, undeliverable addresses, and the need
for adjustments to point-of-delivery locations.

These services include:

- [**Places API (New)**](https://developers.google.com/maps/documentation/places/web-service): Simplifies address entry for end users and provides information about points of interest that can be used for routing purposes.
- [**Address Validation API**](https://developers.google.com/maps/documentation/address-validation): Determines whether an address refers to a real deliverable place and provides additional address-level metadata.
- [**Geocoding API**](https://developers.google.com/maps/documentation/geocoding): Provides the latitude and longitude for a given address.

This document describes how to use these services.

## About address capture and validation

Accurate, detailed address information is critical for delivery operations
because it affects the quality of all downstream activities that depend on it.
Whether you get addresses through a user-facing application or from upstream
partners using an API, Google Mobility services can help you with this
step.

Whether you get addresses through a user-facing application or from upstream
partners using an API, Google Mobility services can help you with address
capture as follows:

- **Improve consumer experience:** Provide your users with the tools to
  ensure they can provide a correct address and that their packages
  get delivered to the right place.

- **Improve driver productivity:** Reduce the time your drivers spend
  searching for delivery addresses and reduce the need for repeat delivery
  attempts.

### Capture the address

The Places API (New) contains the
[Autocomplete (New)](https://developers.google.com/maps/documentation/places/web-service/place-autocomplete.md.txt)
service. This service provides autocomplete capabilities for text-based
geographic searches by returning places, such as businesses, addresses and
points of interest, as the user enters an address.

For user-facing applications that involve obtaining a delivery address---such as
an online consumer or shipper site or an in-store employee portal---simplify
address entry and selection for your customers using
Autocomplete (New).

For example, suppose a user requests a package pickup and enters the pickup
location. Autocomplete (New) makes it possible for them to provide
an address by entering a few characters and selecting from a matching list.

The Places API (New) also provides ways to restrict search
results, so your developers can ensure that suggested addresses align with
locations that your business serves.

### Validate the address

After you capture an address, either from direct user input or using an API,
ensure that the customer provided a correct address. That means an address free
of inaccuracies, such as missing address components or typos. Address validation
helps to reduce delivery failures by catching bad addresses and improves
delivery predictability with better awareness of address details.

The
[Address Validation API](https://developers.google.com/maps/documentation/address-validation/overview.md.txt)
validates the address components, normalizes the address for mailing, and finds
the best known location for it. It can help understand if an address refers to a
real place. If the address does not refer to a real place, it can identify
possibly wrong components, enabling users to correct them.

If the Address Validation API determines that the address is
incorrect or refers to an undeliverable location, you can prompt the user to fix
it. If you obtain the address using an API call, you can reject the address.

### Allow confirmation of the address location

After a user has entered or selected an address, and you have validated the
address, use the Google Maps Platform to supply a map and a marker to indicate
the location of the address.

Use the
[Geocoding API](https://developers.google.com/maps/documentation/geocoding) to determine the
geographic coordinates of the address. In addition to the location, the
Geocoding API also returns address components, which you can use to
get missing address parts needed for necessary corrections. It also supplies the
location type, which indicates the precision of the coordinates retrieved from
the API.

The geocoded location can also be used for other purposes, such as assigning
the delivery to a driver in the optimal sequence. See
[Route Optimization](https://developers.google.com/maps/documentation/mobility/services/capabilities/route-optimization.md.txt)
for details.

> [!NOTE]
> **Note:** The Address Validation API also returns a geocode for an input address. For information comparing Geocoding API and Address Validation API, see [Address versus
> geocode](https://developers.google.com/maps/documentation/address-validation/requests-address).

## Use Google Mobility services for address capture

This section provides basic information on how to implement address capture and
validation. These steps assume you have set up a project in the Google API Console
and have the correct service accounts and billing enabled. For details specific
to Google Mobility services, see the [Fleet Engine
documentation](https://developers.google.com/maps/documentation/mobility/fleet-engine/essentials/set-up-fleet)
for setting up your project.

### Enable address entry capabilities

1. Enable [Places API (New)](https://developers.google.com/maps/documentation/places/web-service/cloud-setup) in the APIs and Services section of the Google API Console. Places API (New) includes the Autocomplete (New) service.
2. Review the [Autocomplete (New)](https://developers.google.com/maps/documentation/places/web-service/place-autocomplete.md.txt) documentation for additional features you can use, such as the [Optional Parameters](https://developers.google.com/maps/documentation/places/web-service/place-autocomplete.md.txt#optional-parameters) section. For example:
   - The components parameter limits output to certain countries.
   - The types parameter restricts results to certain location types, such as addresses and even allowable input languages from the user.
3. For streamlined deployment of an address form, Google Maps Platform offers a [Quick Builder](https://console.cloud.google.com/google/maps-apis/build/address-selection) within the Google API Console.

### Validate the delivery address

1. Enable the [Address Validation API](https://developers.google.com/maps/documentation/address-validation/cloud-setup) in the APIs and Services section of the Google API Console.
2. Review the [Address Validation API](https://developers.google.com/maps/documentation/address-validation/overview.md.txt) documentation to understand the various data you can use to evaluate the address quality and surface recommendations to users.

### Allow confirmation of pickup or delivery location

1. Build an interactive map for your users on your preferred platforms for mobile and web. For specifics, see the documentation for the [Maps JavaScript API](https://developers.google.com/maps/documentation/javascript/overview.md.txt) and navigate to other platform instructions from there.
2. Obtain the address geocode either from the [Address Validation API](https://developers.google.com/maps/documentation/address-validation/overview.md.txt) or by passing the Place ID from Autocomplete (New) to the [Geocoding API](https://developers.google.com/maps/documentation/javascript/geocoding.md.txt), and add a marker at the location.
3. To allow the user to adjust the delivery coordinates, make your markers draggable. See the documentation for marker behaviors ([Android](https://developers.google.com/maps/documentation/android-sdk#marker), [iOS](https://developers.google.com/maps/documentation/ios-sdk#marker), [Web](https://developers.google.com/maps/documentation/javascript/markers.md.txt#draggable)).
4. Retrieve the geocode of the adjusted marker position. You may also pass the updated geocode to the [reverse Geocoding API](https://developers.google.com/maps/documentation/geocoding/requests-reverse-geocoding) to retrieve the corresponding address. You can then evaluate address components and accuracy of the new position.

> [!NOTE]
> **Note:** See the terms of your Google Mobility services agreement for full details of how the content of the APIs may be used within your applications.

## Get additional context about the delivery addresses

Having detailed contextual data about delivery addresses is an essential next
step once an address has been determined. With this information, you can:

- **Improve driver productivity**: Ensure your drivers have all information to successfully and efficiently complete deliveries. When combined with other Google Mobility services capabilities, you can ensure drivers get to the right place at the right time.
- **Reduce cost**: Efficiently getting the driver to the right place and reducing repeat deliveries can also reduce labor cost and fuel costs for your fleet.
- **Scale your operations**: All address capture capabilities use Google's worldwide geospatial database, which provide granular coverage wherever you expand your business.

The Google Mobility services can be used to obtain a variety of
contextual data about addresses and locations. Once you have determined the
correct address, you may call any of the services described below to obtain the
relevant information. This information can be used as an input into your route
optimization systems or to provide additional context to drivers within your
driver application.

- Geocoding API attempts to match an input address to a location with the Google Maps database and provides the latitude/longitude.
- In addition to providing a variety of validation signals, Address Validation API also provides the latitude/longitude for the input address. It also provides residential and commercial flags for the location and a variety of data from USPS for US addresses.
- Place Details API provides information about points of interest, including business open hours.

## Recommended content

- [Address Validation API](https://developers.google.com/maps/documentation/address-validation)
- [Autocomplete (New)](https://developers.google.com/maps/documentation/places/web-service/place-autocomplete.md.txt)
- [Autocomplete (New) on YouTube](https://www.youtube.com/watch?v=cJjUALvnpCU&t=107s)
- [Geocoding API](https://developers.google.com/maps/documentation/geocoding)