I'm trying to have MS Excel use a VBA macro to get my account information from Cryptsy and arrange it all in a bunch of nice, pretty tables.
I know there are probably more effective ways to go about this, but I just want to know how to do it. So, if you would like to tell me about all the "better ways," I will appreciate the suggestions. Or you can just see this as a Challenge in Programming. Whatever floats your boat, I guess.
That said....
I already have a macro that loops through BTCe's Public Tickers and changes colors based on cell values. I think BTCe's Tickers update often enough for this to be somewhat informative, even if it's not fast enough to be very useful (3 seconds for full loop before restart). I use it mostly to know when I need to jump on the site when it seems more activity is happening.
I also already have a macro that pulls Cryptsy's Public SingleMarket Orders and sets up those nice tables for me..... However, the problem is that Cryptsy's Public APIs only update every ~5 minutes.... but the Private API is live.
(Why Cryptsy? Just learning the in's and out's of day trading. Seemed like as good a place as any, especially as they don't yet trade in fiat currencies.)
Here's the basic VBA (for free) that I'm looking to transform from a "GET" to a "POST"........
Sub MarketInfo()
Dim XML: Set XML = CreateObject("MSXML2.XMLHTTP")
XML.Open "Get", "http://pubapi.cryptsy.com/api.php?method=singlemarketdata&marketid=3", False
XML.send
Dim Resp As String: Resp = XML.ResponseText
Dim SellPrc As Integer: SellPrc = InStr(1, Resp, "sellorders") + 23
Dim SellQty As Integer: SellQty = InStr(SellPrc, Resp, "quantity") - 3
Dim sPrice As String: sPrice = Mid(Resp, SellPrc, SellQty - SellPrc)
Sheets("Sheet1").Range("C2").Value = sPrice
Dim BuyPrc As Integer: BuyPrc = InStr(1, Resp, "buyorders") + 22
Dim BuyQty As Integer: BuyQty = InStr(BuyPrc, Resp, "quantity") - 3
Dim bPrice As String: bPrice = Mid(Resp, BuyPrc, BuyQty - BuyPrc)
Sheets("Sheet1").Range("D2").Value = bPrice
End Sub
What I need help with is inserting the nonce, API Keys, Headers, etc. in order to access my account in the URL line. Not interested in making trades via Excel, just wanting to look at my account's stats for bookkeeping reasons. I just can't seem to Google the answers anywhere (and Bing is even worse).
Here's a link for more information about Cryptsy's API protocols:
https://www.cryptsy.com/pages/apiShort question: What follows after "
https://www.cryptsy.com/api"?