APIVerse icon indicating copy to clipboard operation
APIVerse copied to clipboard

[New API] : Weather API

Open Vi-shub opened this issue 1 year ago • 5 comments

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

  • [X] I follow CONTRIBUTING GUIDELINES of this project.

Vi-shub avatar May 12 '24 19:05 Vi-shub

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.❣️

dishamodi0910 avatar May 12 '24 19:05 dishamodi0910

/gssoc24

Vi-shub avatar May 12 '24 19:05 Vi-shub

@dishamodi0910 Kindly assign it to me

its-kritika avatar May 25 '24 05:05 its-kritika

/gssoc24

Vipullakum007 avatar Jun 01 '24 13:06 Vipullakum007

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.🚀💗

dishamodi0910 avatar Jun 01 '24 13:06 dishamodi0910