1. Choose a type of geocoding
The first step is to select the geocoding service URL endpoint and operation you need to use.
https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/<request>?<parameters>&f=json&token=<ACCESS_TOKEN>
Operation | Use case |
---|---|
Address geocoding | Geocode address text to a complete address. |
Autosuggest | Autocomplete addresses and places as you type. |
Reverse geocoding | Find the address to your nearest geographic location. Get the nearest address to your current location. |
Place geocoding | Search for places by category such as restaurants, gas stations, or schools. |
Batch geocoding | Convert 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.
Name | Description | Examples |
---|---|---|
address | The address or place name. Different formats are supported. | address=1600 Pennsylvania Ave N , address= |
out | The list of data fields to return. | out , out (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:
- Reference the service or import the relevant packages or modules.
- Set the address, location, or text.
- Set your access token.
APIs
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
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
Search for an address
Convert an address or place to a location with the geocoding service.
Reverse geocode
Get an address, business, or place from coordinates with the geocoding service.
Find place addresses
Find an address, business, or place with the geocoding service.
Display your location
Find and track your device location on a map.