Features:
- Auto Fetch Weather using IP's Location.
- Unlimited API Calls.
- Weather Forecasts (Next Ten Days).
- Fetch Weather From Location (City Name).
- Fetch weather From Geo Location (Lat & Lon).
- Open Source So Deploy Your Own.
- Totally Free of Cost.
Automatically fetch weather from IP's Location (Only works if server & client connects directly [No Proxy]):
https://[YOUR-URL]/auto
##ex
https://7ajk43.deta.dev/auto
Manually Fetch weather From Location:
https://[YOUR-URL]/location/{PLACE-NAME}
##ex
https://7ajk43.deta.dev/location/kolkata
Fetch weather From GEO Location:
https://[YOUR-URL]/geolocation/{Latitude}/{Longitude}
##ex
https://7ajk43.deta.dev/geolocation/22.54994/88.371582
{
"status": true,
"weather_info": {
"location": {
"city": "Kolkata",
"region": " WB",
"woeid": 2295386,
"country": "India",
"lat": 22.54994,
"long": 88.371582,
"timezone_id": "Asia/Kolkata"
},
"current_observation": {
"wind": {
"chill": 26,
"direction": 225,
"speed": 11
},
"atmosphere": {
"humidity": 63,
"visibility": 16.1,
"pressure": 1009,
"rising": 0
},
"astronomy": {
"sunrise": "5:59 am",
"sunset": "5:40 pm"
},
"condition": {
"text": "Sunny",
"code": 32,
"temperature": 26
},
"pubDate": 1614481200
},
"forecasts": [
{
"day": "Sun",
"date": 1614450600,
"low": 20,
"high": 35,
"text": "Sunny",
"code": 32
},
# More
]
}
}
1. Create an App for Yahoo Weather API ๐
- Open this Url
https://developer.yahoo.com/weather/
- Go to
'Get your API Keys'
section and click'Create an App'
. - Give a Name of it.
- Application Type will be
'Web Application'
. - Give any URL in
'Redirect URI(s)'
. 'API Permissions'
will be default.- Now click on
'Create App'
. - You will get
'App ID' & 'Client ID' & 'Client Secret'
in next page.
2. Deploy the API:
Deploy to VPS or Local Machine ๐ NodeJS & Npm are Required.
apt install npm
apt install nodejs
git clone https://github.com/cachecleanerjeet/weather-api.git
cd weather-api
//edit config.js
nano config.js
//after that add your api credentials
npm install
node main.js
- This Project is Apache-2.0 Licensed
- Copyright 2021 by Tuhin Kanti Pal