Skip to content

Validate Address ​

The Validate Address endpoint validates a free-form address and returns an address object containing the address components, latitude and longitude coordinates, and a map URL.

NOTE

This endpoint supports US and Canadian addresses.

Endpoint POST ​

https://api.ttgtoolbox.com/v1/validate/address/

Request body ​

This endpoint uses the POST method and requires a JSON object as the request body.

Required parameters ​

The request body requires the following parameters.

addressstringrequired

Optional parameters ​

mapProviderstring

Use the optional mapProvider parameter to specify the map engine to use the for URL. Google Maps is the default map provider.

Map ProvidermapProvider value
Google Mapsgoogledefault
Bing Mapsbing
OpenStreetMapopenstreetmap

Example request body

json
{
  "address": "2127 Garland Dr, Muskegon, MI 49441"
}

Example request body with optional parameter

json
{
  "address": "2127 Garland Dr, Muskegon, MI 49441",
  "mapProvider": "openstreetmap"
}

Returns ​

A JSON object containing the validated address.


Response

json
{
  "valid": true,
  "address1": "2127 Garland Dr",
  "address2": "",
  "city": "Norton Shores",
  "region": "MI",
  "postalCode": "49441 4433",
  "country": "USA",
  "latitude": 43.186353986704,
  "longitude": -86.296750999194,
  "text": "2127 Garland Dr, Norton Shores, MI, 49441, USA",
  "mapUrl": "https://www.openstreetmap.org/?mlat=43.186353986704&mlon=-86.296750999194"
}