What it does
This script fetches weather when you run this script in any javascript compiler and placing key from weatherapi provider and adding the required city.
How I built it
It's written in javascript.
Challenges I ran into
- Understanding documentation of weatherApi
What I learned
- I get to know multiple weather data providers online that provide data for free.
What's next for Weather Script
- Fetching multiple days weather.
- Fetching air quality
- Retrieving weather data by adding zip code of a particular city.
<script>
async function postData(url = '') {
const response = await fetch(url, {method: 'GET'});
return response.json();
}
postData('http://api.weatherapi.com/v1/current.json?key=<MY_KEY>&q=NewYork')
.then(data => {
console.log(data);
});
</script>
Log in or sign up for Devpost to join the conversation.