BTCMarkets / API

API
120 stars 30 forks source link

tickByTime market data #107

Closed stephenyao closed 6 years ago

stephenyao commented 6 years ago

I'm implementing an application that I would like to show the changes of price for the last 24 hours, as well as showing charts for the prices in the past. There doesn't seem to be an API documentation on how to do this but I realised that there is an endpoint in the form: https://btcmarkets.net/data/market/BTCMarkets/LTC/AUD/tickByTime?timeWindow=minute&since=1517106115577&_=1517192515410 that does return ticks from the past based on the specified time window.

What I wanted to ask is, is this endpoint okay for us developers to use to develop our own apps?

justin-ngin commented 6 years ago

Hi @stephenyao ,

We do not recommend using any endpoints starting with btcmarkets.net. They are not documented and intended solely for use by the website, and as such can change at any time without notice. For the moment, there is a v2 marketData endpoint deployed that will allow you to paginate through historical trades based on transaction id.

/v2/market/{instrument}/{currency}/trades?since={TxId}&indexForward=true For older records, set indexForward to false;

I will add a /v2/market/tick by utc with pagination to our development backlog for consideration. If you have some additional ideas, please feel free to reopen this issue and let me know! Otherwise, I'm closing this one for now.

Thanks & regards, Justin

stephenyao commented 6 years ago

Ok but that's filtered based on the trades since transactionId, not a timestamp. In that case we will have to know the trade that happened exactly 24 hours ago. I don't think the current API gives this info to be available. It would be good if you could add a candlestick endpoint where you give the API a time window and it would return the high, low, close, open and price array for that particular time window. Also, it would be a huge help if the daily change amount was returned in the tick endpoint

justin-ngin commented 6 years ago

I'll add the candlestick endpoint to the backlog for v2 consideration and adding %change to the tick is already on the backlog as well.

stephenyao commented 6 years ago

Thanks