Page 1 of 1

WU not returning any data with valid API key

PostPosted: Mon Oct 07, 2019 9:33 am
by bsp9493
Hi Dave...

I know the plug in has been deprecated, but just thought I would try a couple things since WU has apparently updated API use for PWS users. I really miss this plugin and data:(

Everything with the plugin is working fine as it did before, however, API call works, but returns no values? Checked with IBM and they say my API is fine.

What am I missing?

Thank in advance.


Re: WU not returning any data with valid API key

PostPosted: Mon Oct 07, 2019 9:38 am
by bsp9493
log shows the following, which to me would indicate an invalid API key.

Location Specified: pws:IBRITISH277
{u'response': {u'termsofService': u'', u'version': u'0.1', u'features': {}, u'error': {u'type': u'keynotfound', u'description': u'this key does not exist'}}}

Re: WU not returning any data with valid API key

PostPosted: Mon Oct 07, 2019 5:06 pm
by bsp9493
Hi again...

I'm sure you are aware, but I have to ask...
I finally took some time and figured out how to get WU data using the new API... (API is free, as before, for those of us that submit our PWS data to wunderground)

Looks like there are some changes to the call and I'm guessing the returned json. What is the possibility of these changes being incorporated into the WU Plugin?

did I mention I REALLY miss this plugin? :)

Code: Select all
#new format

#old format"deleted my key for security"/geolookup/alerts_v11/almanac_v11/astronomy_v11/conditions_v11/forecast10day_v11/hourly_v11/lang:EN/yesterday_v11/tide_v11/q/pws:IBRITISH277.json?apiref="deleted"

#mytest (current conditions)"deleted my key for security""

{"observations":[{"stationID":"IBRITISH277","obsTimeUtc":"2019-10-07T22:09:37Z","obsTimeLocal":"2019-10-07 15:09:37","neighborhood":"Woodhaven","softwareType":"meteobridge","country":"CA","solarRadiation":59.0,"lon":-119.47357941,"realtimeFrequency":null,"epoch":1570486177,"lat":49.81105423,"uv":1.0,"winddir":161,"humidity":63,"qcStatus":1,"imperial":{"temp":56,"heatIndex":56,"dewpt":44,"windChill":56,"windSpeed":0,"windGust":3,"pressure":29.70,"precipRate":0.00,"precipTotal":0.00,"elev":1335}}]}

#mytest forceast,119.474&format=json&units=e&language=en-US&apiKey="deleted my key for security"

