Closed soaked-reflection closed 2 years ago
Yes, calculating the exact from
and to
is the way to retrieve historical data. I don't see any problem with your code snippet. The 504 Gateway should be one-time error, meaning the server cannot handle your requests in time for now, which you can retry at a later time(All non-2xx response will be raised as an ApiException
).
But we're moving towards archiving old data. Trading data long time ago now can be retrieved from here (you can also find the entrance from Developers
at the website's main page down below). For historical data, I advise you to try it. I think your requirements can be mostly satisfied from it.
Thanks, this exactly meets my needs
I want to download btc-usdt future 1h history data. Gate.io launched it since 2019-11-01. Until now it's around 2x365x12=8760 rows of data. Since gate-api does not allow get more than 2000 rows at a time. I have to find other ways. The function
list_futures_candlesticks(settle, contract, _from, to, limit, interval)
doesn't take from and limit at the same time, which makes the logic "download from 2019-11-01 for 2000 rows then set from to new and download anther 2000" couldn't work. Also you can't do it backwards, like get recent 2000 and get anther 2000 before. The only way seems to be calculating accurate from and toI tried this to download and store data in pandas DataFrame. It returned this error
Really need some help, please