A modern, responsive web application that provides real-time air quality data for any location using coordinates. Built with HTML, CSS, and JavaScript, this application fetches air quality information from the RapidAPI Air Quality API.
- Real-time Air Quality Data: Get current air quality information for any location
- Multiple Air Quality Parameters:
- AQI (Air Quality Index)
- CO (Carbon Monoxide)
- NO2 (Nitrogen Dioxide)
- O3 (Ozone)
- PM2.5 (Fine Particulate Matter)
- PM10 (Coarse Particulate Matter)
- SO2 (Sulfur Dioxide)
- Responsive Design: Works seamlessly on desktop, tablet, and mobile devices
- Modern UI: Clean, intuitive interface with gradient backgrounds and smooth animations
- Easy to Use: Simply enter latitude and longitude coordinates to get instant results
Visit the live application: https://merasool.github.io/weather.com/
- A modern web browser (Chrome, Firefox, Safari, Edge)
- Internet connection
- Valid latitude and longitude coordinates
git clone https://github.com/merasool/weather.com.git
cd weather.com- Click the "Code" button on this repository
- Select "Download ZIP"
- Extract the ZIP file to your desired location
- Open
index.htmlin your web browser - Or serve it using a local server:
# Using Python 3 python -m http.server 8000 # Using Node.js (if you have http-server installed) npx http-server
- Navigate to
http://localhost:8000in your browser
-
Enter Coordinates:
- Input the latitude of your desired location
- Input the longitude of your desired location
-
Get Results:
- Click the "check air quality" button
- View the air quality data displayed below
-
Understanding the Results:
- AQI: Overall Air Quality Index (0-500+)
- CO: Carbon Monoxide levels
- NO2: Nitrogen Dioxide levels
- O3: Ozone levels
- PM2.5: Fine particulate matter (≤2.5 micrometers)
- PM10: Coarse particulate matter (≤10 micrometers)
- SO2: Sulfur Dioxide levels
This application uses the RapidAPI Air Quality API. The API key is currently embedded in the code for demonstration purposes.
Important: For production use, you should:
- Get your own API key from RapidAPI
- Store the API key securely (environment variables, server-side, etc.)
- Never expose API keys in client-side code
GET https://air-quality.p.rapidapi.com/history/airquality
lat: Latitude coordinatelon: Longitude coordinate
- HTML5: Structure and semantic markup
- CSS3: Styling, animations, and responsive design
- JavaScript (ES6+): Dynamic functionality and API integration
- RapidAPI: Air quality data service
weather.com/
├── index.html # Main HTML file
├── index.js # JavaScript functionality
├── README.md # Project documentation
└── .gitignore # Git ignore file
- Flexbox layout for centering content
- Mobile-first approach
- Adaptive styling for different screen sizes
- Gradient background (sky blue to light blue)
- Semi-transparent containers with backdrop blur effect
- Smooth hover animations on buttons
- Clean typography with proper spacing
- Form validation for coordinate inputs
- API error handling (can be enhanced further)
- Graceful display of results
- Add location search by city name
- Implement geolocation for automatic coordinate detection
- Add historical air quality data charts
- Include air quality alerts and recommendations
- Add multiple language support
- Implement caching for better performance
- Add unit tests
- Create a mobile app version
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
merasool
- GitHub: @merasool
- Live Demo: https://merasool.github.io/weather.com/
- RapidAPI for providing the Air Quality API
- GitHub Pages for hosting the live demo
- The open-source community for inspiration and resources
⭐ Star this repository if you found it helpful!