I normally use the python-binance library, however, it is not up to date for a particular call I need to make.
I'm therefore attempting to use the standard requests.get
function as follows:
import requests
TakerRatio = requests.get('https://www.binance.com/futures/data/takerlongshortRatio','symbol=BTCUSDT&period=5m&limit=30')
TakerRatio = TakerRatio.text
This returns me all the data I need, however as one string:
[{"buySellRatio":"0.8314","sellVol":"418.6670","buyVol":"348.0720","timestamp":1591194900000},{"buySellRatio":"1.1938","sellVol":"284.8710","buyVol":"340.0660","timestamp":1591195200000},{"buySellRatio":"1.1901","sellVol":"377.4750","buyVol":"449.2250","timestamp":1591195500000}]
Could you guys help me with the simplest way to turn this string into an indexed list? I need to be able to reference the sellVol and buyVol values like you normally would, e.g. querying TakerRatio[0]['sellVol'] to return 418.6670.