const url =
  "https://weather-by-api-ninjas.p.rapidapi.com/v1/weather?city=delhi";
const options = {
  method: "GET",
  headers: {
    "X-RapidAPI-Key": "ce580959b4msh04ac7f304c1ee24p143e88jsncf6cf022f1d6",
    "X-RapidAPI-Host": "weather-by-api-ninjas.p.rapidapi.com",
  },
};
try {
  const response  = await fetch(url, options);
  const result = await response.text();
  console.log(result);
} catch (error) {
  console.error(error);
}
I was try to fetch weather API from rapidAPI I just copyed the given code to fetch
 
     
    