I am trying to fetch data from this address data source
and am getting errors, the code I am writing is
(function(){
async function GetCovidNumbers(){
const url = "api.opencovid.ca/summary?loc=canada&date=01-09-2020";
//debugger;
const data = await fetch(url);
const response = await data.json();
console.log(response);
}
GetCovidNumbers();
})();
The errors I am getting are
one is giving me a 404 error but if I place the url in the browser then I get the data and the other error is
Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
I have tried adding http:// in front of the url and even https:// and that doesn't work.
So I am obviously doing something wrong, anyone see what it is?