Historic market data from Bitfinex
I have posted an answer regarding the code in the stackoverflow question, but if you just want the raw (or sample) data for either BTC/ETH/LTC from Bitfinex or HitBtc, you can head over to my website at www.cryptodatasets.com.
All the data is free, and gets updated every day.