ForecastCFML is a wrapper for the Forecast.io v2 api. Forecast.io claims to be "The easiest, most advanced, weather API on the web". https://developer.forecast.io/
You need an account with Forecast.io.
In the config.cfc
, replace YOUR_APIKEY_GOES_HERE with your valid api key along with your latitude and longitude
You may find your citys' coordinates by going to LatLong.net.
To use, call the getWeather()
function which takes four arguments:
- baseURL (required, which is https://api.forecast.io/forecast)
- apiKey (required)
- latitude (required)
- longitude (required)
After plugging in with your parameters, code will generate this.
1.0 Written by DannyD
2.0 Written by damiththa
Apache
Tested against Railo 4. Should work with ColdFusion (might have to import the https cert for https://api.forecast.io/forecast).