-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Coinbase trades pagination cursor #22617
Comments
Hello @x1i4b1x2, |
It's latest version, and coinbaseexchange |
@x1i4b1x2 as you said the pagination can't be done using timestamps, but you can use the Ids, example: cache = []
trades = await exchange.fetch_trades('BTC/USDT')
cache += trades
first = trades[0]
cursor = first['id']
i = 0
max_calls = 10
while cursor:
i+=1
trades = await exchange.fetch_trades('BTC/USDT', params={'after': cursor})
if len(trades) == 0:
break
cache += trades
cursor = trades[0]['id']
print('number of trades fetched:', len(cache))
if i > max_calls:
break |
Yes, so there is nothing missing in the docs, it can only be done with Ids right? |
@x1i4b1x2 Yes as you can see here, |
That's very sad. Have you ever found a clever way to fetch in the past without having to guess the Ids? |
@x1i4b1x2 the ids are linear as you can see here, so you should be able to "guess" older ids |
Actually I just tested and does not seem to work, so disregard my suggestion pls |
Yes that's very sad, thank you. |
Operating System
No response
Programming Languages
No response
CCXT Version
No response
Description
How can you paginate trades on Coinbase with timestamps? It seems that they only use the trade id, but what if you want to fetch at some point in the past?
Is there a way to give something like a "since" parameter or the docs are correct and there is no way?
Code
The text was updated successfully, but these errors were encountered: