Hello everybody.
I using http agent to get data from an API.
this is the result
{"bandwidth_timeseries":[{"data":[[1591221600000,718241006],[1591164000000,625176534],[1591171200000,453577174],[1591207200000,2862877103],[1591214400000,2219128657],[1591156800000,889711191],[1591142400000,1501012700],[1591192800000,2401177583],[1591149600000,1005895533],[1591200000000,2996289428],[1591178400000,549401077],[1591185600000,2168189147]],"id":"api.stats.bandwidth_timeseries.bandwidth"," name":"Bandwidth"},{"data":[[1591221600000,798045],[1591164000000,694640],[1591171200000,503974],[1591207200000,3180974],[1591214400000,2465698],[1591156800000,988567],[1591142400000,1667791],[1591192800000,2667975],[1591149600000,1117661],[1591200000000,3329210],[1591178400000,610445],[1591185600000,2409099]],"id":"api.stats.bandwidth_timeseries.bps","name": "Bits per second"}],"res":0,"res_message":"OK","debug_info":{"id-info":"13724"}}
with jason preprocessing ($.bandwidth_timeseries[1].data), I can obtain this:
[[1591164000000,694640],[1591171200000,503974],[1591207200000,3180974],[1591214400000,595220],[1591156800000,988567],[1591142400000,1667791],[1591192800000,2667975],[1591149600000,1117661],[1591200000000,3329210],[1591178400000,610445],[1591185600000,2409099]]
but I need to obtain the pair with the maximun first value, [1591221600000,798045] in this case.
I tried many options, but all failed.
Could someone give me any tip to achieve what i want??
Thanks in advance.
I using http agent to get data from an API.
this is the result
{"bandwidth_timeseries":[{"data":[[1591221600000,718241006],[1591164000000,625176534],[1591171200000,453577174],[1591207200000,2862877103],[1591214400000,2219128657],[1591156800000,889711191],[1591142400000,1501012700],[1591192800000,2401177583],[1591149600000,1005895533],[1591200000000,2996289428],[1591178400000,549401077],[1591185600000,2168189147]],"id":"api.stats.bandwidth_timeseries.bandwidth"," name":"Bandwidth"},{"data":[[1591221600000,798045],[1591164000000,694640],[1591171200000,503974],[1591207200000,3180974],[1591214400000,2465698],[1591156800000,988567],[1591142400000,1667791],[1591192800000,2667975],[1591149600000,1117661],[1591200000000,3329210],[1591178400000,610445],[1591185600000,2409099]],"id":"api.stats.bandwidth_timeseries.bps","name": "Bits per second"}],"res":0,"res_message":"OK","debug_info":{"id-info":"13724"}}
with jason preprocessing ($.bandwidth_timeseries[1].data), I can obtain this:
[[1591164000000,694640],[1591171200000,503974],[1591207200000,3180974],[1591214400000,595220],[1591156800000,988567],[1591142400000,1667791],[1591192800000,2667975],[1591149600000,1117661],[1591200000000,3329210],[1591178400000,610445],[1591185600000,2409099]]
but I need to obtain the pair with the maximun first value, [1591221600000,798045] in this case.
I tried many options, but all failed.
Could someone give me any tip to achieve what i want??
Thanks in advance.