Geocoding APIs

Our Geocoding APIs support both geocoding and reverse geocoding.

  • Geocoding with the /locations resource allows you to find GPS coordinates as well as complete address information for a given street address.

  • Reverse geocoding with the /locations/reverse resource instead takes in a single pair of coordinates and returns the approximate address on which that point is located. With additional licensing, a road’s speed limit information can also be provided when reverse geocoding a location.

Batch Geocoding

If you are looking to geocode or reverse geocode a batch of addresses or GPS coordinates all at once, you can use our /locations/address/batch and /locations/reverse/batch resources.

Interactive Examples

The following pages include interactive examples where you can test our Location APIs after entering your API key in the YOUR API KEY HERE box.

Below you will find descriptions of the parameters shared among these APIs, as well as sample requests and responses.

Location Request Parameters

Data ElementDescriptionData TypeValue/Example
GeocodingstreetThe house number and street name in a single stringstring1 Independence Way
cityThe name of the city. Wildcard search is not supported for city field. The stringSearch field should be used for wildcard searches.stringPrinceton
stateThe two letter state (or country) abbreviationstringNJ
postcodeThe ZIP or Postal Codestring08540
countryThe country code using the format set by countryAbbrevType. (FIPS is the default format.)stringUK
langThe language to use in results.stringENUS - U.S. English(Default)
ENGB - Great Britain English
DE - German
FR - French
ES - Spanish
IT - Italian
searchStringAllows searching of [ZIP] [city,] [state][; street address] or [splc] all on one line. Individual street/city/state/postcode/splc fields will be ignored when this is used. If street address is supplied, it requires a ZIP and/or city and must be prefaced by a semicolon.

A location can also be entered in this field as a latitude/longitude point.

string08540 Princeton, NJ; 457 N Harrison St
or
08540
or
Princeton
or
36.093508,-86.058374
postcodeFilterThe postal code filter; use this to filter ZIP codes by countrystringUS to indicate US ZIP codes only
Em to indicate Mexican postal codes only
Both to indicate both
citySearchFilterThe city search filter; use this to filter pure city search. Overridden if address is provided.EnumSet to 0 to return cities and corresponding ZIPs (Default);
Set to 1 to return city centers only (no ZIPs).
splcThe Standard Point Location code to use in place of street/city/state/ZIPstring392832000
listThe number of matches to display if geocoding results in a less than perfect match.string4
Reverse GeocodingCoordsContains geographic coordinates used in reverse geocoding. The coordinates are represented by a comma separated pair of floating point numbers representing longitude and latitude, in that order. We recommend six digits after the decimal point for increased accuracy.Double Array-76.123456,42.123456
matchNamedRoadsOnlyWhen looking up coordinates, this forces reverse geocoding to match named roads onlyboolean
maxCleanupMilesWhen looking up coordinates, this sets a maximum radius, in miles, in which to find the closest matching roaddouble5.5
includePostedSpeedLimitFor users licensed for speed limit data, this parameter will include the posted speed limit in the response.boolean
headingSpeed limits may differ based on direction. This parameter is used with includePostedSpeedLimit to increase accuracy of getting the correct speed limit.double0 - North
90 - East
180 - South
270 - East
includeLinkInfoUnique road link identifiers are supplied when this is set to true.boolean
speedLimitPrefPreferred speed limit source.stringDefault
Premium (NA only)
Navteq (Outside NA)
LinkBased (NA only)
timestampThe time (UTC assumed if none specified) at the location which will be used to determine whether daylight savings time will be applied on the output time zone.string2008-05-01T07:34:42-5:00
or
2008-05-01 7:34 AM
Both
countryAbbrevTypeThe abbreviation format for countries.EnumFIPS(Default)
ISO2
ISO3
GENC2
GENC3
regionThe data region in which the address or coordinates lie.Enum0 - Unknown
1 - AF
2 - AS
3 - EU
4 - NA(Default)
5 - OC
6 - SA
7 - ME
datasetFor users licensed for multiple regional datasets.EnumPCM_EU
PCM_OC
PCM_SA
PCM_ME
PCM_AS
PCM_AF
PCM_WW(Worldwide)
PCM_GT(GeoTrack)
Current(Default)
PCM18-PCM33

Sample Geocode Request

https://pcmiler.alk.com/apis/rest/v1.0/Service.svc/locations?street=1600%20Pennsylvania%20Avenue%20Northwest&city=Washington&state=DC&postcode=20500&country=US

Sample Geocode Response

  {
      "Address": {
          "StreetAddress": "1600 Pennsylvania Avenue Northwest",
          "City": "Washington",
          "State": "DC",
          "Zip": "20500",
          "County": "District of Columbia",
          "Country": "United States",
          "SPLC": null,
          "CountryPostalFilter": 0,
          "AbbreviationFormat": 0,
          "StateName": "District of Columbia",
          "StateAbbreviation": "DC",
          "CountryAbbreviation": "US"
      },
      "Coords": {
          "Lat": "38.898730",
          "Lon": "-77.036679"
      },
      "Region": 4,
      "Label": "",
      "PlaceName": "",
      "TimeZone": "EDT",
      "Errors": [],
      "SpeedLimitInfo": null,
      "ConfidenceLevel": "Exact",
      "DistanceFromRoad": null,
      "CrossStreet": null
  }

Sample Reverse Geocode Request

https://pcmiler.alk.com/apis/rest/v1.0/Service.svc/locations/reverse?coords=-71.227186,46.813427&matchNamedRoadsOnly=true&maxCleanupMiles=5.5

Sample Reverse Geocode Response

{
    "Address": {
        "StreetAddress": "270 Rue Saint Joseph Est",
        "City": "Quebec",
        "State": "QC",
        "Zip": "G1K 3A9",
        "County": "",
        "Country": "Canada",
        "SPLC": null,
        "CountryPostalFilter": 0,
        "AbbreviationFormat": 0,
        "StateName": "Quebec",
        "StateAbbreviation": "QC",
        "CountryAbbreviation": "CA"
    },
    "Coords": {
        "Lat": "46.813427",
        "Lon": "-71.227186"
    },
    "Region": 4,
    "Label": "",
    "PlaceName": "",
    "TimeZone": "EDT",
    "Errors": [],
    "SpeedLimitInfo": null,
    "ConfidenceLevel": "Exact",
    "DistanceFromRoad": 0.003,
    "CrossStreet": null
}