coinbase / coinbase-pro-node

DEPRECATED — The official Node.js library for Coinbase Pro
Apache License 2.0
844 stars 316 forks source link

Get historical data #336

Closed AdvaithD closed 6 years ago

AdvaithD commented 6 years ago

I'd like to get historical data for BTCUSD, ETHUSD etc

Whats the best way to get historical data(about 1y, 2yr) for the following pairs?

vansergen commented 6 years ago

There is a function for that. Check getProductHistoricRates. For example

publicClient.getProductHistoricRates(
  'BTC-USD',
  {
    granularity: 3600,
    start: '2017-09-19T18:22:05.068932Z',
    end: '2017-10-01T12:47:25.253Z'
  },
  callback
);
AdvaithD commented 6 years ago

Thanks