Giter Club home page Giter Club logo

Comments (9)

x1i4b1x2 avatar x1i4b1x2 commented on June 23, 2024 1

Yes that's very sad, thank you.

from ccxt.

carlosmiei avatar carlosmiei commented on June 23, 2024

Hello @x1i4b1x2,
Which coinbase branch are you using and what's your ccxt version?

from ccxt.

x1i4b1x2 avatar x1i4b1x2 commented on June 23, 2024

It's latest version, and coinbaseexchange

from ccxt.

carlosmiei avatar carlosmiei commented on June 23, 2024

@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

from ccxt.

x1i4b1x2 avatar x1i4b1x2 commented on June 23, 2024

Yes, so there is nothing missing in the docs, it can only be done with Ids right?

from ccxt.

carlosmiei avatar carlosmiei commented on June 23, 2024

@x1i4b1x2 Yes as you can see here, since/until timestamps are not supported: https://docs.cdp.coinbase.com/exchange/reference/exchangerestapi_getproducttrades/

from ccxt.

x1i4b1x2 avatar x1i4b1x2 commented on June 23, 2024

That's very sad. Have you ever found a clever way to fetch in the past without having to guess the Ids?

from ccxt.

carlosmiei avatar carlosmiei commented on June 23, 2024

@x1i4b1x2 the ids are linear as you can see here, so you should be able to "guess" older ids

image

from ccxt.

carlosmiei avatar carlosmiei commented on June 23, 2024

Actually I just tested and does not seem to work, so disregard my suggestion pls

from ccxt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.