Query demographic data
In this tutorial, you find demographic information for a location by accessing the GeoEnrichment service. The GeoEnrichment service provides information such as population and household size about geographic areas that you define.
Prerequisites
You need an ArcGIS account to access the developer dashboard and create an API key.
Steps
Create a new pen
- If you are using the CDN libraries, to get started.
Get an API Key
To access location services, you need an API key or OAuth 2.0 access token. To learn how to create and scope your key, visit the Create an API key tutorial.
- Go to your dashboard to get an API key. The API key must be scoped to access the services used in this tutorial.
- In CodePen, update
api
to use your key.Key
Make the request
You can copy and paste the code below, following the steps to make a request to the GeoEnrichment service.
Reference the ArcGIS REST JS libraries either through CDN, ES Modules, or Node JS.
Set the
api
with the API key from your dashboard.Key Define the parameters needed for the request.
Call the Geoenrichment service and handle the results.
Result
The request will return the following :
What's next?
Learn how to use additional ArcGIS location services in these tutorials:
Edit feature data
Add, update, and delete data in a hosted feature layer.