Hello and welcome back to our cryptocurrency project. In the previous article I had mentioned before that I want to use the cryptocompy module to create our new cryptocurrency project, however, after a closer look at the CriptoCompare API I think we have better used the original API to make the rest call instead of using the wrapper module because the original API seems to provide more returned data type than the one offered by the cryptocompy module.

Before we go even further I just want to make two corrections here:

  1. It seems like we do not need the API key from CriptoCompare when we make the API call which is kind of confusing.
  2. The data from both calls are the same which means cryptocompy 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.

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"])


# direct API call
r = requests.get("https://min-api.cryptocompare.com/data/price?fsym=BTC&tsyms=USD,JPY,EUR")
Both calls returned the same data

In the next chapter, we will first use tkinter to create the user interface for our application, then we will write various API calls using the requests module to get different data set and show those outcomes on the display screen of our cryptocurrency application.

Please follow and like us:

Leave a Reply

Your email address will not be published. Required fields are marked *