Search

Geocoding, also known as address search, is the process of converting text for an address or place to a complete address with a location. You can use the geocoding package from ArcGIS REST JS to search for an address or a place, find candidate matches, and return complete addresses with a location by accessing the geocoding service.

With the service, you can build applications to:

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

To learn more, visit the Search in the Mapping APIs and location services guide.

How to access the geocoding service

To access the service with ArcGIS REST JS, you typically perform the following steps:

  1. Reference the appropriate package.
  2. Set the API key to authenticate the request.
  3. Define parameters to pass to the service.
  4. Call the service and handle the results.

Example

In this example, you use the geocode operation to convert the address text "1600 Pennsylvania Ave, 20500" into a location.

Use dark colors for code blocksCopy
         
1
2
3
4
5
6
7
8
9
import { ApiKeyManager } from "@esri/arcgis-rest-request";
import { geocode } from "@esri/arcgis-rest-geocoding";

geocode({
  address: "1600 Pennsylvania Ave",
  postal: 20500,
  countryCode: "USA",
  authentication: ApiKeyManager.fromKey("YOUR_API_KEY");
})

To learn more, go to the Search for an address tutorial.

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