Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1575

Weather • Re: Open-Meteo Weather API

$
0
0
{snip}
Stupid question, see below your Measure @CurrentUVIndex as an example:
  • The number "0" in Query='hourly.uv_index[0]' obviously means "current day" and 1, 2 [...] in following measures mean day 1, 2 [...] - that's clear. However, the api string "uv_index" (see snippet below) contains the complete hourly data for 7 days * 24 hours, right?
  • In "hourly":{"time" I can also see the hourly date/time array fitting to these hourly.uv_index values, right?
  • Can I already access these hourly values somehow e.g. via hourly.uv_index[0,1] for "current day, hour 1" and [0,2] for hour 2 and so forth? Does your JsonParser have a query possibility for this hourly data? What's the correct syntax?
I would like to use your skin as a basis for my project - but I really need the hourly data. If you can tell me how this works for the UV index I can probably transfer this to the irradiance-values I'm interested in. Thanks for your time and help!
{snip}
Sorry for the late reply...

You are correct about the bracketed number in the query line; it represents the item number of the source array.

The way the JSON is formatted determines how you can query it.

In this case the API provides individual values for each requested item: time, cloud cover, etc. at an 'hourly' interval (UV_Index should have been added to that 'hourly' list). Then all items in the 'hourly' list are correlate; 1st time, 1st cloud cover, and 1st UV_Index numbers are related to each other.

The syntax to query each would be a single bracketed number:
Query='hourly.time[0]'
Query='hourly.cloudcover[0]'
Query='hourly.uv_index[0]'

This obtains the first set of data, then repeat for each array item as often as needed. There is no limit to the number of indexes in JSONparser; unlike the limit of 99 captures (excluding using StringIndex2) in the Webparser.

Because each array contains unique values you would only specify the index of each item in your query [0] to [x] (x=number of indexes in the arrays).

I am still a rookie when it comes to using the JSONParser, but hopefully this helps you.

Statistics: Posted by eclectic-tech — Today, 1:41 am



Viewing all articles
Browse latest Browse all 1575

Trending Articles