Uncaught (in promise) when trying Get api

I am trying to recieve temperature from a weather api that has the pathing main.temp with this code.

serviceModule.jsw (backend)

import {fetch} from 'wix-fetch';

export function getCurrentTemp(city) {
 const url = 'http://api.openweathermap.org/data/2.5/forecast?q=';
 const key = 'API-KEY';
 
 let fullUrl = url + city + ',se&appid=' + key + '&units=metric'; 
 
 return fetch(fullUrl, {method: 'get'})
  .then(response => response.json())
  .then(json => json.main.temp);
}

frontend

import {getCurrentTemp} from 'backend/serviceModule';

export function buttonFetchTemp_click(event) {
 getCurrentTemp($w("#textInputCity").value)
  .then(temp => $w("#textTemp").text = temp + "°");
}

I have button and textinput and a text to display the result but when i try it on live. I get that error from earlier and the console error looks like this.

Any idea why?

You say you get the error in Live. Do you get the same error in Preview?

In preview i get this error:
Cannot read property ‘temp’ of undefined. serviceModule.jsw Line 15

Meaning the line in backend

.then(json => json.main.temp);

temp is undefined. But i also think that when trying API calls, it should be on live version. But maybe this helps anyways.

API calls should be OK in Preview. Apparently you aren’t getting a respose from the service.

One issue I can see is that the URL you are calling is http. Please note that Wix only supports https.