A simple, responsive Weather App built with Vanilla JavaScript and the OpenWeather API.
Get real-time weather data for any city and learn how to interact with APIs in a clean, structured way.
- Search for any city to get current weather
- Displays temperature, weather description, humidity, and wind speed
- Dynamic UI updates based on API response
- Handles errors and invalid input gracefully
- Built with clean Vanilla JS structure:
- DOM selection at the top
- Functions in the middle
- Event listeners at the bottom
- Learn the right way to handle API keys
Open index.html in your browser and start searching for your favorite cities!
git clone https://github.com/stackquantum1-max/API-weatherApp.git
cd weather-app
Go to OpenWeatherMap Sign up for a free account Go to API Keys and copy your key
Open script.js Replace the placeholder with your own key: const API_KEY = "YOUR_API_KEY_HERE";
Open index.html in your browser Enter a city name and see the weather update dynamically
Querying the DOM and structuring JS cleanly Using fetch() and async/await to get API data Updating the UI dynamically based on API response Handling errors and edge cases properly Best practices for API key security
HTML5 CSS3 Vanilla JavaScript (ES6+) OpenWeather API
Always hide private API keys before sharing your project Keep functions focused: one job per function Use proper error handling to avoid breaking the app