CoinMarketCap API

This is a web page I developed in 2017 after cryptocurrencies gained a lot of traction and I got into day trading them. Before creating this, I used CoinMarketCap's own website to keep up with the prices of the various cryptocurrenices, but the website had some flaws that my website fixes; it automatically updates the prices every five seconds and only includes the currencies I'm personally interested in. The code for the website is generally simple as it's just a small project. In the image above, you can see the HTML code for the different panes in which the symbols and prices of the cryptocurrencies are visible. Each currency gets its own "block." Within the blocks, there are icons/symbols for each currency that are clickable and would take the user to the currencies page on CoinMarketCap for a more in-depth description along with charts and such. Each block also contains a <p> tag that has the string "Loading..." in it serving as a placeholder until the JavaScript function fetches the required information using the CoinMarketCap API, at which point the HTML DOM of the page is modified to display the aforementioned information. The image above displays the JavaScript portion of the website. Immediately, the function that fetches and updates the prices of the cryptocurrencies is set to run every five seconds. The function is then instantly and manually called by the code to ensure the user doesn't have to actually wait those five seconds when they visit the page. The actual function that is run is called "updateStats" and it uses jQuery's "get" method, which is a shorthand AJAX function which fetches the required information from six different URL's to CoinMarketCap's API. The information is in the form of a JSON array, which actually contains extra content that isn't relevant to the purpose of this website, so the script specifically focuses on the price of the six cryptocurrencies in USD. It then assigns a variable to each of the <p> elements from before and then modifies the innerHTML property of each element to accordingly set the price for each one, thereby replacing the "Loading..." placeholder. The image above depicts the finished product.