Skip to content

Miro382/CSharp_Weather

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSharp_Weather

C# weather api

Very easy code for receive weather from http://openweathermap.org/ or from http://met.no/ with few lines of code you can get temperature, wind speed, humidity, pressure...

Open Weather Map

Wiki: https://github.com/Miro382/CSharp_Weather/wiki/Open-Weather-Map

using CSharp_Weather;

        Weather weather = new Weather("123456789101112131415", Weather.Celsius);
        if(weather.GetWeather("London"))
        {
            if(weather.GetWeatherIsSuccessful())
            {
                string temp = weather.weatherinfo.Temperature + weather.UnitSymbol();
            }
        }

Open Weather Map is free for commercial use.

If you want weather of your country capital city use

 if(weather.GetWeather(weather.GetCountry()))
 {
      ...  
 }

The Norwegian Meteorological Institute

Wiki: https://github.com/Miro382/CSharp_Weather/wiki/The-Norwegian-Meteorological-Institute

using CSharp_Weather;

        CityLocator cityloc = new CityLocator();
        cityloc.GetGeoCoordByCityName("Bratislava");

        WeatherMET weather = new WeatherMET();
        if(weather.GetWeatherData(cityloc.Latitude,cityloc.Longtitude))
        {
            string temp = weather.weatherinfo.Temperature;
        }

MET Norway is free for commercial use if you attribute them: http://api.met.no/license_data.html
CityLocator is for receive latitude and longtitude from city name.

This version only work for current weather. No forecast.

Current version: 1.0.0

About

C# weather api

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages