<p>The <a href="https://docs.pro.coinbase.com/#get-historic-rates" rel="nofollow noreferrer">coinbase API docs</a> say:</p>

<blockquote>
  <p>If data points are readily available, your response may contain as
  many as 300 candles and some of those candles may precede your
  declared start value.</p>
</blockquote>

<p>So it looks like you need to parse and remove the extra data if you don't need it.</p>

CC BY-SA 4.0
2018-11-09T19:37:31.180Z
2018-11-09T19:37:31.180Z
JBaczuk
<p>@jbaczuk possible but that would be very inefficient.</p>

<p>but i just noticed something. im in utc+1 so my <code>datetime.datetime.now()</code> produces timestamps that are in the future when looking from utc. </p>

<p>so when i set my timestamp back 1 hour i get correct requests
this was produced at 22:05 local time 
<a href="https://api.pro.coinbase.com/products/BTC-EUR/candles?granularity=60&amp;start=2018-11-09T20:05:54&amp;end=2018-11-09T21:05:54" rel="nofollow noreferrer">https://api.pro.coinbase.com/products/BTC-EUR/candles?granularity=60&amp;start=2018-11-09T20:05:54&amp;end=2018-11-09T21:05:54</a> and it should display correctly</p>

CC BY-SA 4.0
2018-11-09T21:12:46.587Z
2018-11-09T21:12:46.587Z
Sungod3k
<p>I trying to do some testing on historical coinbase data. Because I can only get 300 datapoints per request. Im looping the request and change the start and end paramter to got backwards. </p>

<p>My requests now look like this:
<a href="https://api.pro.coinbase.com/products/BTC-EUR/candles?granularity=60&amp;start=2018-11-09T17:11:08Z&amp;end=2018-11-09T18:11:08Z" rel="nofollow noreferrer">https://api.pro.coinbase.com/products/BTC-EUR/candles?granularity=60&amp;start=2018-11-09T17:11:08Z&amp;end=2018-11-09T18:11:08Z</a></p>

<p>AFAIK they are ISO 8601 formatted and the time difference between start and end is correct. </p>

<p>However, im getting not 60 points but 350, so the end date is ignored and the start date also changes whenever I reload the link. </p>

<p>Can someone shine some light on how to correctly do the request for 1 hour of data?</p>

<api><coinbase.com>
Start and end parameters in historical price data request are ignored
Sungod3k
# Start and end parameters in historical price data request are ignored

(Asked by: username_0 on 2018-11-09)

I trying to do some testing on historical coinbase data. Because I can only get 300 datapoints per request. Im looping the request and change the start and end paramter to got backwards.

My requests now look like this:
<https://api.pro.coinbase.com/products/BTC-EUR/candles?granularity=60&start=2018-11-09T17:11:08Z&end=2018-11-09T18:11:08Z>

AFAIK they are ISO 8601 formatted and the time difference between start and end is correct.

However, im getting not 60 points but 350, so the end date is ignored and the start date also changes whenever I reload the link.

Can someone shine some light on how to correctly do the request for 1 hour of data?

**Tags:** api, coinbase.com


---

## 2 answers

### Answer by username_1 on 2018-11-09. Score: 0

The [coinbase API docs](https://docs.pro.coinbase.com/#get-historic-rates) say:

> If data points are readily available, your response may contain as
> many as 300 candles and some of those candles may precede your
> declared start value.

So it looks like you need to parse and remove the extra data if you don't need it.


---

### Answer by username_0 on 2018-11-09. Score: 0

@jbaczuk possible but that would be very inefficient.

but i just noticed something. im in utc+1 so my `datetime.datetime.now()` produces timestamps that are in the future when looking from utc.

so when i set my timestamp back 1 hour i get correct requests
this was produced at 22:05 local time
<https://api.pro.coinbase.com/products/BTC-EUR/candles?granularity=60&start=2018-11-09T20:05:54&end=2018-11-09T21:05:54> and it should display correctly


---

