A simple ASP.NET Core Web API that wraps the OpenWeatherMap service to provide clean and simplified weather data. Takes advantage of Swagger and VS Studios api page.
We specifically are using Geocoding API from OpenWeather.
Type in a city name and the app will display the current Temperature in Fareinheight, a short description of the conditions, and the humidity.
- Visual Studio (latest version)
- .NET SDK
- API OpenWeather key (Free)
- Clone this repository
- Open the solution in Visual Studio
- Update appsettings.json with your OpenWeather api key and add this base url
-
"WeatherApi": { "BaseUrl": "https://api.openweathermap.org/data/2.5/weather", "ApiKey": "{YOUR_API_KEY}" }, - Press F5 to run the project locally
- Open the api /Weather/{city} dropdown
- Press the try out button
- Type a city name
- Press execute button and check out the response
GET /api/weather/Denver
{
"city": "Denver",
"temperatureC": 13,
"description": "Partly cloudy",
"humidity": 62
}