Api returning 404 but the server says it is fine

Hi everyone, I am doing a course on Async JS and I am just now starting with API s so if I am making a simple mistake please point it out.
The server is saying that my key and the URL are correct, so I know the issue is with my function.
Please help, thanks in advance.

// api key PNnISmT0706XkqOp7RWo0fxcAU08R15b
const key = 'PNnISmT0706XkqOp7RWo0fxcAU08R15b' 

const getCity = async (city) => {

     const base = 'http://dataservice.accuweather.com/locations/v1/cities/search';
     // if it starts with a ? it's a query 
     // use backticks to reference another string inside a string 
    const query = `?apikey=${key}&q=${city}`;

    const response = await fetch(base + query);
    const data = await response.json();

//take first posiiton of the array 
return data[0];

};
// this is returning a promise 
getCity('spokane')
.then(data => console.log(data ))
.catch(err => console.log(err));

Please try this solution

It works for me using HTTPS for the URL. BTW, you really shouldn’t be posting your API key in public (might also be a TOS violation). It will likely also make you hit your rate limit much faster.

It’s a free account, worse comes to worse I’ll make a new one.
Thanks for the link, I will look in to it.