Coinmarket API
I built a thing which stores and displays digital currency market data
Note: this is a deprecated API and doesn’t work anymore but fear not, I’ve moved this general project into a new API and made it a WordPress plugin which you can check out here: https://github.com/haa-gg/Crypto-Price-WP-Plugin
Grab the OG repo and mess around with it here: https://github.com/haa-gg/Coin-Market-API-Example
More specifically, the goal is to create a script which talks to the Coin Market API (https://api.coinmarketcap.com/v1/ticker/), gets the relevant data for all 1000-something digital currencies out in the wild and puts the current values into a SQL database that I can reference later. The live feed was more of a bi-product that I got attached to.
The heavy lifting of this project was to set up a database, write a SQL command to input the relevant data from the API into the database, then set the command to run once a day by means of a cron job.
Here’s the code you need to make the live feed section work, all neat n’ tidy
index.php