Skip to content

A simple weather app that allows users to search for weather by city name. It fetches real-time weather data including temperature, humidity, and wind speed from the OpenWeatherMap API, and displays corresponding weather icons.

Notifications You must be signed in to change notification settings

evitabarboza/Weather-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Weather App Using OpenWeatherMap API

This project is a simple weather app that allows users to search for weather information based on a city name. The app fetches data from the OpenWeatherMap API and displays the current temperature, humidity, and wind speed. Additionally, it shows a weather icon corresponding to the current weather conditions.

Features

  • Search for weather by city name.
  • Displays the current temperature, humidity, and wind speed.
  • Shows weather-related icons (e.g., rain, clouds, clear sky).
  • Handles invalid city names gracefully by displaying an error message.

Technologies Used

  • HTML: Structure of the weather app.
  • CSS: Styling of the app.
  • JavaScript: Fetching data from the OpenWeatherMap API and handling the user interactions.
  • OpenWeatherMap API: Provides the weather data.

Setup and Installation

Follow these steps to run the weather app on your local machine:

1. Clone the repository:

git clone https://github.com/evitabarboza/weather-app.git

2. Navigate to the project directory:

cd weather-app

3. Open the index.html file in a browser:

You can simply open the index.html file using any modern browser (e.g., Chrome, Firefox, Edge).

4. API Key:

To use the OpenWeatherMap API, you'll need to sign up for an API key.

  • Go to OpenWeatherMap and create an account.
  • Once logged in, navigate to your API keys.
  • Copy your API key and replace it in the JavaScript file:
    const apiKey = "YOUR_API_KEY";
  • Make sure to replace "YOUR_API_KEY" in the script with your actual API key for it to work!

File Structure

/weather-app
│
├── index.html            # Main HTML file
├── styles.css            # Styling for the app
├── script.js             # JavaScript file for handling logic
├── images/               # Folder containing weather icons (rain.png, clear.png, etc.)
│
└── README.md             # Project documentation

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

Contact Information

About

A simple weather app that allows users to search for weather by city name. It fetches real-time weather data including temperature, humidity, and wind speed from the OpenWeatherMap API, and displays corresponding weather icons.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published