Post
Topic
Board Archival
Re: closed
by
ltcnim
on 31/01/2014, 10:25:25 UTC
i have a question regarding the public api:

is it maybe possible, that the result from trades.json are sent in the opposite order? I think it's pretty strange, that you always get the oldest orders first, and then you will need to resend that request like 100 times, always with the latest tid from the previous request. Or maybe add another parameter so you can choose the order (newest/oldest)?

bump

The behaviour is intentional. Previously we had returned all transactions within the last 7 days. With increasing transaction volume, these API calls were returning up to 1 MB per call, obviously not the most performant way. Therefore we changed it that you should provide the ID of the last transaction that you know and we return all transactions after that ID. To limit resource consumption we return only max. 1000 trades. Thus if there are more than 1000 trades between two of your API calls you will need to call the function repeatedly always with the last ID of each return. This is quite a common approach to withdrawing transaction data from sites that have large transactions.


yes, it's common if you are interested in the transaction history. but if you always just want the latest trades, it will produce a lot of overhead which will increase even more the more transactions are made. For example, if you only need the last 20 trades, you would need to generate some extra requests to the API, instead of just one with just a little response data. But it's of course your choice how to handle it. If you are ok with extra traffic and extra requests, I'm ok with it too ^^

Just a last question: on the API page a 1request/5s is stated. If I start my client for the first time, do I need to wait 5s between each request until I'm up to date with the transactions? I'm pretty sure there are a lot of transactions made in the last 7 days, so that would take quite some time...