A clean and responsive weather application built using HTML, CSS, and JavaScript that fetches real-time weather data using the OpenWeatherMap API. The app allows users to search for any city and instantly view current weather conditions with a modern UI.
- Real-time weather data using OpenWeatherMap API
- Search weather by city name
- Displays:
- Temperature (°C)
- Weather condition with icon
- Humidity
- Wind speed
- Keyboard support (press Enter to search)
- Error handling for invalid city names
- Responsive and modern UI design
- Clean and readable code structure
- HTML5
- CSS3
- JavaScript (ES6+)
- OpenWeatherMap API
weather-app/
├── index.html
├── style.css
├── weather.js
└── README.md
- User enters a city name in the search bar
- JavaScript sends a request to the OpenWeatherMap API
- API responds with real-time weather data in JSON format
- Data is parsed and displayed dynamically on the UI
- Weather icons are rendered based on API response
git clone https://github.com/your-username/weather-app.git
cd weather-app
Open index.html directly in your browser or use a local development server.
This project uses the OpenWeatherMap API.
- Sign up at https://openweathermap.org/api
- Generate a free API key
- Replace the API key in weather.js:
const apiKey = "YOUR_API_KEY_HERE";
Note: API keys may take a few minutes to activate after creation.
- Delhi
- Mumbai
- London
- New York
- Animated weather backgrounds
- Day/Night theme based on timezone
- 7-day weather forecast
- Location-based weather using Geolocation API
This project is open source and available under the MIT License.