{"dayOfWeek":["Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],"expirationTimeUtc":[1570490195,1570490195,1570490195,1570490195,1570490195,1570490195],"moonPhase":["Waxing Gibbous","Waxing Gibbous","Waxing Gibbous","Waxing Gibbous","Waxing Gibbous","Full Moon"],"moonPhaseCode":["WXG","WXG","WXG","WXG","WXG","F"],"moonPhaseDay":[9,10,11,12,13,14],"moonriseTimeLocal":["2019-10-08T15:42:21+0800","2019-10-09T16:09:54+0800","2019-10-10T16:33:25+0800","2019-10-11T16:54:18+0800","2019-10-12T17:13:33+0800","2019-10-13T17:32:08+0800"],"moonriseTimeUtc":[1570520541,1570608594,1570696405,1570784058,1570871613,1570959128],"moonsetTimeLocal":["","2019-10-09T00:49:29+0800","2019-10-10T01:53:58+0800","2019-10-11T02:58:32+0800","2019-10-12T04:03:12+0800","2019-10-13T05:08:14+0800"],"moonsetTimeUtc":[null,1570553369,1570643638,1570733912,1570824192,1570914494],"narrative":["Mix of sun and clouds. Highs in the mid 50s and lows in the upper 30s.","Mostly cloudy. Highs in the upper 50s and lows in the upper 20s.","Mostly sunny. Highs in the upper 30s and lows in the upper teens.","Plenty of sun. Highs in the mid 30s and lows in the mid teens.","Mostly sunny. Highs in the upper 30s and lows in the mid teens.","A few clouds. Highs in the upper 30s and lows in the upper teens."],"qpf":[0.0,0.0,0.0,0.0,0.0,0.0],"qpfSnow":[0.0,0.0,0.0,0.0,0.0,0.0],"sunriseTimeLocal":["2019-10-08T06:11:28+0800","2019-10-09T06:13:00+0800","2019-10-10T06:14:33+0800","2019-10-11T06:16:06+0800","2019-10-12T06:17:39+0800","2019-10-13T06:19:13+0800"],"sunriseTimeUtc":[1570486288,1570572780,1570659273,1570745766,1570832259,1570918753],"sunsetTimeLocal":["2019-10-08T17:27:26+0800","2019-10-09T17:25:19+0800","2019-10-10T17:23:12+0800","2019-10-11T17:21:06+0800","2019-10-12T17:19:01+0800","2019-10-13T17:16:56+0800"],"sunsetTimeUtc":[1570526846,1570613119,1570699392,1570785666,1570871941,1570958216],"temperatureMax":[54,57,39,36,39,39],"temperatureMin":[38,28,18,15,15,18],"validTimeLocal":["2019-10-08T07:00:00+0800","2019-10-09T07:00:00+0800","2019-10-10T07:00:00+0800","2019-10-11T07:00:00+0800","2019-10-12T07:00:00+0800","2019-10-13T07:00:00+0800"],"validTimeUtc":[1570489200,1570575600,1570662000,1570748400,1570834800,1570921200],"daypart":[{"cloudCover":[45,32,68,55,26,36,26,5,10,15,19,4],"dayOrNight":["D","N","D","N","D","N","D","N","D","N","D","N"],"daypartName":["Today","Tonight","Tomorrow","Tomorrow night","Thursday","Thursday night","Friday","Friday night","Saturday","Saturday night","Sunday","Sunday night"],"iconCode":[30,29,28,29,34,29,34,31,34,31,34,31],"iconCodeExtend":[3000,2900,2800,2900,3400,2900,3400,3100,3400,3100,3400,3100],"narrative":["Clouds and some sun this morning with more clouds for this afternoon. High 54F. Winds WSW at 10 to 20 mph.","A few clouds. Low 38F. Winds SW at 10 to 15 mph.","A mix of clouds and sun in the morning followed by cloudy skies during the afternoon. High 57F. Winds W at 15 to 25 mph.","Partly cloudy skies. Low 28F. Winds WNW at 10 to 15 mph.","Sunny along with a few clouds. High 39F. Winds WNW at 15 to 25 mph.","A few clouds from time to time. Low 18F. Winds W at 5 to 10 mph.","Sunshine along with some cloudy intervals. High 36F. Winds WNW at 10 to 15 mph.","Clear skies. Low near 15F. Winds WSW at 5 to 10 mph.","Generally sunny. High 39F. Winds W at 10 to 15 mph.","A mostly clear sky. Low around 15F. Winds light and variable.","Mostly sunny skies. High 39F. Winds WNW at 10 to 15 mph.","Clear. Low 18F. Winds light and variable."],"precipChance":[0,0,10,20,10,0,10,0,0,0,0,0],"precipType":["rain","precip","rain","precip","precip","snow","precip","snow","precip","snow","precip","snow"],"qpf":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"qpfSnow":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"qualifierCode":[null,null,null,null,null,null,null,null,null,null,null,null],"qualifierPhrase":[null,null,null,null,null,null,null,null,null,null,null,null],"relativeHumidity":[46,66,47,69,31,48,29,43,28,50,31,47],"snowRange":["","","","","","","","","","","",""],"temperature":[54,38,57,28,39,18,36,15,39,15,39,18],"temperatureHeatIndex":[53,48,56,43,38,29,35,25,38,26,38,27],"temperatureWindChill":[18,33,34,19,18,13,14,8,11,10,12,12],"thunderCategory":["No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder","No thunder"],"thunderIndex":[0,0,0,0,0,0,0,0,0,0,0,0],"uvDescription":["Moderate","Low","Moderate","Low","Moderate","Low","Moderate","Low","Moderate","Low","Moderate","Low"],"uvIndex":[3,0,3,0,3,0,3,0,3,0,3,0],"windDirection":[250,234,274,303,297,280,299,257,270,269,302,285],"windDirectionCardinal":["WSW","SW","W","WNW","WNW","W","WNW","WSW","W","W","WNW","WNW"],"windPhrase":["Winds WSW at 10 to 20 mph.","Winds SW at 10 to 15 mph.","Winds W at 15 to 25 mph.","Winds WNW at 10 to 15 mph.","Winds WNW at 15 to 25 mph.","Winds W at 5 to 10 mph.","Winds WNW at 10 to 15 mph.","Winds WSW at 5 to 10 mph.","Winds W at 10 to 15 mph.","Winds light and variable.","Winds WNW at 10 to 15 mph.","Winds light and variable."],"windSpeed":[15,10,17,11,17,7,12,6,12,5,11,5],"wxPhraseLong":["Partly Cloudy","Partly Cloudy","Mostly Cloudy","Partly Cloudy","Mostly Sunny","Partly Cloudy","Mostly Sunny","Clear","Mostly Sunny","Clear","Mostly Sunny","Clear"],"wxPhraseShort":["P Cloudy","P Cloudy","M Cloudy","P Cloudy","M Sunny","P Cloudy","M Sunny","Clear","M Sunny","Clear","M Sunny","Clear"]}]}

Re: WU not returning any data with valid API key

PostPosted: Mon Oct 07, 2019 9:10 pm
by DaveL17
Hi Dave - it does indeed look like the API has been reworked and the plugin would need to be completely refactored to work with the new JSON layout.

I don't have a working API key (I don't have a PWS), have abandoned the plugin and my WU account and, to be honest, there's not much chance of me picking the plugin up again as I have too many other irons in the fire (for example, rewriting the Bike Share plugin due to a completely refactored API!). The deprecated plugin was issued with an MIT license, however, so anyone is free to fork it to work with the new API layout. (Fork warning: the WUnderground Plugin was one of my first so there's a lot of bandaids in there to overcome poor design choices!)

Another option would be to use the GhostXML plugin which may get you 90 percent of the way there right out of the box (you'd just need to convert the data from string format to whatever format you need).

Good luck!