Create and manage an API key

An API key is used to access ready-to-use services, web maps, and web scenes hosted on the ArcGIS Platform.

Create a new API key

An API key is created for you when you sign up for an ArcGIS Developer account. If you already have an ArcGIS account, you can sign in to view this API key and create more API keys.

  1. From the developer dashboard, click Manage.

  2. Click + New API Key.

    • Assign a title and description and then click Create API key to save.

    Create new API key

  3. The API keys tab on your dashboard now shows the new API key, including its assigned services.

Set your API key

Your API key is scoped by default to include the ready-to-use services demonstrated in the tutorials. These tutorials provide scenarios to help you when building your own applications, including setting the API key.

  1. From your developer dashboard select and copy an API key.
  2. In your code, replace the string YOUR-API-KEY / ACCESS-TOKEN with the API key from your dashboard.
ArcGIS API for JavaScriptEsri LeafletMapBox GL JSOpenLayersArcGIS REST JSArcGIS Runtime SDK for .NETArcGIS Runtime SDK for AndroidArcGIS Runtime SDK for iOSArcGIS Runtime SDK for JavaArcGIS Runtime SDK for Qt (C++)ArcGIS Runtime SDK for Qt (QML)
      
1
2
3
4
5
6
require([
  "esri/config",
],(esriConfig)=> {
  // set a global API key for all requests
  esriConfig.apiKey= "ACCESS_TOKEN";
});

Manage your API key

You can edit the ready-to-use services configured to your API key, and, if you have an ArcGIS Developer account, configure its private content, items and referrer header(s), as well as monitor its usage and update its name, description, and other settings.

To configure an API key, select it from the list of API keys on the ArcGIS developer dashboard—API keys tile and then click Edit API Key. Click the eye icon to reveal the API key; click the copy icon to copy it.

API Keys tile

Services

API keys can be given permission to access different services. To configure your API key's service permissions from the ArcGIS developer dashboard—API keys tile:

  1. Select an API key from the list of keys and then click Edit API Key.

  2. On the Location services tile, click Configure services.

    Location services

  3. Click to check the service(s) you wish to add to or remove from this API key on the Configure services pop-up. Services available to add might depend upon your payment tier.

    Configure services

  4. Click Configure # service(s) to save your changes.

  5. To remove a service, click Ø next to the service on the Location services tile or repeat the previous steps, deselecting the service you wish to remove. You will be asked to confirm before removing a service.

Content and items

Only ArcGIS Developer accounts can use API keys to read private content. To add your private map or layer items to your API key on the ArcGIS developer dashboard—API keys tile:

  1. Select an API key from the list of keys and then click Edit API Key.

  2. On the Content and items tile, click + Add items.

    Content and items tile

  3. Search for a map or layer from the search menu. You can limit this search field by type (hosted feature layer, tile layer, web map, GeoJSON, or CSV) or search for all item types. You must have previously created content to locate and add using a Content and items search.

    Add items pop-up

  4. When you have located and selected map and layer item(s) to attach to your API key, click Add X Item(s) to save them and close the pop-up.

Referrers

To configure the HTTP referer header(s) you wish to attach to your API key from the ArcGIS developer dashboard—API keys tile:

  1. Select an API key from the list of keys and then click Edit API Key.

  2. On the Referrers tile, click + Add Referrer.

    Referrers tile

  3. Enter the Referrer header address (e.x. https://*.your-app.com) to use with this API key.

  4. Click Add Referrer Header to save it and close this pop-up.

  5. To remove a referrer, click Ø next to the referrer. You will be asked to confirm your deletion.

  6. To edit a referrer, click the pencil icon. Click Edit Referrer Header to save your changes.

Monitor usage

There are several ways to review and monitor API key usage:

  1. Review overall usage from your ArcGIS Developer dashboard Usage panel.
  2. On the API keys tab, select View usage for an API key from your API key list.
  3. Select an individual API key and then click its Usage tab.

Settings

To update an API key's name, tags, description, disable its protections, or to delete it from the system:

  1. Click the Settings tab.
  2. Assign a title, tags, and a description, and then click Save settings.
  3. Toggle the protection icon to enable or disable deletion. This setting prevents the API key from being deleted by other users or by yourself unless you return to this screen.
  4. Click Delete API Key to remove this API key. This invalidates it permanently from any application(s) attempting to use this key for authentication. You cannot delete your default API key.

Tutorials

Try setting your API key in these tutorials
More tutorials

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