A web app to get weather information based on the user's location or any city name. The app provides detailed weather data including current temperature, feels-like temperature, sunrise and sunset times, wind speed, cloudiness, and humidity.
- Your Weather: Automatically fetches and displays the weather report for the user's current location based on their coordinates.
- Search by City: Allows users to search for the weather of any city by entering the city name.
- Weather Data: Provides the following details:
- Current temperature
- Feels-like temperature
- Sunrise time
- Sunset time
- Wind speed
- Cloudiness
- Humidity
You can view a live demo of the application here.
-
Clone the repository:
git clone https://github.com/tauqueeralam42/weather-web-app.git
-
Navigate to the project directory:
cd weather-web-app
-
Open
index.html
in your browser to run the app.
- Allow location access when prompted by the browser to get weather information for your current location.
- Enter a city name in the search bar to get weather information for a specific city.
This app uses the OpenWeatherMap API to fetch weather data. You need to sign up and get an API key.
- Sign up at OpenWeatherMap.
- Get your API key.
- Replace the
YOUR_API_KEY
placeholder in your JavaScript code with your actual API key:const API_KEY = 'YOUR_API_KEY';
- Use the following endpoints to fetch weather data:
- For current location based on coordinates:
`https://api.openweathermap.org/data/2.5/weather?lat=${lat}&lon=${lon}&appid=${API_KEY}&units=metric`
- For a specific city:
`https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${API_KEY}&units=metric`
- For current location based on coordinates:
Contributions are welcome! Please open an issue or submit a pull request for any changes.
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature-branch
). - Open a pull request.
For any questions or suggestions, feel free to reach out.
- GitHub: tauqueeralam42
- Email:tauqueeralam42@gmail.com