Get the API

The ArcGIS API for JavaScript is available to developers in several ways. The most common way is to use the CDN version. See below for more info and alternatives. Note: The code for the ArcGIS API for JavaScript cannot be modified.

CDN (hosted version)

The recommended approach for accessing the API is to use the hosted version. Reference the API from our CDN (content delivery network) and you are ready to get started.

<link rel="stylesheet" href="https://js.arcgis.com/4.9/esri/css/main.css">
<script src="https://js.arcgis.com/4.9/"></script>

Benefits to working with the hosted version of the API:

  • Delivered via a content delivery network (CDN). CDN's are a collection of geographically distributed web servers that deliver content efficiently.
  • The servers are load balanced and monitored 24/7.
  • No need to download and re-install the API when new versions are released. You just need to modify the script tag in your application to point to the new version.

Using npm for custom builds

Using npm (a JavaScript package manager) is another option for developers of the JavaScript API to generate custom builds of the ArcGIS API for JavaScript. Some advanced scenarios require the ability to create custom builds of the JavaScript API locally. Many developers are already using Node.js build tools such as webpack, Grunt, Gulp, or npm (see: npm-run-script, npm-scripts) for solving automation workflow issues such as continuous integration. In addition, some developers just want to have more control over their build environment. For more information see the npm or webpack topics in the jsapi-resources repo on GitHub, and read the Using npm for custom builds topic or Using webpack for custom builds.

A web server supporting HTTPS requires the web server to use a web server certificate. The web server hosting configuration for a custom build of the ArcGIS API for JavaScript will need the following MIME/type registration.

extensionMIME/typeDescription
.ttfapplication/octet-streamTrue Type Fonts
.wasmapplication/wasmWebAssembly
.woffapplication/font-woffWeb Open Font Format
.woff2application/font-woff2WOFF File Format 2.0
.wsvapplication/octet-streamSupports SceneView's stars visualization

Download

In some cases, you may need to use a locally hosted version of the JavaScript API, for example, if you are in a restricted network environment with no internet access. You can also download and install the SDK which includes the Guide, API reference, Sample Code, and documentation. The SDK available for download is a snapshot of the help from the release date of the ArcGIS API for JavaScript version 4.9 and will not include any sample updates, documentation fixes etc.

To download and install the ArcGIS API for JavaScript and SDK navigate to the ArcGIS API for JavaScript download page and log-in with your Esri global account.

Note: If you do not have access to the internet, contact Esri Customer Service to have a DVD mailed.