An excerpt of the JSON im working with is as follows
[
{
"id":"BTC",
"price":"35304.56229035",
"rank":"1",
"high":"63501.99115825",
"1h":{
"volume":"2610791622.05",
"price_change":"638.71365167"
},
"1d":{
"volume":"52050713051.70",
"price_change":"2349.33767373"
},
"7d":{
"volume":"268063322430.16",
"price_change":"-2303.07101614"
},
"30d":{
"volume":"1921956719871.83",
"price_change":"-20838.42231522"
}
},
{
"id":"ETH",
"price":"2578.89223662",
"rank":"2",
"high":"4164.64375843",
"1h":{
"volume":"2347100948.96",
"price_change":"67.59162043"
},
"1d":{
"volume":"48374522445.23",
"price_change":"73.26837445"
},
"7d":{
"volume":"290159448480.69",
"price_change":"-131.05022133"
},
"30d":{
"volume":"1963021260883.43",
"price_change":"-1397.74974667"
}
}
]
As mentioned above, the arrays arent always returned in the same order. So some times ETH may come before BTC for example. (There are about 10 Cryptos im pulling in this rest sensor, this is just a shortened version).
The version of code provided by @exxamalte works, thank you very much.
Unfortunately @koying , ive tried your code in dev tools and it complains that
UndefinedError: No first item, sequence was empty.
I would like to get this jinga selector working however if possible?
Thank you both.