Nicole Jan 25, 2019 @ 2:32pm
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!
Last edited by Nicole; Jan 25, 2019 @ 2:32pm
< >
Showing 1-7 of 7 comments
Dennis Jan 31, 2019 @ 2:34am 
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.
Nicole Jan 31, 2019 @ 2:43am 
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...
Nicole Jan 31, 2019 @ 2:46am 
When I am accessing the JSON file (with the same link as in my javascript) via my browser it shows the the data perfectly.
ZeferiniX Feb 2, 2019 @ 10:57pm 
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.
Last edited by ZeferiniX; Feb 5, 2019 @ 4:34am
Nicole Feb 3, 2019 @ 3:30am 
I thought in the wrong direction now it figured it out and it works! Thanks you for your help!
ClimbingPoet Nov 23, 2020 @ 7:48am 
nextRound can you help me please im new in this?
sixty Oct 25, 2022 @ 6:12pm 
Originally posted by Nicole:
I thought in the wrong direction now it figured it out and it works! Thanks you for your help!
how did u made it?
< >
Showing 1-7 of 7 comments
Per page: 1530 50

Date Posted: Jan 25, 2019 @ 2:32pm
Posts: 7