Skip to content

Data enrichment is the process of finding demographic data and local facts for locations around the world.

You can use the arcgis-rest-demographics package to access the ArcGIS GeoEnrichment service.

Steps
  1. Install and reference the arcgis-rest-demographics and arcgis-rest-request packages.
  2. Set an access token to authenticate the request.
  3. Define parameters to pass to the service.
  4. Call the service and handle the results.

Global data

You can access global data, also known as standard demographics, for 170 countries and regions. To get global data, you use data variables to find information about population, income, age, households, education, spending, jobs, marital status, and key facts.

Get global data

Learn how to return demographic information, such as total population, with the queryDemographicData method in ArcGIS REST JS.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14

import { ApiKeyManager } from "@esri/arcgis-rest-request";
import { queryDemographicData } from "@esri/arcgis-rest-demographics";

const accessToken = "YOUR_ACCESS_TOKEN";
const authentication = ApiKeyManager.fromKey(accessToken);

queryDemographicData({
  studyAreas: [{ geometry: { x: 0.1278, y: 51.5074 } }], // London
  dataCollections: ["KeyGlobalFacts"],
  authentication
}).then((response) => {
  console.log(JSON.stringify(response, null, 2));
});
Go to tutorial

Local data

You can use local data, also known as advanced demographics, to gain insight about specific countries, cities, or neighborhoods. Local data variables include information about housing, health, education, and more.

Get local data

Learn how to return market and purchasing trends with the queryDemographicData method in ArcGIS REST JS.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14

import { ApiKeyManager } from "@esri/arcgis-rest-request";
import { queryDemographicData } from "@esri/arcgis-rest-demographics";

const accessToken = "YOUR_ACCESS_TOKEN";
const authentication = ApiKeyManager.fromKey(accessToken);

queryDemographicData({
  studyAreas: [{ geometry: { x: -86.7679, y: 36.1745 } }], // Nashville, TN
  analysisVariables: ["PsychographicsShopping.MP28067A_B", "transportation.X7027_I", "entertainment.X9005_I"],
  authentication
}).then((response) => {
  console.log(JSON.stringify(response, null, 2));
});
Go to tutorial

More resources

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