cloudy cloudy

Author Topic: WUnderground new PWS-only API  (Read 896 times)

0 Members and 1 Guest are viewing this topic.

Offline bitsostring

  • Posts: 732
  • Oregon Scientific WMR200
  • Edinburgh, U.K.
  • OS/Browser:
  • Win NT 10.0
  • Chrome 64.0.3282.140
    • Home Weather Station
WUnderground new PWS-only API
« on: February 08, 2019, 07:14:58 PM »
Latest info I have is attached. Note that new API documentation is now available.

« Last Edit: February 08, 2019, 07:27:21 PM by bitsostring »
It's meant to be fun. . .

Offline Weather Display

  • Posts: 86,478
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Android 7.1.1
  • Chrome 71.0.3578.99
    • Weather Display
Re: WUnderground new PWS-only API
« Reply #1 on: February 08, 2019, 07:39:20 PM »
The documentation has been available for
A while
The keys are supposed to be available 14th feb

Offline bitsostring

  • Posts: 732
  • Oregon Scientific WMR200
  • Edinburgh, U.K.
  • OS/Browser:
  • Win NT 10.0
  • Chrome 64.0.3282.140
    • Home Weather Station
Re: WUnderground new PWS-only API
« Reply #2 on: February 16, 2019, 03:00:20 PM »
The keys are supposed to be available 14th feb

My API is still working. . . Latest info from WU attached.
It's meant to be fun. . .

Offline Weather Display

  • Posts: 86,478
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 71.0.3578.98
    • Weather Display
Re: WUnderground new PWS-only API
« Reply #3 on: February 16, 2019, 06:18:29 PM »
yes, I got that email
once I get the new key I will see about getting WD to use the new api to get needed data it does now
hopefully it will means you will be able to get your own WU data via the api (ie WD set as stationless (I have not allowed any new users to select that as option due to uncertainty))

Offline Weather Display

  • Posts: 86,478
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 71.0.3578.98
    • Weather Display
Re: WUnderground new PWS-only API
« Reply #4 on: February 19, 2019, 11:00:36 PM »
i managed to get my api key
which are available npw
but I had to use Edge browser (which I not logged in with before)
chrome said session timed out

Offline Weather Display

  • Posts: 86,478
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 71.0.3578.98
    • Weather Display
Re: WUnderground new PWS-only API
« Reply #5 on: February 20, 2019, 12:53:51 AM »
and I have got weather data working in WD for the new apikey you can get and for your WU ID via the new api system :)

Offline bitsostring

  • Posts: 732
  • Oregon Scientific WMR200
  • Edinburgh, U.K.
  • OS/Browser:
  • Win NT 10.0
  • Chrome 64.0.3282.140
    • Home Weather Station
Re: WUnderground new PWS-only API
« Reply #6 on: February 20, 2019, 11:51:26 AM »
and I have got weather data working in WD for the new apikey

Well done, Brian - that was quick!
It's meant to be fun. . .

Offline niko

  • syzygy
  • Global Moderator
  • Posts: 27,941
  • Crystal Ball broken! Please post the URL.
  • Northern California, U.S.A.
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Chrome 72.0.3626.109
Re: WUnderground new PWS-only API
« Reply #7 on: February 20, 2019, 02:16:15 PM »
+1

Offline saratogaWX

  • Global Moderator
  • Posts: 5,901
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 65.0
    • Saratoga Weather
Re: WUnderground new PWS-only API
« Reply #8 on: February 20, 2019, 04:18:10 PM »
I also got a new key and am working on a WC-forecast.php script (based on the old, soon to be deprecated WU-forecast.php script).

Like Brian, I couldn't get a key with Firefox, but was successful with Chrome (after signing in to my WU ID).

Missing from the returned JSON is a timestamp representing WHEN the forecast was done.. only a 'validfrom' date set was found.  Also missing is any meta-data about location name.

The language stuff works just fine and returns UTF-8 text in the requested language.

I've done a preliminary mapping of their icon codes to icons used with the NWS/Saratoga and Meteotriviglio sets.

Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline Weather Display

  • Posts: 86,478
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 71.0.3578.98
    • Weather Display
Re: WUnderground new PWS-only API
« Reply #9 on: February 20, 2019, 05:53:36 PM »
I got an access denied for some of the things (history/5 day forecast)
if the forecast is set to 7 days
5 days and its OK
go figure

Offline saratogaWX

  • Global Moderator
  • Posts: 5,901
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 65.0
    • Saratoga Weather
Re: WUnderground new PWS-only API
« Reply #10 on: February 20, 2019, 06:42:19 PM »
You have to ask for the 5day only.. the others seem to return 403s/not allowed.

Strange, but my 5day request is now returning 6days of forecast.. I'll not complain :)
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline Weather Display

  • Posts: 86,478
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 71.0.3578.98
    • Weather Display
Re: WUnderground new PWS-only API
« Reply #11 on: February 20, 2019, 06:56:01 PM »
so why does the example in the docs say 7 days

I also got an access denied for the sample history too
I was thinking that could be like a replacement for almanac (all history)?

Offline Weather Display

  • Posts: 86,478
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 71.0.3578.98
    • Weather Display
Re: WUnderground new PWS-only API
« Reply #12 on: February 20, 2019, 07:40:41 PM »
where do you find info about the icon codes code?

Offline saratogaWX

  • Global Moderator
  • Posts: 5,901
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 65.0
    • Saratoga Weather
Re: WUnderground new PWS-only API
« Reply #13 on: February 21, 2019, 12:57:43 AM »
That was in one of the linked Google docs about the API:  https://goo.gl/G75I1Z

The API returns iconCode and iconCodeExtend (but I've not found docs on the iconCodeExtend anywhere)

Code: [Select]
      "iconCode": [
        39,
        29,
        32,
        31,
        34,
        33,
        28,
        26,
        28,
        11,
        11,
        11
      ],
      "iconCodeExtend": [
        7103,
        2900,
        3200,
        3100,
        3400,
        3300,
        2800,
        2600,
        2800,
        1100,
        1201,
        1100
      ],

Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline saratogaWX

  • Global Moderator
  • Posts: 5,901
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 65.0
    • Saratoga Weather
Re: WUnderground new PWS-only API
« Reply #14 on: February 21, 2019, 01:00:56 AM »
After about 5 hrs, I've repurposed the old WU-forecast.php script into a WC-forecast.php script and it's getting and formatting the data.

I'll be releasing the updated script after there is general availability of the WU PWS users ability to get an API key (right now, it appears to be limited to early adopters who let Victoria know).

Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates