pyb78
pyb78

Reputation: 11

coinbase pro api - historic prices - invalid interval

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

Upvotes: 0

Views: 1478

Answers (1)

pyb78
pyb78

Reputation: 11

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

Upvotes: 1

Related Questions