⚙️Authentication

How to retrieve the API access token associated with your account

Note: For security reasons, access tokens are set to expire after ONE HOUR. Make sure you're using a valid token when making queries!

Authentication for Nansen Query API is done via an access token. A token generated is valid for one hour and can only be used for that duration. After one hour, a new token will be generated and will have to be retrieved in order to authenticate access to Nansen Query API.

The access token can be retrieved via the following code using your Nansen login credentials.

curl -i -H "Accept: application/json" \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"email": "EMAIL", "password": "PASSWORD"}' \
    https://query.api.nansen.ai/auth

Upon a successful response, the following will be returned:

200 OK

{
    "token": "TOKEN",
    "uid": "UID"
}

The following error will be returned if the login credentials are incorrect, have expired, or do not have API access:

404 Not Found

{
    "message": "Not Found"
}

Last updated