Reverse geocoding

A point converted to the closest address using the geocoding service

What is reverse geocoding?

Reverse geocoding is the process of converting a point to an address or place. For example, you can convert -79.3871 longitude and 43.6426 latitude to "CN Tower, 301 Front St W, Toronto, Ontario, M5V, CAN".

You can use reverse geocoding to:

  • Get the nearest address to your current location.
  • Show an address or place name when you tap on a map.
  • Find the address for a geographic location.

How reverse geocoding works

You can find an address for a location by making an HTTPS request to the geocoding service reverseGeocode operation or by using client APIs. Specify the location and optionally, additional parameters to enhance the search.

To refine the search, you can specify a feature type to return a specific type of address such as only POIs or addresses. You can also specify whether to return a street address or rooftop location.

The geocoding service uses the location and all parameters to return a single address that is the closest match. This address contains a number of attributes such as the place name, full address, city, region, and location.

If there are no streets near the input location, then large areal features such as parks, universities, zoos, or airports may be returned.

URL request

 
1
https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode?<parameters>

Key parameters

NameDescriptionExample
locationThe location to search.location=-79.3871,43.6426 location={x: 103.876722, y: 1.3330736}

Additional parameters: Refine the search and enhance the return values by using parameters such as featureTypes, locationType, and returnIntersection. Use langCode to return results in a specific language.

Examples

Find an address near a location

This example finds the closest address to a point location when you click on the map.

  1. Reference the geocoding service.

  2. Set the location to a point.

  3. Set the API key.

The response is a street address or a place with an address nearest to the point location. To get the full address use LongLabel and PlaceName to get the name if a POI is returned. Most APIs provide a LocatorTask to access the service.

APIs

ArcGIS JS APIEsri LeafletMapBox GL JSOpenLayersArcGIS REST JSArcGIS .NET APIArcGIS Android APIArcGIS iOS APIArcGIS Java APIArcGIS Qt API (C++)ArcGIS Qt API (QML)ArcGIS Python API
                                                                                                                        
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
  <title>ArcGIS Developer Guide: Reverse geocoding</title>
      <!-- ArcGIS Mapping APIs and Location Services Developer Guide
      Learn more: https://developers.arcgis.com/documentation/mapping-apis-and-services/search/
      -->
  <style>
    html, body, #viewDiv {
      padding: 0;
      margin: 0;
      height: 100%;
      width: 100%;
  </style>

  <link rel="stylesheet" href="https://js.arcgis.com/4.19/esri/themes/light/main.css">
  <script src="https://js.arcgis.com/4.19/"></script>

  <script>
    require([
      "esri/config",
      "esri/Map",
      "esri/views/MapView",
      "esri/Graphic",
      "esri/tasks/Locator"
    ],(esriConfig, Map, MapView, Graphic, LocatorTask)=> {
      esriConfig.apiKey = "YOUR-API-KEY";
      const map = new Map({
        basemap: "osm-standard-relief", //Basemap layer service
      const view = new MapView({
        container: "viewDiv",
        map: map,
        center: [-79.3871, 43.6426], //???
        zoom: 10,
        constraints: {
          snapToZoom: false
      view.when(() => {
      view.on("click", (event) => {
      function reverseGeocode(pt) {
        const locatorTask = new LocatorTask({
          url: "https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer"
        });

        const params = {
          location: pt
        };

        locatorTask.locationToAddress(params).then(
          (response) => {
            if (response) {
              showPopup(response);
            }
          },
          (err) => {
            showPopup("No address found.", pt);
          }
        );
      //Information shown when map is clicked
      function showPopup(response) {
          title: response.attributes.PlaceName || "Address",
          content:
            "<br><br>" +
            response.location.longitude.toFixed(5) +
            ", " +
            response.location.latitude.toFixed(5),
          location: response.location,
      function addGraphic(response) {
        if (!response.location) {
          return;
          new Graphic({
            symbol: {
              type: "simple-marker",
              outline: {
                color: "white",
                width: 1.5,
              color: "black",
              size: 6,
            geometry: response.location,
  </script>
</head>
<body>
  <div id="viewDiv"></div>
</body>
</html>

REST API

RequestResponse
    
1
2
3
4
curl https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode \
-d 'f=pjson' \
-d 'location=-79.3871,43.6426' \
-d 'token=<ACCESS-TOKEN>'

Response (JSON)

                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
  "address": {
    "Match_addr": "CN Tower",
    "LongLabel": "CN Tower, 301 Front St W, Toronto, Ontario, M5V, CAN",
    "ShortLabel": "CN Tower",
    "Addr_type": "POI",
    "Type": "Tourist Attraction",
    "PlaceName": "CN Tower",
    "AddNum": "301",
    "Address": "301 Front St W",
    "Block": "",
    "Sector": "",
    "Neighborhood": "Waterfront Communities-the Island",
    "District": "Toronto",
    "City": "Toronto",
    "MetroArea": "Greater Toronto Metro Area",
    "Subregion": "Toronto",
    "Region": "Ontario",
    "Territory": "",
    "Postal": "M5V",
    "PostalExt": "",
    "CountryCode": "CAN"
  },
  "location": {
    "x": -79.386480034479305,
    "y": 43.641820056696396,
    "spatialReference": {
      "wkid": 4326,
      "latestWkid": 4326
    }
  }
}

Tutorials

Services

Geocoding service

Search for addresses, businesses, and places around the world.

API support

GeocodingReverse GeocodingBatch GeocodingPlace/POI SearchAutosuggestUI Component
ArcGIS API for JavaScriptFully supportedFully supportedFully supportedFully supportedFully supportedFully supported
ArcGIS API for AndroidFully supportedFully supportedFully supportedFully supportedFully supportedNot supported
ArcGIS API for iOSFully supportedFully supportedFully supportedFully supportedFully supportedNot supported
ArcGIS API for JavaFully supportedFully supportedFully supportedFully supportedFully supportedNot supported
ArcGIS API for .NETFully supportedFully supportedFully supportedFully supportedFully supportedNot supported
ArcGIS API for QtFully supportedFully supportedFully supportedFully supportedFully supportedNot supported
ArcGIS API for PythonFully supportedFully supportedFully supportedFully supportedFully supportedNot supported
Esri LeafletFully supportedFully supportedAccess via ArcGIS REST JSFully supportedFully supportedFully supported
MapBox GL JSAccess via ArcGIS REST JSAccess via ArcGIS REST JSAccess via ArcGIS REST JSAccess via ArcGIS REST JSAccess via ArcGIS REST JSNot supported
OpenLayersAccess via ArcGIS REST JSAccess via ArcGIS REST JSAccess via ArcGIS REST JSAccess via ArcGIS REST JSAccess via ArcGIS REST JSNot supported
ArcGIS REST JSFully supportedFully supportedFully supportedFully supportedFully supportedNot supported
Full supportPartial support (see notes)Not supported

Tools

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.