CORS is blocking my api.steampowered.com request
While I was trying to get information from the "https://api.steampowered.com" API I was getting the error. It looks like steam doesn't grant permissions to my website to read it. I also tried different API keys from different accounts but it didn't work.

Access to XMLHttpRequest at 'https://api.steampowered.com/ISteamUserStats/GetUserStatsForGame/v0002/?appid=730&key=<<MyKEY>>&steamid=<<MySteamID>>' from origin 'https://example.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

At the first 10 days it worked perfecly but now it is showing the error everytime!

My javascript code:

I hope you can help me!
Viimeisin muokkaaja on Nicole; 25.1.2019 klo 14.32
< >
Näytetään 1-7 / 7 kommentista
It seems that you can no longer do Steam API requests directly from a client. What you have to do instead is building a small web server that does your API requests. I'd recommend taking something lightweight like express. Deploy that web server app on the domain you have entered here https://steamcommunity.com/dev/apikey . Now call that web server in your client to get your data.
I am doing the request via my web server which is deployed on my domain. As I said I tried it with different API keys but it doesn't work. I also tried it with different web servers but still the same error...
When I am accessing the JSON file (with the same link as in my javascript) via my browser it shows the the data perfectly.
Had this issue as well and noticed that the steam section of my website[www.zeferinix.com] was not working anymore so I looked around for what might cause it and found this thread. Tried dennis' suggestion and it worked for me.

Basically, call the Steam API from your own web server then have your client call your own web server.
Viimeisin muokkaaja on ZeferiniX; 5.2.2019 klo 4.34
I thought in the wrong direction now it figured it out and it works! Thanks you for your help!
nextRound can you help me please im new in this?
sixty 25.10.2022 klo 18.12 
Nicole lähetti viestin:
I thought in the wrong direction now it figured it out and it works! Thanks you for your help!
how did u made it?
< >
Näytetään 1-7 / 7 kommentista
Sivua kohden: 1530 50

Lähetetty: 25.1.2019 klo 14.32
Viestejä: 7