# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3 (ipykernel)
#     language: python
#     name: python3
# ---

 """
 This is an instructional Jupyter notebook that demonstrates 
 how to download bitcoin price data from the CoinMetrics API. 

 Author: T. From Coding Always & Data Always. 
 Twitter: @Data_Always
 
 Last Modified: March 24, 2022
 """

# +
import numpy as np
import pandas as pd
from coinmetrics.api_client import CoinMetricsClient

client = CoinMetricsClient()
# -

btc_data = client.get_asset_metrics(
    assets=['btc'],
    metrics=['ReferenceRate'],
    start_time='2021-01-01T00:00:00Z',
    frequency='1d'
)
df = btc_data.to_dataframe()

df.tail()

StarcoderdataJupyterScriptsDedupFiltered