V2
Our application programming interface (API) makes it easy to query our data. Whether it be price or revenue data, all relevant metrics for valuing cryptoassets can be found under one uniformed interface.
The API supports REST calls, uses resource-oriented URLs and returns JSON-encoded responses. Users on the Token Terminal Pro plan can query the data freely with their designated API key, which can be found on their account page. The API key should be kept a secret, so make sure to not share it or store it in publicly accessible areas such as GitHub, client-side code, and so forth.

Authentication

Authentication to the API is performed via HTTP Token Auth. Provide your API key as the token auth value by using the Authorization header: -H "Authorization: Bearer 75af3af7-2f6f-306d-a640-8e0dc3cc518c"
All API requests must be made over HTTPS. Calls made over plain HTTP will fail.

Querying the API

Each endpoint shows the HTTP Method and the endpoint URL for querying data. All endpoints are read-only, meaning that only GET methods are supported. Path and Query parameters are shown under the Request section. The Response section of the endpoint shows a JSON-encoded example, containing the return fields associated with the response.

Migrating from V1 to V2:

The endpoints are called the same way as before. v2/projects returns the project_id which can be used as a Path parameter to the v2/projects/:project_id/metrics endpoint.
Query parameters of the v2/projects/:project_id/metrics::
  1. 1.
    Change interval to timestamp_granularity: clearer name for the same parameter.
  2. 2.
    Add since as a new parameter: the end user can control the number of days they want to filter from the response.
  3. 3.
    Remove data_granularity : this was a feature that was not in big use and thus has been deprecated.
Removed fields:
  1. 1.
    chain: this will be supported in a separate endpoint in the future
  2. 2.
    business_line: this will be supported in a separate endpoint in the future
  3. 3.
    component : this will be supported in a separate endpoint in the future
  4. 4.
    version : this will be supported in a separate endpoint in the future
Updated fields:
  1. 1.
    ps -> ps_fully_diluted and ps_circulating : the fully-diluted and circulating P/S ratio
  2. 2.
    pe -> pe_fully_diluted and pe_circulating : the fully-diluted and circulating P/E ratio
  3. 3.
    market_cap -> market_cap_fully_diluted and market_cap_circulating : the fully-diluted and circulating Market cap
  4. 4.
    vol_mc -> volmc_fully_diluted and volmc_circulating : the fully-diluted and circulating Volume-to-market cap ratio
  5. 5.
    revenue -> revenue_total : the total revenue, both to protocol and supply-side
  6. 6.
    datetime -> timestamp : timestamp of the historical metrics, either daily or monthly
New fields:
  1. 1.
    active_users: daily active interacting addresses of project's revenue-generating smart contracts
  2. 2.
    deposits: total assets supplied to the project's revenue-generating smart contracts
  3. 3.
    tokenholders : number of addresses with token balance greater than 0
  4. 4.
    token_incentives : USD value of the protocol’s governance tokens that have been distributed to users
  5. 5.
    treasury : USD value of the protocol’s funds held on-chain (including unallocated governance tokens)

Get all project ids

get
https://api.tokenterminal.com
/v2/projects

Get historical metrics for a project:

get
https://api.tokenterminal.com
/v2/projects/:project_id/metrics

Using the API with Google Sheets

We recommend taking a look at Paul Gambill's guide on importing JSON data from external sources with the caveat of using our fork of the script and the ImportJSONTokenAuth function.
  1. 1.
    Create a new Google Spreadsheet.
  2. 2.
    Click on Tools -> Script Editor.
  3. 3.
    Click Create script for Spreadsheet.
  4. 4.
    Delete the placeholder content and paste the whole code from this script.
  5. 5.
    Rename the script to ImportJSON.gs and click the save button.
  6. 6.
    Back in the spreadsheet, in a cell, you can type "=ImportJSONTokenAuth()" and begin filling out it’s parameters.
Example (use your own API key as the second argument):
1
=ImportJSONTokenAuth("https://api.tokenterminal.com/v2/projects/uniswap/metrics", "75af3af7-2f6f-306d-a640-8e0dc3cc518c")
Copied!