Skip to content
Advertisement

How to extract all symbol and last_price from this json?

I tried like this, but it doesn’t work. It worked with an other json file (https://www.binance.com/fapi/v1/ticker/price) I think it’s because the beginning and end is different. There is some parts before the bracket and after.

I got the error: symbol = (pair[‘symbol’]) TypeError: string indices must be integers

JavaScript

Advertisement

Answer

e contains some other information. The data that you want is in e[‘result’]

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement