
VBA Excel Script for fetching GRC prices
Hi there,
I was a bit bored today, so I wrote simple script helping me to calculate prices of Gridcoin in USD and PLN in Excel.
Basically I keep track cryptos I own and haven't sold yet. I tested this script in Excel 2016, I have no idea if this will work in Libre/Open Office. Data is fetched from CoinMarketCap from their HTTP API, making a HTTP GET request. By that I'm receiving a JSON string which is parsed by external VBA script, which is there on GitHub licenced on MIT. Then I'm just extracting data from the JSON (parsed object is an array of dictionaries, VBA indexes arrays from "1") and write them to designated cells.
If you want to change fetched crypto then change "gridcoin" in the CoinMarketCapUrl variable to any other crypto like dogecoin or steem (it might be case sensitive, didn't check that)
Feel free to use this script in your workseets.
Cheers!
Sub GetData()
Const CoinMarketCapUrl As String = "https://api.coinmarketcap.com/v1/ticker/gridcoin/?convert=PLN"
Dim request As Object
Dim result As String
Dim json As Object
Dim usd As String
Dim pln As String
Set request = CreateObject("MSXML2.XMLHTTP")
usd = " "
pln = " "
With request
.Open "GET", CoinMarketCapUrl, True
.Send
End With
result = request.ResponseText
Set json = JsonConverter.ParseJson(result)
usd = json(1)("price_usd")
pln = json(1)("price_pln")
Range("L2").Value = usd
Range("N2").Value = pln
End Sub
Leave VBA Excel Script for fetching GRC prices to:
Read more #gridcoin posts
Best Posts From Jarric
We have not curated any of jarric's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Jarric
- A short history of transplantation
- Laptop just blued itself - a case of blue HP Stream 13
- TEST
- Old linear PSU teardown
- An lightweight, easy to use JS animation library - Anime.js
- Chilling in space
- ASUS X555Q review
- LED 101 - our humble lighty friends
- VBA Excel Script for fetching GRC prices
- My wallet's difficulty keeps swinging from 1.3somethingish to 0. Is that normal?