user74447: I am drawing a chart using the data pulled from bitfinex.com via a simple API query. As the result, i will need to render a chart which is going to show the historical data of BTCUSD for the past two years. Docs are available right here: https://bitfinex.readme.io/v2/reference#rest-public-candles Everything works fine except the limit of the retrieved data.
This is my request: https://api.bitfinex.com/v2/candles/trade:1h:tBTCUSD/hist?start=1514764800000&sort=1
The result can be seen over here or you can copy the request to the browser: https://docs.google.com/document/d/1sG11Ro0X21_UFgUtdqrlitcCchoSh30NzGCgAe6M0u0/edit?usp=sharing
The problem is that I receive candles for only 5 days no matter what dates or parameters I use. I can get more candles if i add the limit parameter to the string. But still, I can not get more than 1100-1000 candles. I even get the 500 error from the server:
Server error: GET https://api.bitfinex.com/v2/candles/trade:1h:tBTCUSD/hist?limit=1100&start=1512086400000&end=1516233600000&sort=1 resulted in a 500 Internal Server Error response:\n ["error",10020,"limit: invalid"]. What should be the valid limit? There is no such information in the docs.
How can I get the desired amount of data for the two years period of time? I do not want to break my query down into smaller pieces and go step by step. It will look ugly.

user86067: My suggestion is to get data by fragments for example:

Jan 1 2017 - July 31 2017
Aug 1 2017 - Dec 31 2017

Then merge on your code

74447: <p>I am drawing a chart using the data pulled from bitfinex.com via a simple API query. As the result, i will need to render a chart which is going to show the historical data of BTCUSD for the past two years. Docs are available right here: <a href="https://bitfinex.readme.io/v2/reference#rest-public-candles" rel="nofollow noreferrer">https://bitfinex.readme.io/v2/reference#rest-public-candles</a> Everything works fine except the limit of the retrieved data.</p>

<p>This is my request: <a href="https://api.bitfinex.com/v2/candles/trade:1h:tBTCUSD/hist?start=1514764800000&amp;sort=1" rel="nofollow noreferrer">https://api.bitfinex.com/v2/candles/trade:1h:tBTCUSD/hist?start=1514764800000&amp;sort=1</a></p>

<p>The result can be seen over here or you can copy the request to the browser: <a href="https://docs.google.com/document/d/1sG11Ro0X21_UFgUtdqrlitcCchoSh30NzGCgAe6M0u0/edit?usp=sharing" rel="nofollow noreferrer">https://docs.google.com/document/d/1sG11Ro0X21_UFgUtdqrlitcCchoSh30NzGCgAe6M0u0/edit?usp=sharing</a></p>

<p>The problem is that I receive candles for only 5 days no matter what dates or parameters I use. I can get more candles if i add the limit parameter to the string. But still, I can not get more than 1100-1000 candles. I even get the 500 error from the server:</p>

<p>Server error: GET <a href="https://api.bitfinex.com/v2/candles/trade:1h:tBTCUSD/hist?limit=1100&amp;start=1512086400000&amp;end=1516233600000&amp;sort=1" rel="nofollow noreferrer">https://api.bitfinex.com/v2/candles/trade:1h:tBTCUSD/hist?limit=1100&amp;start=1512086400000&amp;end=1516233600000&amp;sort=1</a> resulted in a 500 Internal Server Error response:\n ["error",10020,"limit: invalid"]. What should be the valid limit? There is no such information in the docs.</p>

<p>How can I get the desired amount of data for the two years period of time? I do not want to break my query down into smaller pieces and go step by step. It will look ugly.</p>
 86067: <p>My suggestion is to get data by fragments for example:</p>

<ul>
<li>Jan 1 2017 - July 31 2017</li>
<li>Aug 1 2017 - Dec 31 2017</li>
</ul>

<p>Then merge on your code</p>
