B
B
BonBon Slick2017-06-24 15:38:26
PHP
BonBon Slick, 2017-06-24 15:38:26

Steam Web API get user's game wishlist?

The url by which you can get your wish list tyk
The fact is that you need to get a list of the current user's desired games on the site, however, this request only works if you type it into the browser's address bar.
This code will return empty if called on the server:

json_decode(file_get_contents('http://store.steampowered.com/dynamicstore/userdata/');

Will return:
{#485
  +"rgWishlist": []
  +"rgOwnedPackages": []
  +"rgOwnedApps": []
...

Of course, you can consider crutches, by type, before sending data to the server, send a request to this address, it will go as from the current user, in theory, it will have to return a wishlist, and then send a request with a list. So far, I haven't come up with anything better. Or dig more curl_setopt settings, maybe there is something there, and you can somehow send a request.
Alas, adjax, and any front request gives a CORS error , you can't pull out a wishlist...
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin

Apparently, Cookies are used, that is, I can only see my wishlist, at least without tricks. It will not be possible to send a request from the server, since we do not know what cookies the user has. Therefore, he must personally send the request, and here we are faced with CORS protection. I set the ajax request settings, like the server itself, etc. By type header....contentTpye for ajax, in general, the first page of Google on "ajax CORS". Nothing helped.
How to make it work, safe?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question