The API I'm using has the most recent data last, and can span upwards of 1000 objects.
I'm trying to retrieve individual hashes for each recent date to create a graph.
https://api.nanopool.org/v1/eth/hashratechart/0x70563a1582341e761e3c60305315411807a52264
So I would need to get the length of .data[]
The closest I've come is
$wg(api.nanopool.org/v1/eth/hashratechart/0x70563a1582341e761e3c60305315411807a52264, json, "")$
Which retrieves the entire JSON.
frank
May 5, 2011, 3:22pm
2
Did you try $wg(uri, json, ".data.length()")$ ? This was introduced in json path 2.2.0 and should be part of standard 3.25 distrp
Huh, never heard of json path 2.2.0. Glad you told me.
An unrelated question, but do you have any idea how to parse this date: 1497319800?
It's Unix epoch time, no idea how it works.
frank
May 5, 2011, 3:57pm
4
Jsonpath is the library Kustom uses to parse Json, to parse a timestamp just use $df(HH:mm, timestamp)$ or $df(HH:mm, timestamp + df(Z))$ if you want it to be converted to your local timezone (assuming timestamp is in UTC)