Get cryptocurrency price on your google sheets with Coinmarketcap API
Best Crypto Exchange 👉
Learn how to get cryptocurrency price on your google sheets with Coinmarketcap API.
In this video, I’m going to teach you how to get the cryptocurrency price from Coinmarketcap on Google sheets using Coinmarketcap API and google script.
Follow the below steps to get the crypto price on Google Sheets.
You need to sign up for Coinmarketcap API and get the free API key. Put that API key in request options(Copied from API documentation) that we need to pass in the Urlfetch method.
This UrlFetch method accepts two parameters- URL and request option.
In the URL parameter, you have to pass the server URL with the symbol of cryptocurrency that you want to fetch the latest price.
In the params parameter, you have to pass the request options.
once we send a request, we’ll get back HTTP response in return from Coinmarketcap API.
Then, convert the response to string using method getContextText.
The response we got from CoinmarketcapAPI is in JSON format.
We need to parse the JSON using method JSON.parse and get the latest price of the cryptocurrency.
Source code:
Want to make use of my Portfolio and price alert tracker? – Check out
********** Tutorial Playlists **********
Google apps script tutorial for beginners-
Automate internet explorer with VBA-
Autoit tutorials for beginners-
Selenium Webdriver tutorials for beginners –
****** Contact me ********
Blog:
FB page:
******* Books written by me ********
Autoit tutorials for beginners:
Excel VBA for beginners:
******* Productivity tool *********
My Favorite YouTube Tools ➜ and ➜
******* Gear Used To Shoot This Video ******
_Audio & Microphone
********Learning partner********
Video courses ➜
Don’t forget to subscribe!
💼 To Hire Me 👉
👉 Kite is a free AI-powered coding assistant that will help you code faster & smarter. It integrates seamlessly with all top editors and IDE. Kite gives you smart completions and documentation while you’re typing. I’ve been using Kite on VSCode for 6 months and I love it! Check out Kite 👉
Source link
Best Crypto Exchange for trading 👉 https://bit.ly/cryptoBestPlatform
Great video.thank you. how can i change it for btc pair? i tried convert currency
What happens if there are two currencies with the same symbol? I've trying to get the price using the id but I haven't been able to succeed. Help!
Oh wow o tu did not post the actual code somewhere? This is the best one I have seen so far
great tutorial bro, one question tho, google sheet isnt updating or re-freshing the current values unless i run the script. is there a way to automate so prices are updated asap?
thank youu man!!
Hi @Amarindaz, great video, but how can you call the function from the spreadsheet without having to go to the script editor and run the function?
By the way I'm trying to have the function call the price of all cryptocurrencies at once, so that we use only 1 free credit from Coinmarketcap and can extrapolate the prices of single altcoins (the ones that we need) in the spreadsheets. But I'm having difficulties doing this.
Do you have an idea? Probably the most efficient way for many people would be to have google sheets run automatically the function when we open the spreadsheet, and then recall from the function in single cells of the column B all the prices related to the crypto tickers (example BTC, ETH…) that we write in the column A.
So imagine you have in Column A:
BTC
ETH
BTT
….
And in column B you recall their prices with a function like
=recallPrice(A1) –> (Price for Bitcoin)
=recallPrice(A2) –> (Price for Ethereum)
=recallPrice(A3) –> (Price for Bittorrent)
….
All of this using the getCryptoPrice function only once for all cryptos, so that we use only 1 credit of the 333 free credits.
How would you implement this? I'm going crazy, I know it's possible but I'm not a programmer and I'm having an hard time.
I'm sure this would be really helpful for many other persons, it would be great if you could help.
Thanks!!!
Hi, thanks for awesome video. I'm almost there but I keep getting: "TypeError: Cannot read property 'quote' of undefined (line 26, file "Coinmarket API"). My JSON file looks exactly like your, so I can't figure out why I'm having that issue, any suggestions? Or could you update the video for 2021?? ;P
reminder that google sheets has a function called GOOGLEFINANCE that does this with =GOOGLEFINANCE("CURRENCY:BTCUSD")
Thank you mate!
thank you
What shoud I do to get the price in BRL instead of USD?
Thank You from all for the investor community !!!! Great video
How can I get it to show the amount in Euros?
"Should I sell my HEX.win? it 50x'd and I'm scared it will dump."
Hi Dear, Thanks for the video, i need help. I want to fetch and store coins rates into MySQL database. Can you make another video to fetch and update rates in MySQL on every page refresh?
I get an error "Request failed for https://pro-api.coinmarketcap.com returned code 400. Truncated server response ""status": { "…….. I know that code 400 means invalid value for id, but I am only asking for BTC price via the URL set "https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=BTC"
Thank you, could you pls make it another video for dynamic symbols on sheet2 to get the price update
Hi, can you create an excel sheet with cmc datafeed for me?
Request failed for https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=BTC returned code 401. Truncated server response: { "status": { "timestamp": "2019-06-12T04:04:25.150Z", "error_code": 401, "error_message": "API key missing.", … (use muteHttpExceptions option to examine full response). (line 22, file "Code")DetailsDismiss
Can someone help me with the above?
Hello at 6:40 in the video, you mention that you can make the getcryptoPrice dynamic by passing another currency symbol after the URL so that it calls that price. How would we do that?
Great video – thank you for sharing. It took me a while to understand that you actually filled in BTC in Sheet 2, A1 by hand LOL
I cant run the macro… I get the error message –> Cannot find method getSheetName(string). (line 3, file "Code")
I get this error – can anyone help?
Request failed for https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=BTC returned code 401. Truncated server response: { "status": { "timestamp": "2019-05-13T07:57:32.239Z", "error_code": 401, "error_message": "API key missing.", … (use muteHttpExceptions option to examine full response) (line 22, file "Code")DetailsDismiss
Hi very nice video, how can I make it dynamic, I didn't quite understand that part. I would like to add a lot more currencies, not just BTC. Please help me 🙂
hi mate, when i run the prog. it says Authorization required?