Prerequisites
- A free OpenWeatherMap account and API key
- A modern browser (Chrome, Firefox, Safari, Edge)
Get the app running
Clone or download the repository
Clone the repo with Git:Or download the ZIP from GitHub and extract it. The project contains three files:
index.html, script.js, and style.css.Get an OpenWeatherMap API key
- Sign up at openweathermap.org.
- Go to API keys in your account dashboard.
- Copy your default key or generate a new one.
Update script.js with your API key
Open Replace For example, to show weather for London:
script.js. The API URL is defined at the top of the file:q=jaipur with your target city and swap in your own API key:The app defaults to Jaipur (
q=jaipur) with a placeholder key. You must replace the API key before the app will work reliably — the hardcoded key in the source is not guaranteed to be valid.What you should see
Once the app loads, the weather card displays:- Location — the city name returned by the API
- Description — e.g., “light rain” or “clear sky”
- Temperature — in Celsius (converted from Kelvin by the app)
- Humidity — relative humidity percentage
- Wind speed — in meters per second