How to build a geocoding app

1. Choose a type of geocoding

The first step is to select the geocoding service URL endpoint and operation you need to use.

Use dark colors for code blocksCopy
1
https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/<request>?<parameters>&f=json&token=<ACCESS_TOKEN>
OperationUse case
Address geocodingGeocode address text to a complete address.
AutosuggestAutocomplete addresses and places as you type.
Reverse geocodingFind the address to your nearest geographic location. Get the nearest address to your current location.
Place geocodingSearch for places by category such as restaurants, gas stations, or schools.
Batch geocodingConvert a number of addresses to complete addresses.

2. Define input parameters

The next step is to provide input such as an address, location, or text for the operation. The most common parameters are listed in the tables below.

NameDescriptionExamples
addressThe address or place name. Different formats are supported.address=1600 Pennsylvania Ave NW,DC , address=Washington,DC
outFieldsThe list of data fields to return.outFields=PlaceName,Addr_type , outFields=* (return all fields)

3. Make a request

The final step is to make a request to the geocoding service using an ArcGIS Maps SDK, scripting API, or open source library. In general, you:

  1. Reference the service or import the relevant packages or modules.
  2. Set the address, location, or text.
  3. Set your access token.

APIs

ArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for .NETArcGIS Maps SDK for KotlinArcGIS Maps SDK for JavaArcGIS Maps SDK for Qt (C++)ArcGIS Maps SDK for Qt (QML)ArcGIS API for PythonArcGIS Maps SDK for SwiftArcGIS REST JSEsri LeafletMapLibre GL JSOpenLayersCesiumJS
Expand
Use dark colors for code blocksCopy
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
      const geocodingServiceUrl = "https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer";

      const params = {
        address: {
          "address": "1600 Pennsylvania Ave NW, DC"
        }
      }

      locator.addressToLocations(geocodingServiceUrl, params).then((results) => {
        showResult(results);
      });

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
1
2
3
4
curl https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates \
-d 'f=pjson' \
-d 'address=1600 Pennsylvania Ave NW, DC' \
-d 'token=<ACCESS_TOKEN>'

Additional resources

Tutorials

Reverse geocode

Get an address, business, or place from coordinates with the geocoding service.


JavaScript Maps SDK  Esri Leaflet  MapLibre GL JS  OpenLayers  CesiumJS  REST API 

Find place addresses

Find an address, business, or place with the geocoding service.


Display your location

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