Coinbase is a digital currency exchange headquartered in San Francisco, California. They broker exchanges of Bitcoin, Bitcoin Cash, Ethereum, Ethereum Classic, Litecoin, Tezos, and many others, with fiat currencies in approximately 32 countries, and bitcoin transactions and storage in 190 countries worldwide
- We are using fetch api to call the coinbase API url
- The cryptocurrencies array is defined already and the price of only these included in array will be shown, you can add more if you wish
- The API sends response with value of cryptocurrencies for 1 unit of the basecurrency mentioned for example, exchange price of BTC for 1 INR
- You can change the basecurency to USD or any other currency
- We have divided exchange price of cryptocurrency by 1 as it gives the value of cryptocurrency in baseCurrency
- Clone the folder
- Inside the folder open command line and run
- npm install
- node cryptoprice.js
You will see the cryptocurrency name and live price as output
code by Mohit Bhat