Skip to content

AtharvaThawkar/Weather_API_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒค๏ธ Weather Pro

A sleek, real-time weather dashboard powered by the WeatherAPI.com REST API โ€” built with pure HTML, CSS & JavaScript.

Weather Pro Banner HTML5 CSS3 JavaScript


๐Ÿš€ Live Demo

๐Ÿ”— View Live โ†’


๐Ÿ“ธ Preview

Sunny โ˜€๏ธ Rainy ๐ŸŒง๏ธ Cloudy โ›…
Golden gradient background Blue gradient background Dark gradient background

The background theme dynamically changes based on current weather conditions!


โœจ Features

  • ๐Ÿ” City Search โ€” Search any city worldwide by name or press Enter to search
  • ๐ŸŒก๏ธ Current Weather โ€” Real-time temperature, weather condition, and icon
  • ๐Ÿ’ง Detailed Stats โ€” Feels Like temperature, Humidity %, and Wind Speed (km/h)
  • ๐Ÿ“… 3-Day Forecast โ€” Upcoming weather with daily average temperature and condition
  • ๐ŸŽจ Dynamic Backgrounds โ€” Gradient theme changes automatically based on weather (sunny, rainy, cloudy, snowy)
  • ๐Ÿ“ Default Location โ€” Auto-loads weather for Pune, India on startup
  • ๐Ÿ“ฑ Fully Responsive โ€” Works seamlessly on mobile, tablet, and desktop

๐Ÿ› ๏ธ Tech Stack

Technology Usage
HTML5 Markup & page structure
CSS3 Glassmorphism UI, animations, responsive layout
JavaScript (ES6+) Async API calls, DOM manipulation, dynamic rendering
WeatherAPI.com Live weather data (current + forecast + AQI + alerts)
Google Fonts (Poppins) Typography

๐Ÿ“ก API Reference

This project uses the WeatherAPI.com REST API.

Endpoint used:

GET https://api.weatherapi.com/v1/forecast.json
    ?key=YOUR_API_KEY
    &q={city}
    &days=3
    &aqi=yes
    &alerts=yes

Data consumed:

  • location.name / location.country / location.localtime
  • current.temp_c / current.feelslike_c / current.humidity / current.wind_kph
  • current.condition.text / current.condition.icon
  • forecast.forecastday[].day.avgtemp_c / condition.text / condition.icon

โš™๏ธ Getting Started

Prerequisites

  • A free API key from WeatherAPI.com
  • A modern browser (Chrome, Firefox, Edge, Safari)

Installation

1. Clone the repository

git clone https://github.com/AtharvaThawkar/weather-pro.git
cd weather-pro

2. Add your API key

Open index.html and replace the API key on this line:

const API_KEY = "your_api_key_here";

3. Run the project

Simply open index.html in your browser โ€” no build tools or server required!

# Or use VS Code Live Server for a better dev experience

๐Ÿ“ Project Structure

weather-pro/
โ”‚
โ”œโ”€โ”€ index.html        # Main HTML file (UI + JS logic all-in-one)
โ””โ”€โ”€ README.md         # Project documentation

๐ŸŽจ UI Highlights

  • Glassmorphism design โ€” backdrop blur, semi-transparent cards
  • Smooth transitions โ€” background color shifts on weather change (0.8s transition)
  • Responsive grid โ€” stats and forecast cards reflow cleanly on smaller screens
  • Hover effects โ€” subtle scale animation on the search button

๐Ÿ”ฎ Future Improvements

  • Toggle between Celsius / Fahrenheit
  • Geolocation support โ€” auto-detect user's current location
  • Air Quality Index (AQI) display using existing API data
  • Weather alerts section for severe conditions
  • Hourly forecast chart using Chart.js
  • Store recently searched cities using localStorage

โš ๏ธ Important Note

This project uses a client-side API key which is exposed in the source code. This is acceptable for learning/portfolio projects. For production use, the API call should be routed through a backend server (e.g. Node.js + Express) to keep the key secure.


๐Ÿ‘จโ€๐Ÿ’ป Author

Atharva Pramod Thawkar

  • ๐ŸŽ“ Final Year B.E. IT โ€” SIPNA College of Engineering, Amravati
  • ๐Ÿ’ผ Aspiring MERN Stack Developer | Open to Opportunities
  • ๐Ÿ”— GitHub ยท LinkedIn ยท LeetCode

๐Ÿ“„ License

This project is open source and available under the MIT License.


โญ If you found this project useful, please consider giving it a star! It helps a lot ๐Ÿ™

About

๐ŸŒค๏ธ Real-time weather dashboard using WeatherAPI.com | City search, 3-day forecast, dynamic backgrounds | Built with HTML, CSS & Vanilla JS

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages