Dark Sky API Replacement Script in PHP

 

So Apple bought Dark Sky and decided to make it their own.  They killed the Android app and will soon shut down the existing API access by incorporating it all into their developer platform.  No matter what we small time weather site operators think of these moves, it is what it is in this 21st century corporate world of tech giants.

I used to use Dark Sky mainly for one thing, their minutely forecasts.  Those were unique and gave visitors to my weather site a hint as to what might occur over the next hour.  I like them and wanted to keep them so I set out on a quest to replace the Dark Sky API.  I tried a bunch of APIs with varying results and I think I have acquired more API credentials than a duck has feathers!  It took some time and work to go through all the possibilities but I finally arrived at a good replacement.  I have been comparing this replacement to Dark Sky for a while and find the accuracy comparable.  This I admit is not a scientific comparison but the science says any short term forecast without human intervention is difficult at best.  I think the AI is getting better by the day and once again, it is what it is.

The answer I arrived at was the Aeris Weather API used in conjunction with my own coding to produce a 60 minute forecast like you see in the upper left of this page.  In order to use the Aeris API you must obtain the credentials.  If you are a big time app developer you can purchase access but for small operators and weather station owners like me Aeris has created a "contributor" account which provides 5000 free accesses per day.  I for one think this is GREAT in the 21st century corporate world!  So how do you become a contributor?  You send your weather station data to https://pwsweather.com which is the web weather site of Aeris Weather.  Personally I have been sending them data for years even before I was aware of the API contributor plan.  I like their site and like to promote competition between the various weather purveyors on the Interwebs.  So I encourage all to register your station on PWSweather and start sending your data to them.  Most weather stations and weather station software allows this connection.  You will need to look up the specifics for your station but in most cases it is quite simple and very similar to the steps required to send data to Weather Underground, CWOP, etc.

So here is what you need to do to really replace the Dark Sky minutely forecast:  If you are not already sending your weather station data to PWSweather, figure out how to do it for your setup then go to https://pwsweather.com and register yourself and your station.  Once that is done click the "Contributor" link and get yourself some credentials for the Aeris Weather API.  I would like to add that this is a very comprehensive business class API that includes some fine mapping capabilities.  The contributor account is a real value and Aeris deserves kudos for making it possible for weather station owners to have reasonably generous access in return for their station data.  Even if you don't use the API it is still a good thing to send your data.  The more data the weather companies have the better our forecasts will be.  The next paragraph talks about getting my code if you want it.

I spent a lot of time experimenting with APIs to find one that measured up to Dark Sky's minute by minute forecast and that was also accessible and affordable to the average weather station or small local weather website owner.  So in a sense I have already provided a key piece of information to anyone wanting to replace DS ... use Aeris Weather.  That said, Aeris doesn't provide the concise summary text like "Heavy rain for the hour." or "Light rain starting in 10 minutes and stopping 20 minutes later." like DS used to do.  It returns 60 json coded one minute periods with the rain rates, snow rates, etc.  To produce the text above those results have to be analyzed and processed.  I have written my own short script to process the API data and turn it into a plain English forecast like you see at the top of this page.  It then returns that forecast as a JavaScript document.write() statement.  One can then include it in a page between script tags to display the goods.  If you are interested in examining my code you can purchase a copy below.  I am not selling tech support or anything like that, I am just sending you the code to do with as you wish.  It is in PHP and has comments as well as a short instruction sheet to tell you how to use it.  It will be sent by email as a zip file.  It should run out of the box on most all servers but if you want to change it you will need some knowledge of PHP programming.  So here you go, send me $10 bucks and I will email you the source code.  Click the Buy Now below.

To download the documentation for this script before you buy it

 

 
USE AT YOUR OWN RISK!

Questions / Comments?  Email me.

MRE Logo