The Weather Facts API is an aggregation service that combines historical facts with current weather data. Given a year, it provides a noteworthy event from that period and, with a city name, it delivers the latest weather forecast. This project is ideal for educational purposes, trivia applications, or as a feature in travel and lifestyle websites.
- Fetches historical facts based on a given year.
- Provides current weather information for a specified city.
To use the Weather Facts API, you will need to:
-
Obtain an API key from OpenWeatherMap.
-
Clone this repository to your local machine.
-
Create a
.envfile in the root of the project and store your OpenWeatherMap API key as follows: let appid = 'YOUR_API_KEY_HERE' -
Replace
your_api_key_herewith the actual API key you obtained.
Follow these steps to set up the API on your local environment:
-
Clone the Repository: git clone https://github.com/masoud112229/Weather-Facts-Api.git
-
Install Dependencies:
- Since this project uses simple HTML, CSS, and JS, no additional installations are necessary unless specific libraries are used.
- Set Up Environment Variables:
- Use the
.envfile to set up your environment variables, as mentioned above.
After setup, open the index.html file in a web browser to interact with the application. Enter a year to get historical facts and a city to get the current weather conditions.
- Historical Facts: Utilizes the
http://numbersapi.comfor fetching facts. - Weather Data: Utilizes the
https://api.openweathermap.orgfor fetching current weather information.
If you wish to contribute to this project, you can:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Make your changes and commit them (
git commit -am 'Add some feature'). - Push to the branch (
git push origin feature-branch). - Create a new Pull Request.
- GitHub: @masoud112229
- Email: masoud.aghayan64@gmail.com
- LinkedIn: Masoud Aghayan
Please feel free to contact me if you have any questions or feedback!
This README was generated with ❤️ by [Masoud]