API CryptoQuant using Python
Apr 26, 2021
มาดู API CryptoQuant
API Documents
เรียก 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()