Geocode addresses

geocode-address-example

Address text geocoded to a location with the geocoding service

What is address geocoding?

Address geocoding, also known as forward geocoding, is the process of converting text for an address to a complete address with a location. For example, you can convert 1 Bridge St, Sydney, Australia to 1 Bridge St, Sydney, New South Wales, 2000.

You can use address search to:

  • Geocode address text to a complete address.
  • Find the location of an address.
  • Provide a list of address candidates for an incomplete address.

How address geocoding works

You can geocode an address by making an HTTPS request to the geocoding service findAddressCandidates operation or by using client APIs. Specify the address, output data fields, and optionally, additional parameters to refine the search.

The more complete you can make the input address, the more likely the geocoding service will find an exact match. For example, "1600 Pennsylvania Ave NW, Washington, District of Columbia, 20500".

To refine the search, you can provide additional parameters such as the location, search extent, country code, city, and neighborhood.

The geocoding service parses the address and uses all of the parameters to return a set of address candidates. Each candidate contains a full address, location, attributes, and a score of how well it matched. By default the address, score, and location are returned, but to return all of the data fields available, you can set the outFields parameter to *****.

URL request

Use dark colors for code blocksCopy
1
https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?address={searchText}&outFields={fieldList}&f=json&token=<ACCESS_TOKEN>

Required parameters

NameDescriptionExamples
fThe format of the data returned.f=json f=pjson
tokenAn API key or OAuth 2.0 access token.token=<ACCESS_TOKEN>

Key parameters

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

Additional parameters: Refine the search by using parameters such as location, searchExtent, neighborhood, city, and countryCode. Use langCode to return results in a specific language.

Storage parameter

If you need to store or persist the geocoding service results in any way, you are required to use the forStorage parameter.

NameDescriptionExample
forStorageSpecifies whether the results of the operation will be persisted.forStorage=true

Code examples

Geocode an address

This example illustrates how to geocode address text. Most APIs provide a LocatorTask to access the service.

Steps

  1. Reference the geocoding service.

  2. Set the address.

  3. Set the token to your API key.

The response is a set of address candidates with a full address, location, and score.

Get suggestions for a string

Address text geocoded to a location.

APIs

ArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for .NETArcGIS Maps SDK for KotlinArcGIS Maps SDK for SwiftArcGIS Maps SDK for JavaArcGIS Maps SDK for QtArcGIS API for PythonArcGIS 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>'

Tutorials

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