Are there Any Free Weather APIs? Instead of the Static One Provided by Free Code Camp?

Hi folks! How are yall? Are there any free weather APIs that one can use instead of the one that Free Code Camp provides that only displays a static weather result per Shunzeji?? Thanks for the help in advance!

This is my weather app here: https://codepen.io/IDCoder/pen/NwNOgq
I’m tired of seeing my web app with this static weather result!

Oh wow! Aha! Thanks for that tidbit! Back to the drawing board I go!

you can use the government weather api …
here is a bare bones use of it.
Weather Pen

1 Like

@Xiija, it gets the temperature wrong though…it’s like 30 degrees off haha

@camperextraordinaire, I want that wherevever a person is, the weather automatically adjusts for that location, similar to my smartphone.

How can I integrate this into my code to get an entire information readout…city, windspeed, etc…?

if ("geolocation" in navigator) {
  // check if geolocation is supported/enabled on current browser
  navigator.geolocation.getCurrentPosition(
   function success(position) {
     // for when getting location is a success
     console.log('latitude', position.coords.latitude, 
                 'longitude', position.coords.longitude);
   },
  function error(error_message) {
    // for when getting location results in an error
    console.error('An error has occured while retrieving
                  location', error_message)
  }  
});
} else {
  // geolocation is not supported
  // get your location some other way
  console.log('geolocation is not enabled on this browser')
}

`

@camperextraordinaire thanks man!