Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather Facts API

About

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.

Features

  • Fetches historical facts based on a given year.
  • Provides current weather information for a specified city.

How to Use

To use the Weather Facts API, you will need to:

  1. Obtain an API key from OpenWeatherMap.

  2. Clone this repository to your local machine.

  3. Create a .env file in the root of the project and store your OpenWeatherMap API key as follows: let appid = 'YOUR_API_KEY_HERE'

  4. Replace your_api_key_here with the actual API key you obtained.

Installation & Setup

Follow these steps to set up the API on your local environment:

  1. Clone the Repository: git clone https://github.com/masoud112229/Weather-Facts-Api.git

  2. Install Dependencies:

  • Since this project uses simple HTML, CSS, and JS, no additional installations are necessary unless specific libraries are used.
  1. Set Up Environment Variables:
  • Use the .env file to set up your environment variables, as mentioned above.

Usage

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.

API Reference

  • Historical Facts: Utilizes the http://numbersapi.com for fetching facts.
  • Weather Data: Utilizes the https://api.openweathermap.org for fetching current weather information.

Contributing

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.

Contact

Please feel free to contact me if you have any questions or feedback!


This README was generated with ❤️ by [Masoud]

About

A service combining historical facts with real-time weather data. Users can learn about a year’s significant events and a city’s current weather. Ideal for educational, trivia, and travel platforms.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages