Geocode places

geocode-places

Place addresses for businesses by category near a point with the geocoding service

What is place geocoding?

Place geocoding is the process of searching for addresses for businesses, administrative locations, and geographic features. You can search for the name of a place and/or your can provide categories to filter the results. For example, you can use the text Mexican and the Food category to search for restaurant addresses.

You can use place search to:

  • Search for place addresses around the world (no search location provided).
  • Search for place addresses near or within a distance of a point.
  • Search for places by category such as restaurants, gas stations, or schools.
  • Find and display places on a map.

How place geocoding works

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

The more complete you can make the input place name, the more likely the geocoding service will find an exact match. For example, "Grand Canyon", "Disneyland in California", or "Starbucks at Newport Beach".

To refine the search or search for POI, you can specify a category such as coffee shop, restaurant, or gas station. See more categories in Category filtering. To refine it further, specify parameters such as the search extent, country code, and city.

The geocoding service parses the place name and uses the all of the parameters to return a set of place candidates. Most candidates contain a place name, full address, location, attributes, and a score of how well it matched.

There are two types of searches you can perform: Local and Global. A local search uses a location to search for places nearby or a search extent to confine the search area. A global search is an open search that typically isn't confined to an extent.

URL request

Use dark colors for code blocksCopy
1
https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?SingleLine={placeName}&location={longitude,latitude}&category={category}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

NameDescriptionExample
addressThe address or place name string. Different formats are supported.address=Disneyland address=Los Angeles Starbucks address=Seattle, Washington address=Mount Everest address=-117.155579,32.703761
locationUse to focus the search on a specific location.location=-117.196,34.056
categoryFilter places by place type values.category=food,mexican food category=coffee shop category=gas station
outFieldsA list of data fields to return.outFields=PlaceName,Place_addr, outFields=* (return all fields)

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

Code examples

Local search (by name)

This example uses the geocoding service to search for Starbucks near a location in San Francisco. You can use this type of search to find the location of businesses, points of interest, or landmarks. Most APIs provide a LocatorTask to access the service.

Steps

  1. Reference the geocoding service.

  2. Set the place name to search for.

  3. Set the location to search from.

  4. Set the list of data fields to return. e.g. PlaceName,Place_addr

  5. Set the API key.

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

Local search (name)

Geocoding service to search for Starbucks near a location in San Francisco.

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 QtArcGIS 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
      function findPlaces(pt) {
        const geocodingServiceUrl = "http://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer";

        const params = {
          address: {
            address: "Starbucks"
          },
          location: pt,  // San Francisco (-122.4194, 37.7749)
          outFields: ["PlaceName","Place_addr"]
        }

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

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
1
2
3
4
5
6
curl https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates \
-d 'f=pjson' \
-d 'address=Starbucks' \
-d 'location=-122.4194,37.7749' \
-d 'outfields=PlaceName,Place_addr' \
-d 'token=YOUR_API_KEY'

Local search (by category)

This example searches for gas stations near a location by setting the Gas Station category near a location in Paris.

To see a full list of categories, visit Category filtering.

Steps

  1. Reference the geocoding service.

  2. Set location to search from.

  3. Set the category of places to search for.

  4. Set the list of data fields to return. e.g. PlaceName,Place_addr

  5. Set the API key.

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

Local search (category)

Example search for gas stations near a location in Paris

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 QtArcGIS 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
      function findPlaces(pt) {
        const geocodingServiceUrl = "http://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer";

        const params = {
          categories: ["gas station"],
          location: pt,  // Paris (2.34602,48.85880)
          outFields: ["PlaceName","Place_addr"]
        }

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

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
1
2
3
4
5
6
curl https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates \
-d 'f=pjson' \
-d 'category=gas station' \
-d 'location=2.34602,48.85880' \
-d 'outfields=PlaceName,Place_addr' \
-d 'token=<ACCESS_TOKEN>'

This example executes a global search for Grand Canyon. No location or extent parameters are provided.

Steps

  1. Reference the geocoding service.

  2. Set the place name or address to search.

  3. Set the list of data fields to return.

  4. Set the API key.

The response is a set of candidates with an address, location, score, and many other attributes.

Local search (global)

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 QtArcGIS 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
108
      function findPlaces() {
        const geocodingServiceUrl = "http://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer";

        const params = {
          address: {
            address: "Grand Canyon"
          },
          outFields: "*"
        }

        locator.addressToLocations(geocodingServiceUrl,params).then((results)=> {
          showResults(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=grand canyon' \
-d 'token=<ACCESS_TOKEN>'

Tutorials

Find place addresses

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