How to correctly get lowest/highest price in last 3 days for a given symbol

Hello!

I am starting to develop my own app and I would like to get lowest/highest price in last 3 days for a given symbol. But I am not sure I am doing it right.

What I am doing is get the list of lists with https://api.binance.com/api/v1/klines?symbol=ETHEUR&interval=1d&limit=3

I will get a list with 3 sublists, one for each day. So for getting the lowest ETHEUR has been in the last 3 days, I will get 3 values
list[0][3]
list[1][3]
list[2][3]

Then from those 3 values, pick up the lowest.

For the highest it would be similar but :
list[0][2]
list[1][2]
list[2][2]

Am I doing it right?

The code would be like this:

def prices3days(symbol):
    candles = client.get_klines(symbol=symbol, interval='1d', limit=3)
    listmax = []
    listmin = []
    i=0
    for sublist in candles:
        listmax += [candles[i][2]]
        listmin += [candles[i][3]]
        i+= 1
    listmax.sort()
    listmin.sort()
    print(listmax[-1])
    print(listmin[0])

There is a ā€˜3dā€™ interval available from the kline endpoint. You can just query that and get the lowest/highest price from there.