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

×
avatar
kohlrak: What about programming language changes?
avatar
WinterSnowfall: It depends, but yes, your mileage may vary. I'm quite happy programming in Python 3 now, having started with 2, for example, so change is not necessarily a bad thing.
Well, i don't see python2 really going away, though. C++, however, that shit is getting old fast. The whole reason i use C++ over assembly (since i'm more of a backend guy) is so i have portability with the future (whether that be running my code on a different platform or just running it again in general). I feel like all the obscure ways i code to try to make the code as easy to refactor as possible (to deal with ever-changing APIs) is completely wasted.

EDIT: Forget what i said
Post edited December 05, 2018 by kohlrak
avatar
WinterSnowfall: And today all entries/games with Chinese language support received the following update:

"languages": {
"cn": "中文",


became:

"languages": {
"cn": "中文(简体)",


Now I have to figure out what installers were actually updated in all this mess. Wish me luck :).
It is obviously a bug.
中文(简体) means Simpilified Chinese, but quite some GOG games only support Traditional Chinese.
中文 includes both Simpilified and Traditional Chinese, which was correct.
As you may have noticed we never properly distinguished Simplified and Traditional Chinese on our game pages. This is something we'd love to, and will, change in the upcoming weeks.

Please note that no game installers were updated in the process of updating our API.
avatar
JudasIscariot: Please note that no game installers were updated in the process of updating our API.
If this mention was prompted by my initial post on the matter, I was referring to the investigative work I do for the "what did just update?" thread. The more updates I detect on a certain day, the more I have to sift through them.

I can confirm that no installers have been affected by this particular update.
avatar
kbnrylaec: It is obviously a bug.
Bug or not, it seems I've overstated the "all" part, since some entries were similarly updated today. It's part of an ongoing process I guess, as Judas mentioned.
I move this question from the Winter Sale thread here or is there a better thread to ask about GOG's APIs?
I'm shooting one-by-one using numerical game ID:
'https://api.gog.com/products/' + str(gameID) + '/prices?countryCode=US'
But where do I get the game ID from when I have the game card URL or slug like "the_witcher_3_wild_hunt_game_of_the_year_edition"?

And is there a way to get a list of the game IDs of all discounted games or all games in the catalog? At the moment I parse the catalog web page (https://www.gog.com/games), but there I also only get game URLs or slugs.
Post edited December 20, 2018 by eiii
avatar
eiii: And is there a way to get a list of the game IDs of all discounted games or all games in the catalog? At the moment I parse the catalog web page (https://www.gog.com/games), but there I also only get game URLs or slugs.
Just query: https://www.gog.com/games/ajax/filtered?mediaType=game&price=discounted and the JSON response will contain all the data you need:

· products: all the discounted games in the first page of results (the 'id' field is what you want in order to then query the regional prices API)
· totalPages: total number of pages with results (you can then repeat the query adding a page=N parameter in order to obtain all the discounted games)


PS: As for obtaining all the games in the catalogue, discounted or not, just remove the price=discounted parameter.
avatar
eiii: But where do I get the game ID from when I have the game card URL or slug like "the_witcher_3_wild_hunt_game_of_the_year_edition"?
You'll find it quite early (at the top level) embedded in the html content. For example, by accessing the store page link you've provided above you'll see something like:

<div class="layout ng-scope" card-product="1640424747">

That's the ID you're looking for.

https://api.gog.com/products/1640424747/prices?countryCode=US

avatar
eiii: I move this question from the Winter Sale thread here or is there a better thread to ask about GOG's APIs?
This is a good place, but you can also always ask grand API master Yepoleb on any of these threads :P :
-> https://www.gog.com/forum/general/unofficial_gog_api_documentation
-> https://www.gog.com/forum/general/gog_database_a_website_that_collects_data_on_gog_games
Post edited December 20, 2018 by WinterSnowfall
avatar
muntdefems: Just query: https://www.gog.com/games/ajax/filtered?mediaType=game&amp;price=discounted and the JSON response will contain all the data you need: [..]
PS: As for obtaining all the games in the catalogue, discounted or not, just remove the price=discounted parameter.
That already answers two of my questions. Thanks!

avatar
muntdefems: · totalPages: total number of pages with results (you can then repeat the query adding a page=N parameter in order to obtain all the discounted games)
Looks like that's the same mechanism as it's used for the HTML pages of the catalog.

avatar
WinterSnowfall: You'll find it quite early (at the top level) embedded in the html content. For example, by accessing the store page link you've provided above you'll see something like:
But that means that I still have to download the HTML page of the game card, which I wanted to avoid. So my only chance would be to cache the game ID / slug combination from game list requests, right?

avatar
WinterSnowfall: This is a good place, but you can also always ask grand API master Yepoleb on any of these threads :P :
Oh, right, I forgot about Yepolebs API thread.
Post edited December 20, 2018 by eiii
avatar
eiii: That already answers two of my questions. Thanks!
You're welcome. :)

avatar
eiii: Looks like that's the same mechanism as it's used for the HTML pages of the catalog.
Yep, the very same. The only difference it's the "/ajax/" infix in the URL, which provides a JSON object as a response to the query.
avatar
muntdefems: The only difference it's the "/ajax/" infix in the URL, which provides a JSON object as a response to the query.
Which of course is more convenient as I do not have to extract the json part from the HTML page first. :)
avatar
eiii: But that means that I still have to download the HTML page of the game card, which I wanted to avoid. So my only chance would be to cache the game ID / slug combination from game list requests, right?
If you're getting the game list, yeah, no point in bothering with the game card any more unless you really need to (I use an XQuery on the game card pages to fetch the developer/publisher for each game, as an example, but I'm not touching the game list, just the products API endpoints which don't provide this info).
Post edited December 21, 2018 by WinterSnowfall
For anyone who might be interested, there was a massive changelog field update either on Monday or Tuesday last week, adding some html formatting elements to each existing changelog in the APIs.

I can only think of one of two reason for doing that: either some changes in Galaxy - to alter how the changelogs are being displayed or will be displayed in future versions, or maybe some changes on the good 'ol GOG website.

If anyone has further insight into this, feel free to chip in.
avatar
WinterSnowfall: For anyone who might be interested, there was a massive changelog field update either on Monday or Tuesday last week, adding some html formatting elements to each existing changelog in the APIs.

I can only think of one of two reason for doing that: either some changes in Galaxy - to alter how the changelogs are being displayed or will be displayed in future versions, or maybe some changes on the good 'ol GOG website.

If anyone has further insight into this, feel free to chip in.
Probably GOG getting ready to de-list a whole bunch of games from their catalogue due to Epic showing up in hundreds of publisher parking lots with dump trucks full of cash and non-compete clauses in their contracts.
avatar
Emob78: Probably GOG getting ready to de-list a whole bunch of games from their catalogue due to Epic showing up in hundreds of publisher parking lots with dump trucks full of cash and non-compete clauses in their contracts.
No need to be a pessimist. I think GOG has its well established niche, even though, ehm... an epicly dark age is ahead.