A simple, responsive web application that fetches real-time weather data for any city using the WeatherAPI.
- Real-time Data: Fetches live temperature, local time, and location details.
- Asynchronous Logic: Uses
async/awaitto handle API calls without freezing the browser. - Error Handling: Gracefully handles invalid city names or network issues.
- Clean UI: Simple interface for quick weather checks.
- HTML5 & CSS3: For the structure and layout.
- JavaScript (ES6+): For DOM manipulation and logic.
- Fetch API: Used to communicate with the weather service.
- Template Literals: Used for dynamic string injection.
- Clone this repository to your local machine.
- Get a free API key from WeatherAPI.com.
- Open
script.jsand replace'YOUR_API_KEY_HERE'with your actual API key. - Open
index.htmlin your browser.
This project was a great way to practice:
- Working with asynchronous JavaScript and the Fetch API.
- Understanding the request/response lifecycle between a client and a server.
- Managing DOM elements and error states in a professional, commented way.