API Keys

Understand the difference between User Keys and Query Keys
Your API Key can be found on: https://query.nansen.ai/users/me
The Nansen Query API offers support for authentication via API keys. There are two distinct types of API keys available:
  1. 1.
    User API Key: This key mirrors the permissions and access rights of the user it belongs to. You can locate this API key on the respective user's profile page. This key allows you to perform any action that the user would be able to do, thereby providing a broad level of access. The User's API key can be found by clicking on the "Profile" section from the left navigation and appears at the bottom. There is also a button to generate a new API key. After API key regeneration, the previous API key will become invalid. See sample screenshot below:
  2. 2.
    Query API Key: This key provides access exclusively to a specific query and the resulting data from that query. This key can be found on the individual query page. It offers a more limited scope of access, which is focused solely on the query it is associated with. The Query API key can be found by clicking on the three dot "kebab" menu at the top of a saved query and selecting "Show API Key".
    After clicking on the Show API Key. The API key for this specific query will appear, along with sample code for how to retrieve the data for this query via API.

Best Practices for API Key Management

Only User API Keys can initiate a query refresh! Both User and Query API Keys can be used to retrieve results.
To provide better security, we have provided an additional type, a Query API key, for use in retrieving results. The Query API key can be used in applications or shared notebooks to retrieve data without exposing all the access the Query write might have. This allows queries to be embedded in public facing applications.