Standard Address Verification and Autocomplete

Allows you to autocomplete, verify, and standardize US & Canada addresses in real-time. It also offers batch verification which allows you to do the same for thousands of addresses per second.

Integrating Autocomplete

We provide a pre-built web-based autocomplete integration in the Developers section of the dashboard. However, if you want to integrate autocomplete manually, here are our recommended steps:

  1. Use the GET /completions endpoint and supply partialStreet via the query params
    • This endpoint does not use any lookups
  2. Allow the user to select one of the autocompleted address previews
  3. Make a POST /completions?index=N request where N is the index of the address the user selected

If you follow these steps, there will only be 1 lookup made in total (when the user selects the address).

Response

The top-level JSON response has the following structure:

NameTypeDescription
statusstringEither success or error
messagestringDescribes the result of the request
dataobject or arrayThe response data.

Errors

This object is returned from the verification and autocomplete endpoint to describe issues or incomplete aspects of the given address that were either fixed (which the verification endpoint will always attempt to do) or caused verification failure.

NameTypeDescription
line1array of stringIssues related to the first line of the address
line2array of stringIssues related to the second line of the address
cityarray of stringIssues related to the city
provinceOrStatearray of stringIssues related to the province or state
genericarray of stringIssues with the address in general

Address Details

You can request additional address details when using the verification endpoints (both batch and single address) by supplying a query parameter includeDetails=true.

The details have the following schema:

NameTypeDescription
streetNamestring or nullName of the street where the address is located
streetTypestring or nullType of the street (DR, ST, BLVD, etc)
streetDirectionstring or nullThe direction of the street (N, S, E, W, etc)
streetNumberstring or nullStreet number (e.g. the 20 in 20 Bay St)
suiteIDstring or nullThe unit number/name
boxIDstring or nullPO Box ID
deliveryInstallationAreaNamestring or nullDelivery installation area name
deliveryInstallationTypestring or nullDelivery installation type
deliveryInstallationQualifierstring or nullDelivery installation qualifier
ruralRouteNumberstring or nullRural route number
ruralRouteTypestring or nullRural route type
extraInfostring or nullAny extra information relevant to the address
countystring or nullCounty in the United States (US address only)
countyNumstring or nullCounty number in the United States (US address only)
residentialboolean or nullIndicates that the address is residential (US address only)
vacantboolean or nullIndicates that the address is vacant according to the USPS (US address only)

Note that the details will be returned in a 'details' subobject and only the relevant fields for a given address will be returned. The fields that are empty will not.

Proper Case

You can have the verification and suggestion endpoints return addresses in Proper Case (e.g. 22-20 Bay St) by supplying a query parameter properCase=true.

Geocoding

All of our POST endpoints also provide geolocation information when geocode=true is provided as a query parameter. You can request this feature be enabled by emailing [email protected]. This includes our verification, batch verification, suggestions, and POST /completions endpoint. Note that you must supply country when geocoding to get the result successfully.

If the query parameter is supplied, the response will include a geocodeResult which has the following schema:

NameTypeDescription
locationObjectObject that contains lat, lng properties with number values
accuracynumberA real number from 0.00 to 1.00 which represents an accuracy score
accuracyTypestringA string representing the accuracy type

Accuracy Score

This real number value from 0.00 to 1.00 which represents our confidence in the geocodes. Generally speaking, scores larger than 0.8 are quite accurate. Anything below could be a rough match.

Accuracy Type

One of the following values:

  • rooftop indicating that the exact point was found
  • point indicating that the exact point was found within a range of addresses
  • range_interpolation indicating that we used interpolation to generate the result (still fairly accurate)
  • nearest_rooftop_match indicating we found a nearby rooftop point and used that
  • intersection indicating we found a street intersection at the point
  • street_center indicating we used the center of the closest street
  • place indicating that the point was a city/town/place
  • state indicating that the point was just a state

Verification

This is the data returned from the verification endpoints. The batch verification endpoint returns an array of these. Note that a verified status means that an address is deliverable as-is, corrected indicates we fixed it (errors will explain what we fixed), and failed means we were not able to fix it (errors might explain why).

NameTypeDescription
line1stringThe first line of the resulting address
line2string or nullThe second line of the resulting address
citystring or nullThe city of the resulting address
provinceOrStatestring or nullThe province or state of the resulting address
postalOrZipstring or nullThe Postal/ZIP code of the resulting address
zipPlus4string or null4-digit USPS ZIP+4 code
firmNamestring or nullUSPS Firm Name
countrystring or nullOne of 'ca' or 'us'
errorsErrorsThe address errors that were fixed or caused verification failure
statusstringEither 'verified', 'corrected' or 'failed'
detailsAddress Details or nullDetailed information about the address
geocodeResultGeocode ResultThe geocoding result, if geocode=true query was supplied

Completion Preview

This is the data returned from the GET completion endpoint (i.e. the preview endpoint). Each element of the returned array follows this schema.

NameTypeDescription
addressstringThe first line of the autocompleted address
citystringThe city of the autocompleted address
pcstringThe first 3 digits of the postal/ZIP code of the autocompleted address

Autocompleted Address

This is the data stored in the address field of the full completion response (see below).

NameTypeDescription
addressstringFirst line of the autocompleted address
citystringCity of the autocompleted address
provstringProvince or state of the autocompleted address
pcstringPostal/ZIP code of the autocompleted address
countrystringOne of 'CA' or 'US'

Completion

This is the data returned from the POST completions endpoint. Each element of the returned array follows this schema. If you supply an index query parameter to the completions endpoint, it returns an object instead of an array in data.

NameTypeDescription
addressAutocompleted AddressThe address
geocodeResultGeocode ResultThe geocoding result
errorsErrorsIssues with the address (e.g. user also needs to supply unit number)