Closed einarjohnson closed 5 months ago
There is no endpoint provides the earliest candle. I can suggest you to try with interval as 'M' (month), then pick the last record for your earliest candle reference.
https://api.bybit.com/v5/market/kline?cateory=linear&symbol=BTCUSDT&interval=M&limit=1000
that's a good idea @Kamsby , thank you kindly for the input.
Hello Pybit folks, I am working on a project where I store all the Kline data from Bybit in a persistance layer. We use the https://bybit-exchange.github.io/docs/v5/market/kline API to fetch this data. If there a way for me to figure out what the earliest candle is for a particular ticker so I can start fetching from that date up until the
datetime.now()
? Since the list returned is sorted in reverse bystartTime
i'm finding it a bit tricky to build a pipeline that fetches the whole history.PS: I am fetching the data asynchronously so knowing the earliest candle date upfront would be ideal so I can know which period chunks I should query for.