Hello,
I'm calling the following url successfully: https://api.forecast.solar/estimate/watthours/day/42.6977/23.3219/22/-45/2.8
The returned JSON is the following:
{
"result": {
"2023-04-07": 8108,
"2023-04-08": 3016
},
"message": {
"code": 0,
"type": "success",
"text": "",
"info": {
"latitude": 42.6977,
"longitude": 23.3219,
"distance": 0,
"place": "Souvenirs Bulgaria, бул. Тодор Александров, Център, Средец, София, Столична, София-град, 1000, България",
"timezone": "Europe/Sofia",
"time": "2023-04-07T23:49:02+03:00",
"time_utc": "2023-04-07T20:49:02+00:00"
},
"ratelimit": {
"period": 3600,
"limit": 12,
"remaining": 6
}
}
}
I would like to obtain the value of the first returned value "8108" in a variable.
I managed doing that using the option "Use JSON structure" enabled and assigning "result-2023-04-07" to a variable.
However this method is not working for me because the dates are changing and I tried capturing the returned value with "Use JSON structure" disabled and using a coma separated list "pa,pb,pc". When I assign to variables {pa} , {pb} and {pc}, I get the following three values "Array", "Array" and Empty.
I assume I'm doing something wrong here and thus looking for a help.
Asked by Svetozar Rusinov on April 8, 2023, at 5:12am