API key authentication is a type of authentication that uses long-lived access tokens embedded directly into an application to authenticate requests to access secure ArcGIS services and items. The access tokens are called API keys and managed through API key credentials.

API key authentication is the easiest type of authentication to use, but it is not sufficient to protect confidential information. It is recommended only if you are an ArcGIS developer working exclusively with public information and basic location services. If you are building applications that access private items or hosted data services that contain confidential or sensitive data, you should use a stronger authentication method provided by ArcGIS Online or ArcGIS Enterprise. These are user authentication and app authentication.

You can use API key authentication to:

  • Create public applications that do not require users to sign in.
  • Build applications that access location services and private items such as hosted layers and data services.
  • Create personal automation scripts that access the portal service and spatial analysis services.
  • Quickly and easily generate access tokens.
  • Embed an access token directly into apps that remains valid for up to 1 year.
  • Access secure resources with the privileges of your ArcGIS account.

How API key authentication works