CoinMetricsClient.get_market_metrics

coinmetrics.api_client.CoinMetricsClient.get_market_metrics(
    markets,
    metrics,
    frequency=None,
    page_size=None,
    paging_from='start',
    start_time=None,
    end_time=None,
    start_inclusive=None,
    end_inclusive=None,
    timezone=None,
    limit_per_market=None,
    sort=None,
    ignore_forbidden_errors=None,
    ignore_unsupported_errors=None,
    format='json_stream',
)

Returns market metrics for specified markets, frequency and date range. For more information on market metrics, see: https://docs.coinmetrics.io/api/v4#operation/getTimeseriesMarketMetricsarrow-up-right

  • Parameters:

    • markets (listarrow-up-right (strarrow-up-right ) , strarrow-up-right) -- list of market ids. Market ids use the following naming convention: exchangeName-baseAsset-quoteAsset-spot for spot markets, exchangeName-futuresSymbol-future for futures markets, and exchangeName-optionsSymbol-option for options markets. e.g., 'coinbase-btc-usd-spot', 'bitmex-XBTUSD-future'

    • metrics (listarrow-up-right (strarrow-up-right ) , strarrow-up-right) -- list of metrics, i.e. 'liquidations_reported_future_buy_units_1d'. See market metrics catalog for a list of supported metrics: https://docs.coinmetrics.io/api/v4#operation/getCatalogMarketMetricsarrow-up-right

    • frequency (strarrow-up-right) -- frequency of the returned timeseries, e.g 15s, 1d, etc.

    • page_size (intarrow-up-right) -- number of items returned per page when calling the API. If the request times out, try using a smaller number.

    • paging_from (PagingFrom , strarrow-up-right) -- Defines where you want to start receiving items from, 'start' or 'end' of the timeseries.

    • start_time (datetime , date , strarrow-up-right) -- Start time of the timeseries (string or datetime). Datetime object may be timezone naive or aware. Multiple formats of ISO 8601 are supported: 2006-01-20T00:00:00Z, 2006-01-20T00:00:00.000Z, 2006-01-20T00:00:00.123456Z, 2006-01-20T00:00:00.123456789, 2006-01-20, 20060120

    • end_time (datetime , date , strarrow-up-right) -- End time of the timeseries (string or datetime). Datetime object may be timezone naive or aware. Multiple formats of ISO 8601 are supported: 2006-01-20T00:00:00Z, 2006-01-20T00:00:00.000Z, 2006-01-20T00:00:00.123456Z, 2006-01-20T00:00:00.123456789, 2006-01-20, 20060120

    • start_inclusive (boolarrow-up-right) -- Flag to define if start timestamp must be included in the timeseries if present. True by default.

    • end_inclusive (boolarrow-up-right) -- Flag to define if end timestamp must be included in the timeseries if present. True by default.

    • timezone (strarrow-up-right) -- timezone of the start/end times in db format for example: "America/Chicago". Default value is "UTC". For more details check out API documentation page.

    • limit_per_market (intarrow-up-right) -- How many entries per market the result should contain.

    • sort (strarrow-up-right) -- How results will be sorted. Metrics are sorted by (market, time) by default. If you want to sort 1d metrics by (time, market) you should choose time as value for the sort parameter. Sorting by time is useful if you request metrics for a set of markets.

    • ignore_forbidden_errors (boolarrow-up-right) -- Default: false. Ignore HTTP 403 Forbidden errors

    • ignore_unsupported_errors (boolarrow-up-right) -- Default: false. Ignore errors for unsupported assets, metrics or frequencies.

    • format (strarrow-up-right) -- Format of the response. Supported values are json, json_stream, csv. Default is json_stream. Setting format='json_stream' is generally more performant. page_size and paging_from is ignored when format='json_stream'.

Returns:

Last updated

Was this helpful?