DATA

CM API

 

Community API

In addition to CSV files that can be downloaded from the downloads page, all Coinmetrics data is also available via API.

Our API URL is coinmetrics.io/api/v1/. The API returns JSON objects that contain fields named result in case of a successful call and fields named error otherwise.

If you’d like to propose a new method to be added to API or report a bug, please create a topic at our subreddit.

Node.js users may want to take advantage of NPM package made by CoinDesk.

Endpoints

  • get_supported_assets
  • get_available_data_types_for_asset
  • get_asset_data_for_time_range

get_supported_assets()

Returns list of assets that are supported by coinmetrics.io.
Request: https://coinmetrics.io/api/v1/get_supported_assets

get_available_data_types_for_asset (asset)

Returns list of data types available for specified asset.

Query parameters
asset string Asset ticker in lower case: btc, ltc, gno

Example: get available data types for CENNZ ERC20 token

Request: https://coinmetrics.io/api/v1/get_available_data_types_for_asset/cennz

Response: {"result":["activeaddresses", "exchangevolume(usd)", "marketcap(usd)", "mediantxvalue(usd)", "price(usd)", "txcount", "txvolume(usd)"]}

get_asset_data_for_time_range (asset,  data_type,  begin_timestamp,  end_timestamp)

Returns daily values of specified data type for specified asset on dates that belong to closed interval between begin_timestamp and end_timestamp.

Query parameters
asset string Asset ticker in lower case: btc, ltc, gno
data_type string

Data type, one of the following:

  • txcount
  • txvolume(usd)
  • adjustedtxvolume(usd)
  • paymentcount
  • activeaddresses
  • fees
  • medianfee
  • generatedcoins
  • averagedifficulty
  • mediantxvalue(usd)
  • blocksize
  • blockcount
  • price(usd)
  • marketcap(usd)
  • exchangevolume(usd)
begin_timestamp UNIX timestamp in seconds Start point of the date range
end_timestamp UNIX timestamp in seconds End point of the date range

This endpoint returns an array of pairs with date as the first member and the value as the second one.

Example: get median fee for Litecoin between 2018-01-01 and 2018-01-07

Request: https://coinmetrics.io/api/v1/get_asset_data_for_time_range/ltc/medianfee/1514764800/1515283200

Response: {"result":[[1514764800,0.001],[1514851200,0.0009925],[1514937600,0.00099959],[1515024000,0.00113039],[1515110400,0.00100501],[1515196800,0.00100705],[1515283200,0.00022776]]}