Skip to content

JohnnyGonzalez56/WeatherApi

Repository files navigation

Weather API Wrapper

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.

How to Run the Project

Prerequisites

  • Visual Studio (latest version)
  • .NET SDK
  • API OpenWeather key (Free)

Setup

  1. Clone this repository
  2. Open the solution in Visual Studio
  3. Update appsettings.json with your OpenWeather api key and add this base url
  4. "WeatherApi": {
       "BaseUrl": "https://api.openweathermap.org/data/2.5/weather",
       "ApiKey": "{YOUR_API_KEY}"
    }, 
    
  5. Press F5 to run the project locally
  6. Open the api /Weather/{city} dropdown
  7. Press the try out button
  8. Type a city name
  9. Press execute button and check out the response

Example Request

GET /api/weather/Denver

Example Response

{
  "city": "Denver",
  "temperatureC": 13,
  "description": "Partly cloudy",
  "humidity": 62
}

App Screeshot

About

A simple ASP.NET Core Web API that fetches weather data from a public weather API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •