Skip to content

Get current weather (including forecast and warnings) from Environment Canada in JSON format.

Notifications You must be signed in to change notification settings

gilyes/weather-envcanada

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Retrieve weather data from Environment Canada

Getting weather

var weather = require("weather-envcanada");

weather.getWeatherBySiteName("Edmonton", "AB", function(error, weatherData) {});
weather.getWeatherBySiteCode("s0000045", "AB", function(error, weatherData) {});

Result:

{
  "temperature": "-23",
  "temperatureUnit": "C",
  "conditions": "Light Snow",
  "warnings": [
    {
      "description": "SNOWFALL WARNING IN EFFECT",
      "priority": "high"
    }
  ],
  "forecasts": [
    {
      "period": "Thursday night",
      "temperature": "Low minus 21.",
      "pop": "",
      "popSummary": "",
      "cloudPopSummary": "Clear.",
      "relativeHumidityPercent": "75",
      "windSummary": "Wind northwest 20 km/h gusting to 40 becoming light this evening.",
      "windChillSummary": "Wind chill minus 29."
      "summary": "Clear.",
      "fullSummary": "Clear. Wind northwest 20 km/h gusting to 40 becoming light this evening. Low minus 21. Wind\r\n                chill minus 29.\r\n            ",
    },
    ...
  ]
}

Getting site code

weather.getSiteByName("Edmonton", "AB", function(error, site) {});

Result:

{
  "siteName": "Edmonton",
  "code": "s0000045",
  "province": "AB" 
}

About

Get current weather (including forecast and warnings) from Environment Canada in JSON format.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published