It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
Has the API changed/stopped working for anyone else? getFilteredProducts returns a 403 unauthorized even after I've logged in. I was using https://github.com/eddie3/gogrepo for months without issue to keep my library backed up. Now it just throws an error. I looked at the code and it's using getFilteredProducts, which USED to work.

Any ideas?
avatar
MatrixRaven: Has the API changed/stopped working for anyone else? getFilteredProducts returns a 403 unauthorized even after I've logged in. I was using https://github.com/eddie3/gogrepo for months without issue to keep my library backed up. Now it just throws an error. I looked at the code and it's using getFilteredProducts, which USED to work.

Any ideas?
It's working fine for me here.
works fine here as well.
The website also still uses this API, they can't really remove it without changing the account section of the website.

maybe an issue with your authorization cookies?
(don't know how gogrepo handles the authorization ..?)
avatar
immi101: works fine here as well.
i take that back.
when running my price scanning script yesterday I got the exact same error. (on a different API)
stlll works in the browser though.
looking at the http error code again, I would hazard a guess that the webserver is missing some HTTP header that pythons requests module isn't setting by default.

But I didn't have time to look further into it.
Just wanted to confirm that seemingly they did indeed change something.
hm, seems it wants a magic cookie

$ curl 'https://www.gog.com/userData.json' --fail --data '{"data":{"product_ids":[1139980926],"series_ids":[]}}'
curl: (22) The requested URL returned error: 403

$ curl 'https://www.gog.com/userData.json' --fail --cookie 'csrf=true' --data '{"data":{"product_ids": 1139980926],"series_ids":[]}}'

{...[data] ... }
avatar
immi101: hm, seems it wants a magic cookie

$ curl 'https://www.gog.com/userData.json' --fail --data '{"data":{"product_ids":[1139980926],"series_ids":[]}}'
curl: (22) The requested URL returned error: 403

$ curl 'https://www.gog.com/userData.json' --fail --cookie 'csrf=true' --data '{"data":{"product_ids": 1139980926],"series_ids":[]}}'

{...[data] ... }
avatar
immi101:
Thanks for this. I'll see if I can edit the script I use so it works. This helps tremendously.
The code is quite helpful. Thank you for your hard work, Yepoleb.

Is there a way to get more than just the last page of orders? web_orders_gogdata() returns only the most recent data and says there are many pages yet. How do I get to them?
avatar
Gede: The code is quite helpful. Thank you for your hard work, Yepoleb.

Is there a way to get more than just the last page of orders? web_orders_gogdata() returns only the most recent data and says there are many pages yet. How do I get to them?
The orders page seems to be using a JSON API for loading additional pages, it looks like this: "https://www.gog.com/account/settings/orders/data?canceled=0&completed=1&in_progress=1&not_redeemed=1&page=2&pending=1&redeemed=1". If you use your browser's dev tools it should be easy to figure out how it works. You can use the GogApi.get_json() method to request the data with a GOG token.
avatar
Yepoleb: I figured out a workaround until we find something better. The on_login_success page does not automatically redirect, so you can have the user manually copy the login code. Open https://auth.gog.com/auth?client_id=46899977096215655&redirect_uri=https%3A%2F%2Fembed.gog.com%2Fon_login_success%3Forigin%3Dclient&response_type=code&layout=client2 and after the redirect there should be a &code= parameter in the url. This is the code to use for a token request. I have an ugly but functioning implementation at https://github.com/Yepoleb/pygogapi/blob/master/gogapi.py#L508
Hi everyone, I am trying to make a website that uses the GOG API, but I can't redirect the user properly to my website after login. I found out that there was this problem in 2017 (see above), but anyone found another workaround ? Copying hte code manually isn't very convenient...
For those already interested in how Galaxy 2.0's community integration will work, docs and code are up here:
https://github.com/gogcom/galaxy-integrations-python-api
https://galaxy-integrations-python-api.readthedocs.io/en/latest/index.html
So far supported platforms appear to be GOG, Steam, Uplay, Origin, Epic, Battle.net, XboxOne, and PSN, going off of this list:
https://galaxy-integrations-python-api.readthedocs.io/en/latest/galaxy.api.html#galaxy.api.consts.Platform
Hi,


I think the endpoint to get the game details from a game ID is dead. Anyone found a workaround?
Im not sure if its right thread to ask, but can you get icons of some game based on its slug, without being logged in?

Im trying to automatically grab icons for everything I install, but since some of them are wine-based, others are native linux versions, and most of them were installed via third party headless tool (innoextract or gogextract.sh) - I thought it will be easier to just wget required stuff, rather than trying to find where its located manually.
avatar
Gekko_Dekko: Im not sure if its right thread to ask, but can you get icons of some game based on its slug, without being logged in?

Im trying to automatically grab icons for everything I install, but since some of them are wine-based, others are native linux versions, and most of them were installed via third party headless tool (innoextract or gogextract.sh) - I thought it will be easier to just wget required stuff, rather than trying to find where its located manually.
You can, but you need the game ID, not its slug.

Use this link:
https://api.gog.com/products/GOG_ID?expand=downloads,expanded_dlcs,related_products,changelog
replacing GOG_ID with the game's ID (usually 10 digits). Among all the information returned by this query, there's an "images" section that includes a link to the icon.
avatar
Gekko_Dekko: Im not sure if its right thread to ask, but can you get icons of some game based on its slug, without being logged in?

Im trying to automatically grab icons for everything I install, but since some of them are wine-based, others are native linux versions, and most of them were installed via third party headless tool (innoextract or gogextract.sh) - I thought it will be easier to just wget required stuff, rather than trying to find where its located manually.
avatar
mrkgnao: You can, but you need the game ID, not its slug.

Use this link:
https://api.gog.com/products/GOG_ID?expand=downloads,expanded_dlcs,related_products,changelog
replacing GOG_ID with the game's ID (usually 10 digits). Among all the information returned by this query, there's an "images" section that includes a link to the icon.
thanks
avatar
mrkgnao: You can, but you need the game ID, not its slug.

Use this link:
https://api.gog.com/products/GOG_ID?expand=downloads,expanded_dlcs,related_products,changelog
replacing GOG_ID with the game's ID (usually 10 digits). Among all the information returned by this query, there's an "images" section that includes a link to the icon.
avatar
Gekko_Dekko: thanks
Do you know what arguments are available for `expand` query string ? I saw mostly used are: downloads,expanded_dlcs,description,screenshots,videos,related_products,changelog

There are more than mentioned ?