Simon Tan
Musings of a curious developer ت
Cryptocurrency Exchange Bot
A telegram bot to retrieve market and volume data for cryptocurrencies.
Exchange bot

You know how everyone preaches that you need to start investing as young as possible? Well… I did just that but instead of buying traditional stocks, I bought cryptocurrencies instead.

An annoying problem that I faced whenever I wanted to buy any cryptocurrency was that I needed to find out which exchange (you can think of exchanges like stock markets e.g. NYSE, NASDAQ, LSE) the token was being sold on. This meant I had to first go onto CoinMarketCap (CMC) and click a few times in order to navigate to the page with the information I want.

After a while, I realised that I was spending too much time on this since the process is entirely manual and I was doing it multiple times a day so I did what any programmers would do, I automated it! Seeing as most cryptocurrency discussions took place on the messenging platform called telegram, I decided to make a telegram bot. Moreover, it comes with the added benefit that others can also use the bot to make their queries so it is like killing 2 birds with 1 stone!

I learnt Python back in university but have not used it since I graduated so I did a crash course to get me up to speed again with the syntax and particularities with using Python. A friend of mine recommended to use PythonTelegramBot because it abstracts away the complicated interactions with Telegram’s native APIs.

As I started building the bot, I encountered with another problem; while CMC had APIs, the free APIs did not have the information that I needed so I opted to scrap their UI for this information with the help of BeautifulSoup.

It worked for a while but because CMC kept changing their frontend code structure, it was starting to get infeasible to constantly update the bot with each change so after a few months of usage (and declining interests in cryptocurrencies), I decided not to longer maintain the bot anymore and have since archived the repo.

If you would like to use the bot, you can fork the repo here but it is very unlikely to work out of the box. You probably also want to first check CMC’s API to see if such information is now freely available.

Last modified on 22 August 2020