A weather app showing current conditions and forecasts using OpenWeatherMap API with location detection and temperature unit toggle.
- Introduction
- Features
- Technologies Used
- Setup Instructions
- How to Use
- Troubleshooting
- Screenshots
- License
This weather application provides real-time weather data and 5-day forecasts for any location worldwide. Users can search by city or use GPS for automatic location detection. The app displays temperature (with °C/°F toggle), humidity, wind speed, and weather conditions with visual icons. Built with HTML, CSS, and JavaScript, it uses the OpenWeatherMap API and features a clean, responsive design suitable for all devices. Perfect for quick weather checks.
- Current weather conditions
- 5-day forecast
- Location-based weather
- Temperature unit toggle (°C/°F)
- Weather icons
- Responsive design
- HTML5
- CSS3
- JavaScript
- OpenWeatherMap API - Weather data
- Browser Geolocation API - User location detection
- Font Awesome (v6) - Weather icons
- Google Fonts - Typography
- Go to OpenWeatherMap
- Click "Sign Up" and create a free account
- Verify your email address
- Log in and go to the API Keys page
- Generate a new key (takes 10-15 minutes to activate)
- Open
index.htmlin your browser - When prompted, enter your API key
- The app will remember your key for next time
- Create a file named
config.jsin the project folder - Add this line to it:
const API_KEY = 'YOUR_API_KEY_HERE';
- Enter a city name and click "Get Weather"
- Or click "Current Location" to use your GPS
- Toggle between °C/°F using the switch button
❌ "Invalid API Key" error
- Wait 10-15 minutes after generating your key
- Make sure you copied the entire key
- Check for extra spaces in the key
❌ Location not working
- Make sure you've allowed browser location permissions
- Try searching by city name instead
This project is licensed under the MIT License.




