After some digging I found a Steam API that actually gets me data, I was trying to build a Steam clone but I can’t access any of the data through a Fetch (I can paste the link in my browser and it’ll show the JSON data).
fetch('https://store.steampowered.com/api/appdetails?appids=420', {
mode: 'cors' ,
headers: {
'Access-Control-Allow-Origin':'*'
},
})
.then(response => response.json())
.catch(error => console.error(error));
I tried changing the mode to ‘no-cors’ but same error.
Admittedly, I’m new with working with APIs and after an hour of googling around for fixes to this CORS policy error, I couldn’t get anything to work.
Also, if there’s a better Steam API out there for the storefront and individual games, I’d be very interested.