dishamodi0910 / APIVerse

APIVerse is a collection of APIs that are useful for developers. It simplifies the process of both adding new APIs and learning how to harness the power of existing ones.
MIT License
79 stars 91 forks source link

[New API] : Weather API #80

Open Vi-shub opened 3 months ago

Vi-shub commented 3 months ago

Brief Description 🤓

Brief Description 🌦️

This API serves as a weather information system, providing users with real-time weather data for different locations. It allows users to retrieve weather forecasts, current conditions, and historical data. Each weather resource has attributes such as temperature, humidity, wind speed, and precipitation.

How will you develop it?🤩

Setting Up Dependencies: The project utilizes Node.js and Express.js framework. We use Axios or a similar library to fetch weather data from external weather APIs like OpenWeatherMap or WeatherAPI.

Defining Sample Data: We start by defining sample weather data for demonstration purposes. In a real-world scenario, this data would be fetched from external weather APIs.

Middleware Setup: We configure Express.js to handle incoming requests and responses, including parsing incoming JSON data and setting appropriate headers.

Routes: We define various routes for accessing weather information:

GET /weather/:location: Retrieves current weather data for a specific location. GET /forecast/:location: Retrieves weather forecast data for a specific location. POST /subscribe/:email: Allows users to subscribe to weather updates for a specific location via email. PUT /unsubscribe/:email: Allows users to unsubscribe from weather updates for a specific location. Handlers for Routes:

GET /weather/:location: Fetches current weather data for the specified location using an external weather API. GET /forecast/:location: Fetches weather forecast data for the specified location using an external weather API. POST /subscribe/:email: Adds the user's email to a subscription list for weather updates. PUT /unsubscribe/:email: Removes the user's email from the subscription list. Error Handling: Proper error handling is implemented to handle cases such as invalid input or failed API requests.

Server Setup: We start the Express server and listen for incoming HTTP requests on a specified port.

Deployment: The API is deployed on a hosting platform like Heroku or AWS for public access.

I follow CONTRIBUTING GUIDELINES of this project.

What do you think of this approach?

@dishamodi0910 please assign this to me under GSSOC24

Deployment

No

Select the open source program you are contributing to

Other

Code of Conduct

dishamodi0910 commented 3 months ago

Greetings @Vi-shub🎀 ! , We are excited to have you dive into another issue with us!🚀 Your involvement in our project has been invaluable, and we're confident that your skills and insights will help us conquer this challenge😇.

Use command /gssoc24 to self assign the issue.

This issue represents an exciting opportunity for us to improve and enhance our project, and we are thrilled to have you on board. We request you to follow CONTRIBUTING GUIDELINES. Looking for your PR soon! In case of any issues, you can contact us on Discord.❣️

Vi-shub commented 3 months ago

/gssoc24

its-kritika commented 3 months ago

@dishamodi0910 Kindly assign it to me

Vipullakum007 commented 2 months ago

/gssoc24

dishamodi0910 commented 2 months ago

Hey @Vipullakum007, The issue is already assigned and couldn't be assigned to you again.You can work on some other issue or create your own issue.🚀💗