It is currently September 1st, 2024, 1:19 am
⭐ Weather.com - Parsing the V3 JSON
-
- Developer
- Posts: 22710
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: ⭐ Weather.com - Parsing the V3 JSON - NEW!
It does mean this data isn't a great fit for a skin designed with a "current", "today/tonight", "tomorrow" flavor. This pollen stuff needs to kinda stand alone with the data driving the "day" instead of the day driving the "data". There is no real easy way to ask "what is the pollen stuff for tomorrow night"? I mean, you can, but it's going to take some String measures and IfMatch on the "D/N" stuff.
-
- Rainmeter Sage
- Posts: 8003
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: ⭐ Weather.com - Parsing the V3 JSON - NEW!
Damn, that looks really simple and efficient.
![Sly :sly:](./images/smilies/do.gif)
![Thumbs Up :thumbup:](./images/smilies/ay.gif)
Just for reference, I can get the historical V3 pollen using an URL like (my location doesn't work with this one, I'm assuming it's US only or something):
Code: Select all
https://api.weather.com/v3/wx/indices/pollen/historical/1month?geocode=33.33,-83.22&format=json&language=en-CA&yearMonth=202007&apiKey=<ApiKey>
Code: Select all
https://api.weather.com/v3/wx/indices/pollen/daypart/3day?geocode=33.33,-83.22&format=json&language=en-CA&apiKey=<ApiKey>
EDIT: By the way, I checked a wunderground.com page for links regarding pollen forecast, and they also seem to request only V1 and V2 data, no V3 one. So it might just be that the V3 option is for some reason unavailable (or maybe in the process of being built)...
-
- Developer
- Posts: 22710
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: ⭐ Weather.com - Parsing the V3 JSON - NEW!
Yeah, could very well be. There is also apparently an "aggregate" form where it could be obtained along with the other data in one go, but it seems you can't mix and match V3 "products" with V2 "products".Yincognito wrote: ↑August 4th, 2020, 1:24 am Damn, that looks really simple and efficient.I think you're on the right track there.
![]()
Just for reference, I can get the historical V3 pollen using an URL like (my location doesn't work with this one, I'm assuming it's US only or something):but a pollen forecast like:Code: Select all
https://api.weather.com/v3/wx/indices/pollen/historical/1month?geocode=33.33,-83.22&format=json&language=en-CA&yearMonth=202007&apiKey=<ApiKey>
doesn't work, despite trying various ways to write or permutate the wx/indices/pollen/daypart/3day part. This part is key (unless some other parameter is needed in the URL, like for the historical pollen above) - I leave this here maybe someone else wil have better luck guessing the right syntax for this.Code: Select all
https://api.weather.com/v3/wx/indices/pollen/daypart/3day?geocode=33.33,-83.22&format=json&language=en-CA&apiKey=<ApiKey>
EDIT: By the way, I checked a wunderground.com page for links regarding pollen forecast, and they also seem to request only V1 and V2 data, no V3 one. So it might just be that the V3 option is for some reason unavailable (or maybe in the process of being built)...
-
- Rainmeter Sage
- Posts: 8003
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: ⭐ Weather.com - Parsing the V3 JSON - NEW!
Yes. The aggregate form is from what I did read (didn't try though) available for V3 historical pollen. Generally, the / becomes - in the aggregate URL, with some very rare exceptions.
-
- Developer
- Posts: 22710
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: ⭐ Weather.com - Parsing the V3 JSON - NEW!
BTW, on an unrelated topic, you had questioned the "scale" used with "Air Quality", they are:
United States EPA
China HJ6332012
France ATMO
Germany UBA
United Kingdom of Great Britain and Northern Ireland (the) DAQI
India NAQI
Mexico IMECA
Spain CAQI
It has to do with which bureau of jack-booted thugs is responsible for lying to the public in the different countries. The recommendation on the site is to indeed just use EPA.
It doesn't seem to be "scale" in the sense of "units of measure", which always seems to be "μg/m3", but rather "scale" in the sense of "how much of that is ... bad?"
United States EPA
China HJ6332012
France ATMO
Germany UBA
United Kingdom of Great Britain and Northern Ireland (the) DAQI
India NAQI
Mexico IMECA
Spain CAQI
It has to do with which bureau of jack-booted thugs is responsible for lying to the public in the different countries. The recommendation on the site is to indeed just use EPA.
It doesn't seem to be "scale" in the sense of "units of measure", which always seems to be "μg/m3", but rather "scale" in the sense of "how much of that is ... bad?"
-
- Rainmeter Sage
- Posts: 8003
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: ⭐ Weather.com - Parsing the V3 JSON - NEW!
Yeah, figured out that part afterwards, browsing the docs - but thanks anyway.jsmorley wrote: ↑August 4th, 2020, 1:41 am BTW, on an unrelated topic, you had questioned the "scale" used with "Air Quality", they are:
United States EPA
China HJ6332012
France ATMO
Germany UBA
United Kingdom of Great Britain and Northern Ireland (the) DAQI
India NAQI
Mexico IMECA
Spain CAQI
It has to do with which bureau of jack-booted thugs is responsible for lying to the public in the different countries. The recommendation on the site is to indeed just use EPA.
![Big Grin :D](./images/smilies/ag.gif)
![Shocked O.O](./images/smilies/ai.gif)
-
- Developer
- Posts: 22710
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: ⭐ Weather.com - Parsing the V3 JSON - NEW!
As far as I can tell, all of the scales work everywhere. Now mind you, it could be that if you access a location in a country that doesn't support China's HJ6332012 agency, it just defaults to either EPA or whatever agency IS supported in that location, but at least it doesn't seem to "fail" with any combination of language, location or scale.Yincognito wrote: ↑August 4th, 2020, 1:48 am Yeah, figured out that part afterwards, browsing the docs - but thanks anyway.I congratulate myself with each day passing by that I don't have to (and I never will) grab the alerts, pollen, air quality stuff, as there are just too many possibilities there (I assume EPA wouldn't work for say China and viceversa HJwhatever wouldn't work for the US, although I might very well be mistaken).
![]()
-
- Developer
- Posts: 22710
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: ⭐ Weather.com - Parsing the V3 JSON - NEW!
I literally just think that "scale" is a lookup on the terms used for good and bad. If I use the Chinese scale on my US location, the air quality is "excellent" instead of "good". The "values" all seem to be the same.
They always seem to have the "source" of:
"Contains Copernicus Atmosphere Monitoring Service information 2020 and/or modified Copernicus Atmosphere Monitoring Service information 2020"
They always seem to have the "source" of:
"Contains Copernicus Atmosphere Monitoring Service information 2020 and/or modified Copernicus Atmosphere Monitoring Service information 2020"
-
- Rainmeter Sage
- Posts: 8003
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: ⭐ Weather.com - Parsing the V3 JSON - NEW!
Ah, I see - good to know.jsmorley wrote: ↑August 4th, 2020, 1:53 am As far as I can tell, all of the scales work everywhere. Now mind you, it could be that if you access a location in a country that doesn't support China's HJ6332012 agency, it just defaults to either EPA or whatever agency IS supported in that location, but at least it doesn't seem to "fail" with any combination of language, location or scale.
![Wink ;-)](./images/smilies/innuendo.gif)
-
- Rainmeter Sage
- Posts: 8003
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: ⭐ Weather.com - Parsing the V3 JSON - NEW!
LOL, although I doubt air quality in urban China is "excellent", that ("excellent" in China vs just "good" in the US) might be the case for other things besides the air quality nowadays...
![Whistle :Whistle](./images/smilies/whistling.gif)