Hello and welcome back to our cryptocurrency project. In the previous article I had mentioned before that I want to use the
Before we go even further I just want to make two corrections here:
- It seems like we do not need the API key from CriptoCompare when we make the API call which is kind of confusing.
- The data from both calls are the same which means
module is indeed a wrapper of the CriptoCompare API. Previously I thought that data s not the daily data directly from the original CriptoCompare site but instead a weekly data. cryptocompy
Below are the two calls using both the wrapper and the original API (directly using the Requests module) and it seems like the returning data for both of them are the same.
import pandas as pd from cryptocompy import price import requests # cryptocompy module coin_data = price.get_current_price("BTC", ["EUR", "JPY", "USD"]) print(pd.DataFrame.from_records(coin_data)) print("") # direct API call r = requests.get("https://min-api.cryptocompare.com/data/price?fsym=BTC&tsyms=USD,JPY,EUR") print(r.json())
In the next chapter, we will first use