API CryptoQuant using Python

มาดู API CryptoQuant

https://www.facebook.com/Trading4LivingbyTa/videos/261136065750381

API Documents

https://cryptoquant.com/docs

เรียก Funding Rate

import requests# access_token = ''headers = {'Authorization': 'Bearer ' + access_token}
url = "https://api.cryptoquant.com/v1/btc/market-data/funding-rates?window=day&from=20201001&exchange=all_exchange"
data = requests.get(url, headers=headers).json()
df = pd.DataFrame(data['result']['data'])
df

คำสั่ง Visualization ด้วย Matplotlib

import matplotlib.pyplot as plt
plt.style.use('ggplot')
plt.figure(figsize=(16,6))
plt.plot(df['date'], df['funding_rates'])
plt.show()

--

--