How to Compare 200+ Cryptocurrencies with Open-Source CoinScraper Module

Jacob Tadesse
5 min readAug 22, 2020

Compare the top 200 supported assets on Kucoin’s decentralized exchange.

Photo by Eftakher Alam

Everyone knows that one person, or couple, or teenager, that made millions on Bitcoin. While bitcoin is still the most popular digital asset with the highest market cap, there have been several advancements in blockchain technology since the world was introduced to the distributed ledger.

I am a crypto enthusiast and have a few friends that try to keep up with the crypto market like the stock exchange; except the crypto markets are open 24/7, and there are thousands of projects on hundreds of exchanges. So the big question becomes, “How do we keep up with them all?”;

ENTERS: coinscraper

A bit dramatic, I know, but it’s a pretty big deal if you are an overbought/oversold kind-of-trader. Most traders use technical analysis to and their favorite indicators to make smart decisions in the market. This could range from moving averages or exponential moving average, depending on the trader. Some may prefer Moving Average Convergence Divergence (MACD) and others on-balance volume (OBV).

Everyone I know uses different tools and we all use some of the same tools as well, but this post is not about Bollinger Bands, Fibonacci Retracements, or Ichimoku Clouds. This post is about the coinscrapper, and while those tools are nice, you need the data before you can use any tool!

The coinscraper client was designed to compare the top 200 supported assets on Kucoin’s decentralized exchange. Each crypto asset’s historical and fundamental data is sourced from coinmarketcap.com. After all the data is collected, the data is preprocessed before calculating relative strength index. We end up with a summary table of the top 200 assets along with their relative strength.

The client has a few requirements/dependencies, please see requirements.txt file, or install the following:

import requests
import pandas as pd
import time
import random
import math
import numpy as np
from math import pi
import matplotlib.pyplot as plt
# %matplotlib inline
from os import mkdir
from os.path import exists

To install the client module, download the .py file and the demo notebook for Google Colab. You can download the files from the repo here.

Connecting to Client

Now that you have the client module installed, open the Demo notebook and run this cell. The demo will walk through some errors and show you how to fix them if they happen to you while running this client.

from coinscraper import coinscrapper
today = 'YYYYMMDD'
client = coinscrapper(today)

The client module will require a google authentication, and will also require a selenium web-driver. I would suggest running the client in Google Colab to test it out. If you are experiencing any errors, please make sure you have uploaded the files to your Colab Notebooks folder on Google Drive.

Feel free to change the file path or change any functionality.

Pulling Summary

The coinscraper client is filled with various methods, but the all purpose one is the .summary() method. This function was designed to process all the actions from getting the list of assets that are traded on KuCoin; creating links for historic data; converting html tables to dataframes; munging the data; generating a .csv file, and an html table with all the results.

client.summary()

Access Saved Datasets

Using the client we can also access the datasets saved during the summary process. The datasets are saved in a python list, and will contain historic data for each asset. The fundamental data and the RSI dataset are separte pythonic lists of datasets.

  1. client.technical_data
  2. client.fundamental_data
  3. client.rsi_data

Below is an example of how to access the saved datasets using the client.In [10]:

# Historic Price Data
list_of_historic_data = client.technical_data
print('Historic Price Data: ')
display(list_of_historic_data[0].head())
# Fundamental Data
list_of_fundamental_data = client.fundamental_data
print('\nFundamental Data: \n')
display(list_of_fundamental_data[0].set_index(0).stack())
# RSI Data
list_of_RSI_data = client.rsi_data
print('\nRSI Data: ')
display(list_of_RSI_data[0].tail())
Historic Price Data:DateOpen*HighLowClose**VolumeMarket Cap0Aug 20, 202091.25101.3191.25101.3115344164317903490141Aug 19, 202093.4794.4989.5591.2810936760116129313732Aug 18, 202093.3797.1592.0993.5211999836316524633993Aug 17, 202091.2294.6589.7993.368319201116495215074Aug 16, 202090.0791.3288.4191.22641774871611628957Fundamental Data:Monero Price 1 $93.81 USD
Monero ROI 1 3,693.27%
Market Rank 1 #16
Market Cap 1 $1,657,837,591 USD
24 Hour Volume 1 $176,797,734 USD
Circulating Supply 1 17,672,780 XMR
Total Supply 1 17,672,780 XMR
Max Supply 1 No Data
All Time High 1 $495.84 USD(Jan 07, 2018)
All Time Low 1 $0.212967 USD(Jan 14, 2015)
52 Week High / Low 1 $105.52 USD /$26.70 USD
90 Day High / Low 1 $105.52 USD /$60.43 USD
30 Day High / Low 1 $105.52 USD /$70.89 USD
7 Day High / Low 1 $105.52 USD /$88.41 USD
24 Hour High / Low 1 $105.52 USD /$92.60 USD
Yesterday's High / Low 1 $101.31 USD /$91.25 USD
Yesterday's Open / Close 1 $91.25 USD /$101.31 USD
Yesterday's Change 1 $10.06 USD (11.02%)
Yesterday's Volume 1 $153,441,643 USD
dtype: object
RSI Data:DateOpen*HighLowClose**VolumeMarket Capdate_RSIdate_ 2020–08–16Aug 16, 202090.0791.3288.4191.226417748716116289572020–08–1659.6750132020–08–17Aug 17, 202091.2294.6589.7993.368319201116495215072020–08–1762.4408222020–08–18Aug 18, 202093.3797.1592.0993.5211999836316524633992020–08–1862.6471052020–08–19Aug 19, 202093.4794.4989.5591.2810936760116129313732020–08–1957.8562802020–08–20Aug 20, 202091.25101.3191.25101.3115344164317903490142020–08–2069.210352

