What is an API key?
An API key is your unique code that allows you to view Nearmap content externally without having to provide your username and password as authentication.
You can manage API Keys using a simple user interface within the Integration, API Keys tab in MyAccount; an API call is not needed to create an API Key. You can configure an API Key so that it can only be used from a restricted set of IP addresses or applications. For more information, see Manage API Applications.
By design, you cannot use an API Key to log into the Nearmap MapBrowser and the MyAccount web portal. Use your Nearmap username and password to log into both MapBrowser and MyAccount. An API Key is valid until you delete it; you do not have to regularly refresh it.
API Key Authentication
API Key authentication allows you to consume Nearmap imagery in an application without having to provide your Nearmap username and password as authentication credentials. Instead you include an API Key – a unique long string associated with a particular user on your Nearmap account – and then include that API Key in all requests to Nearmap endpoints, typically by appending it to a URL. API Key authentication works for both desktop and custom web applications. If your application supports using map content via any of the supported Nearmap interfaces, including WMS and TMS, you should be able to integrate Nearmap imagery with minimal configuration using an API Key.
There are two key components to Nearmap API Key authentication:
- API Applications allow you to organize your Nearmap integrations, and to set different access restrictions for different integrations. You can have as many API Applications as you need on your Nearmap account. API Applications are automatically created for new users.
- Every user on a Nearmap account can create one API Key for each API Application on that account. Usage accrued by an integration that uses an API Key will be a recorded against the user who owns that API Key.
Creating an API key
As a MyAccount user or administrator, you can create your own API key so that you can use Nearmap imagery in other applications. When you do so, the in-built API Key authentication means you do not have to provide your Nearmap username and password as authentication credentials.
NOTE: You cannot create an API key if no API applications have been created. Nearmap administrators can create API applications in MyAccount.
Log in to MyAccount to create an API Key for a selected application.
- Log in to Nearmap at https://apps.nearmap.com/account.
- Click the Integrations, API Keys tab.
- Choose an application from the drop-down list. If there is no application in the drop-down list, or the API Application you want is not there, contact your organization's Nearmap administrator.
- Click CREATE KEY.
The API Key is now created – it is the long string of characters in the API Key column. You can use it in your integrations, as explained in How to Use an API Key in Nearmap Integrations.
NOTE: An API key is valid until you delete it. However, it may need to be refreshed periodically.