You can use the kline endpoint (Market Endpoints — binance-connector documentation) and query it with the startTime parameter. Take note of rate limits when doing this because there is a limit of 1000 responses for each query, so you probably will have to make multiple queries if you are trying to get data from 2017.
Alternatively you can go to https://data.binance.vision/ to download historical data which are made readily available.