Access RSI Charts

Using the client we can access the RSI Charts saved during the summary process. The charts are saved in a python list, and also saved to your authenticated google drive. The plots are the matplotlib objects that just require the .show() method.

  1. client.plots
  2. client.candle_sticks (coming soon)

Below is an example of how to access the saved datasets using the client.In [24]:

import os

In [29]:

os.listdir('drive/My Drive/CoinScraper/charts/monero/')

Out[29]:

['RSI-20200820.png']

In [37]:

img = plt.imread("/content/drive/My Drive/CoinScraper/charts/monero/RSI-20200820.png")
plt.figure(figsize=(32,18))
plt.axis('off')
plt.imshow(img);

Access the Log File

Using the client we can also access the log file saved during the summary process. The log file is a text file that shows which processes are running, or errors that occur.

  1. client.log (Below is an example of how to access the log.)

[48] client.log

Here is the table html code generated for web:

<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th>Rank</th>
<th>Date</th>
<th>Name</th>
<th>Price</th>
<th>RSI</th>
<th>MarketCap</th>
<th>Volume</th>
<th>URL</th>
</tr>
</thead>
<tbody>
<tr>
<th>1</th>
<td>20200819</td>
<td>aurora</td>
<td>0.010758</td>
<td>42.187023</td>
<td>$69,623,976 USD</td>
<td>$11,064,328 USD</td>
<td><a href="https://coinmarketcap.com/currencies/aurora/historical-data/?start=20200501&amp;end=20200819">Source</a>
</td>
</tr>
<tr>
<th>2</th>
<td>20200819</td>
<td>eden</td>
<td>0.003194</td>
<td>61.808168</td>
<td>$1,882,449 USD</td>
<td>$98,028.04 USD</td>
<td><a href="https://coinmarketcap.com/currencies/eden/historical-data/?start=20200501&amp;end=20200819">Source</a>
</td>
</tr>
<tr>
<th>3</th>
<td>20200819</td>
<td>cargox</td>
<td>0.018720</td>
<td>56.580212</td>
<td>$2,988,006 USD</td>
<td>$25,556.41 USD</td>
<td><a href="https://coinmarketcap.com/currencies/cargox/historical-data/?start=20200501&amp;end=20200819">Source</a></td>
</tr>
<tr>
<th>4</th>
<td>20200819</td>
<td>plutusdefi</td>
<td>0.279615</td>
<td>51.926102</td>
<td>$5,840,360 USD</td>
<td>$4,307,851 USD</td>
<td><a href="https://coinmarketcap.com/currencies/plutusdefi/historical-data/?start=20200501&amp;end=20200819">Source</a>
</td>
</tr>
<tr>
<th>5</th>
<td>20200819</td>
<td>kyber-network</td>
<td>1.680000</td>
<td>51.799237</td>
<td>$314,437,445 USD</td>
<td>$69,980,556 USD</td>
<td><a href="https://coinmarketcap.com/currencies/kyber-network/historical-data/?start=20200501&amp;end=20200819">Source</a></td>
</tr>
<tr>
<th>6</th>
<td>20200819</td>
<td>waves-enterprise</td>
<td>0.113152</td>
<td>57.908557</td>
<td>$4,126,606 USD</td>
<td>$271,213 USD</td>
<td><a href="https://coinmarketcap.com/currencies/waves-enterprise/historical-data/?start=20200501&amp;end=20200819">Source</a></td>
</tr>
<tr>
<th>7</th>
<td>20200819</td>
<td>loom-network</td>
<td>0.035414</td>
<td>78.133532</td>
<td>$30,683,517 USD</td>
<td>$12,376,958 USD</td>
<td><a href="https://coinmarketcap.com/currencies/loom-network/historical-data/?start=20200501&amp;end=20200819">Source</a></td>
</tr>
<tr>
<th>8</th>
<td>20200819</td>
<td>aergo</td>
<td>0.066013</td>
<td>67.242300</td>
<td>$16,668,105 USD</td>
<td>$2,138,408 USD</td>
<td><a href="https://coinmarketcap.com/currencies/aergo/historical-data/?start=20200501&amp;end=20200819">Source</a></td>
</tr>
<tr>
<th>9</th>
<td>20200819</td>
<td>zcash</td>
<td>83.250000</td>
<td>53.969525</td>
<td>$767,711,155 USD</td>
<td>$474,251,401 USD</td>
<td><a href="https://coinmarketcap.com/currencies/zcash/historical-data/?start=20200501&amp;end=20200819">Source</a></td>
<tr>
<th>10</th>
<td>20200819</td>
<td>function-x</td>
<td>0.099583</td>
<td>54.561607</td>
<td>$22,469,847 USD</td>
<td>$489,996 USD</td>
<td><a href="https://coinmarketcap.com/currencies/function-x/historical-data/?start=20200501&amp;end=20200819">Source</a>
</tr></td>
</tr>
</tbody>
</table>

--

--