Geocoding Batch

Batch Geocoding on the locations/address/batch resource allows you to retrieve longitude and latitude coordinates as well as address information for a set of addresses through a POST request. The request body contains the collection of addresses to geocode. The response returns a list of geocoded output locations in JSON format. If the geocoding service finds multiple results that match the address object, by default, the best match is returned. To receive multiple results set the optional GeoList property to true within the desired location object.

Request URL

POST https://pcmiler.alk.com/apis/rest/v1.0/Service.svc/locations/address/batch?dataset={dataset}

Request Body

The request body consists of a JSON formatted GeocodeRequestBody object. See details in Geocode Request.

Element Definition Required
Region When having access to the WW dataset setting the region helps distinguish between NA and the rest of the world. Possible values are the default of 0 (Unknown) with incrementing numerical values for AF, AS, EU, NA, OC, SA, and ME.
N
MaxResults Indicate the maximum number of results to be returned from a search. By default is null, which indicates that all results are wanted.
N
CitySearchFilter For filtering results with pure city searches when GeoList is true. Possible values are the default of 0 (CitiesWithZips), or 1 (CityCentersOnly).
N
Address An Address object. Gets or sets the address that needs to be geocoded. Usage: Address = new Address() { Zip = "08540" }.
Y
Address.CountryPostalFilter For restricting results in cases when a zip code might be in Mexico and the US. Possible values are the default of 0 (US), or 1 (Mexico) or 2 (Both).
N
Address.AbbreviationFormat For specifying the abbreviation format of the country in the State field when outside of NA. Possible values are default of 0 (FIPS), 1 (ISO2), 2 (ISO3), 3 (GENC2) and and 4 (GENC3).
See Lookup table in Glossary.
N
GeoList A Boolean value. Gets or sets a value indicating whether to return a single match for the geocoded result or multiple matches(if they exist). Usage: GeoList = true.
N

Sample JSON POST Body

{
   "Locations":[
      {
         "Address":{
            "StreetAddress":"1000 Herrontown Rd",
            "City":"Princeton",
            "State":"NJ",
            "Zip":"",
            "County":"",
            "Country":null,
            "SPLC":"",
            "CountryPostalFilter":0,
            "AbbreviationFormat":0,
            "CountryAbbreviation": "US"
         },
         "Region":4,
         "GeoList":false,
         "MaxResults":null,
         "CitySearchFilter":0
      },
      {
         "Address":{
            "StreetAddress":"457 N Harrison St",
            "City":"",
            "State":"",
            "Zip":"08540",
            "County":"",
            "Country":null,
            "SPLC":"",
            "CountryPostalFilter":0,
            "AbbreviationFormat":0
         },
         "Region":4,
         "GeoList":false,
         "MaxResults":null,
         "CitySearchFilter":0
      },
      {
         "Address":{
            "StreetAddress":"1 Independence Way",
            "City":"Princeton",
            "State":"",
            "Zip":"08540",
            "County":"",
            "Country":null,
            "SPLC":"",
            "CountryPostalFilter":0,
            "AbbreviationFormat":0
         },
         "Region":4,
         "GeoList":false,
         "MaxResults":null,
         "CitySearchFilter":0
      }
   ]
}
                

Sample Response

                    [
  {
    "Address": {
      "StreetAddress": "1000 Herrontown Road",
      "City": "Princeton",
      "State": "NJ",
      "Zip": "08540",
      "County": "Mercer",
      "Country": "United States",
      "SPLC": null,
      "CountryPostalFilter": 0,
      "AbbreviationFormat": 0
    },
    "Coords": {
      "Lat": "40.388440",
      "Lon": "-74.655071"
    },
    "Region": 4,
    "Label": "",
    "PlaceName": "",
    "TimeZone": "EST",
    "Errors": [],
    "SpeedLimitInfo": null,
    "ConfidenceLevel": "Exact",
    "DistanceFromRoad": null,
    "CrossStreet": null
  },
  {
    "Address": {
      "StreetAddress": "457 North Harrison Street",
      "City": "Princeton",
      "State": "NJ",
      "Zip": "08540",
      "County": "Mercer",
      "Country": "United States",
      "SPLC": null,
      "CountryPostalFilter": 0,
      "AbbreviationFormat": 0
    },
    "Coords": {
      "Lat": "40.367274",
      "Lon": "-74.655365"
    },
    "Region": 4,
    "Label": "",
    "PlaceName": "",
    "TimeZone": "EST",
    "Errors": [],
    "SpeedLimitInfo": null,
    "ConfidenceLevel": "Exact",
    "DistanceFromRoad": null,
    "CrossStreet": null
  },
  {
    "Address": {
      "StreetAddress": "1 Independence Way",
      "City": "Princeton",
      "State": "NJ",
      "Zip": "08540",
      "County": "Mercer",
      "Country": "United States",
      "SPLC": null,
      "CountryPostalFilter": 0,
      "AbbreviationFormat": 0
    },
    "Coords": {
      "Lat": "40.360399",
      "Lon": "-74.599270"
    },
    "Region": 4,
    "Label": "",
    "PlaceName": "",
    "TimeZone": "EST",
    "Errors": [],
    "SpeedLimitInfo": null,
    "ConfidenceLevel": "Exact",
    "DistanceFromRoad": null,
    "CrossStreet": null
  }
]