Search the Community
Showing results for tags 'btc'.
-
Hi Guys, I have been trying to write the API calls to Coinigy.com in AutoitScipt. I have managed to solve most of them put are having trouble with the ones that require parameters to be passed. The source to the API calls can be found here: http://docs.coinigy.apiary.io/#reference/market-data/market-data/data-{type:history} Example code from this site: curl --include \ --request POST \ --header "Content-Type: application/json" \ --header "X-API-KEY: " \ --header "X-API-SECRET: " \ --data-binary " { \"exchange_code\": \"GDAX\", \"exchange_market\": \"BTC/USD\", \"type\": \"history\" }" \ ' https://api.coinigy.com/api/v1/data ' This data one is really annoying me. I have the following so far: #include <Array.au3> #include <string.au3> #include <MsgBoxConstants.au3> #Region Coinigy Const Global $sCoinigyAPIUrl = "https://api.coinigy.com/api/v1/" #EndRegion Coinigy Const #Region keys Global Const $sCoinigyAPIKey = "" ; just removed my APIKey Global Const $sCoinigyAPISecret = "" ; just removed my APISecret #EndRegion keys $sResults = CoinigyQueryPrivate("data", "exchange_code=GDAX&exchange_market=BTC/USD&type=history") ; Trade history, asks and bids for any supported exchange/market ConsoleWrite("Market Data: " & $sResults & @CRLF & @CRLF) Func CoinigyQueryPrivate($sMethod, $sParameters) Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("POST", $sCoinigyAPIUrl & $sMethod, False) $oHTTP.SetRequestHeader("X-API-KEY", $sCoinigyAPIKey) $oHTTP.SetRequestHeader("X-API-SECRET", $sCoinigyAPISecret) ; $oHTTP.Send(Binary($sParameters)) ; tried this as well $oHTTP.Send($sParameters) Local $sReceived = $oHTTP.ResponseText Return $sReceived EndFunc ;==>CoinigyQueryPrivate If I do other queries that don't require Parameters they work perfectly. I am just totally stumped by the parameter passing queries. I have tried everything and I still can't get it to go. Would really appreciate some help. If you want to try for yourself live, Coinigy.com give a free 30 trial.... Please help... Thanks in advance.