0

I am trying to make an API call to retrieve historic BTC-USD prices with the coinbase pro API.

I am defining the specified parameters available: start(Start time in ISO 8601), end(End time in ISO 8601) and granularity(Desired timeslice in seconds).

I get however the message: "Invalid interval" for the below request:

https://api.pro.coinbase.com/products/BTC-USD/candles?start=2016-01-30T19:06:05+00:00&end=2016-02-06T19:06:05+00:00&granularity=86400

The dates are in ISO 8601 and I can not figure out why coinbase would not accept this interval.

Does anybody know why this is not accepted as a valid interval?

Thanks

pyb78
  • 11
  • 3
  • 1
    [URLs and plus signs](https://stackoverflow.com/questions/1005676/urls-and-plus-signs) – JJJ Sep 29 '18 at 09:07

1 Answers1

1

Thank you JJJ for the link.

I forgot to url encode the dates for the REST Api request.

Encoded, this works now: https://api.pro.coinbase.com/products/BTC-USD/candles?start=2016-01-30T19%3A06%3A05%2B00%3A00&end=2016-02-06T19%3A06%3A05%2B00%3A00&granularity=86400

pyb78
  • 11
  • 3