SimplerWeather icon indicating copy to clipboard operation
SimplerWeather copied to clipboard

Zip code to Lat/Long

Open k-brain opened this issue 7 years ago • 1 comments

Any ideas on how to implement a way to convert a zip code to the lat/long that DarkSky likes in the script? Was using Yahoo, then with help moved over to Wunderground using SimpleWeather and now that API is gone end of the year.

k-brain avatar Dec 06 '18 16:12 k-brain

HI @kevandju,

You may need to add a secondary API call to get the lat/lon based on the zip. Google, Bing, and several other APIs are available however they do require a second API key and agreement with the provider. If you do a search for "Zip to latitude and longitude API" you'll be able to find an API that will work for you.

Then you can pass that into value into a function like the loadWeather() example: https://github.com/BrookeDot/SimplerWeather/blob/master/geolocation-example.js#L38

BrookeDot avatar Dec 07 '18 04:12 BrookeDot