How to fetch Open Weather API with Javascript

YvonneDev
2 min readOct 20, 2021

Free Weather API in Rapid-API

All you need is to click “test terminal” to registrate the API, there will be your own API Key showing below automatically. And select the language you use, it will generate the code, the only thing you do is copy-paste.

This is the fetch code, now we need to get the latitude and longitude through the window.

Then try to fetch the data from API (copy the code in rapid-API)

replace the key in the quote

Parse the data into json and select.

the data Object in the console:

the location is “data.name”

--

--

YvonneDev
YvonneDev

Written by YvonneDev

❤️Front-end Web Development self-taught *share what I learned*

No responses yet