Author Topic: WU API Almanac JSON Script, It's already here!  (Read 793 times)

0 Members and 1 Guest are viewing this topic.

Offline SLOweather

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 3456
    • Weatherelement Moline IL
WU API Almanac JSON Script, It's already here!
« on: January 22, 2018, 06:32:24 PM »
Well, heck. You can't beat WxForum and good ol' Saratoga Ken!

I had the VWS almanac data of highs/lows/averages on my site for years. As y'all might know, that connection is broken, so I took it off. After yet another query about it today, I went a'searching WU for their API info. In short, here's what I need.

http://api.wunderground.com/api/MyAPIkey/almanac/q/CA/San_Luis_Obispo.json

which returns

Quote
response   
version   "0.1"
termsofService   "http://www.wunderground.com/weather/api/d/terms.html"
features   
almanac   1
almanac   
airport_code   "KSBP"
temp_high   
normal   
F   "63"
C   "17"
record   
F   "82"
C   "27"
recordyear   "2014"
temp_low   
normal   
F   "42"
C   "5"
record   
F   "30"
C   "-1"
recordyear   "2007"

Now I need to parse it. Did a search here and found this thread from 2012...

www.wxforum.net/index.php?topic=15427

So, now, to keep within the 20 calls /day developer limit, I need to mash that up into something I can call from a cron job just after midnight and write to a table I can display.

Thanks, Ken, and the OP, CNYWeather!

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9288
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: WU API Almanac JSON Script, It's already here!
« Reply #1 on: January 22, 2018, 07:27:29 PM »
 8-)  I love code that stands the test of time (2012-2017.. not bad)
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: WU API Almanac JSON Script, It's already here!
« Reply #2 on: January 23, 2018, 11:13:36 AM »
It's a shame NWS doesn't stand that same test of time...  :roll:
John
W7JKG