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

×
Does gog.com have any API(account info, library, wishlist)? OAuth?
avatar
dobrininvv: Does gog.com have any API(account info, library, wishlist)? OAuth?
Of course they do, the site could hardly function as it does without it. It just does not have public documentation. Sude (the person behind lgogdownloader) reverse engineered enough of it to make his program work. I think the basic authentication is OAuth(2?) or something close, the rest is playing catch with ever-changing JSON.
high rated
Here's the documentation that I wrote for the downloader API
GOG API Documentation
There have been some changes to it and I haven't updated the documentation but it should get you started.
You can check lgogdownloader's and [url=https://github.com/Sude-/lgogdownloader/blob/master/src/api.cpp]src/api.cpp for example implementation of the API.

The website does give some responses as JSON for wishlist, account info, library, game info, etc.
lgogdownloader uses few of them to get some information it requires. You can look for those in src/downloader.cpp, just search for gog.com and you'll find the relevant urls.

If I'm not mistaken uses the website API to get the info. [url=http://www.gog.com/forum/general/magog_a_search_engine_for_gog_games/page1]mrkgnao probably knows more about the website API than anyone else.
avatar
dobrininvv: Does gog.com have any API(account info, library, wishlist)? OAuth?
One more thing worthy of note is that GOG announced quite a long time ago that Galaxy would have a documented public API once it was finalized, however that's a long way off yet as it's still heavily in development. When the time comes though it will likely be the best/preferred way to talk to the site, or at least we can hope. :)
high rated
Awesome - thanks, Sude. That helps me a lot.

I'll chip in with a few web api calls that I often find useful

To fetch your wishlist
https://www.gog.com/account/wishlist/search
hasHiddenProducts=false
hiddenFlag=0
isUpdated=0
mediaType (1=games; 2=movies)
page (page number, starts at 1. You may need to make multiple calls to see your entire wishlist)
sortBy (title, date_added, user_reviews)
totalPages (seems to be ignored)

For example, https://www.gog.com/account/wishlist/search?hasHiddenProducts=false&hiddenFlag=0&isUpdated=0&mediaType=0&page=1&sortBy=title&totalPages=1

To fetch your game or movie collection
https://www.gog.com/account/getFilteredProducts
hiddenFlag (0=show only non-hidden; 1=show only hidden)
isUpdated (optional; 0=show all; 1=show only items with new updates)
mediaType (1=games; 2=movies)
page (page number, starts at 1. You may need to make multiple calls to see your entire collection)
sortBy (title, date_purchased, tags, release_date_asc, release_date_desc)
totalPages (seems to be ignored)

For example, https://www.gog.com/account/getFilteredProducts?hasHiddenProducts=false&hiddenFlag=0&isUpdated=0&mediaType=1&page=1&sortBy=title&totalPages=1

To get information about the logged-in user, mainly useful for knowing if there are notifications to display (game updates, messages, forum replies, etc) or if there have been changes to your library or wishlist.
https://www.gog.com/userData.json

To get information about any user, such as username, join date, avatar urls, friend status, chat/wishlist urls, etc
[url=http://www.gog.com/users/info/{{userid}}?expand=friendStatus,wishlistStatus,blockedStatus]http://www.gog.com/users/info/{{userid}}?expand=friendStatus,wishlistStatus,blockedStatus[/url]
Post edited March 18, 2016 by Barefoot_Monkey
avatar
skeletonbow: One more thing worthy of note is that GOG announced quite a long time ago that Galaxy would have a documented public API once it was finalized.
That's interesting. Are you sure? I remember us asking for it, but I don't remember GOG actually promising it. May have missed it.
I was messing with this for a bit and found (although I don't recommend doing it) to download any GOG game, you can use this one:

https://www.gog.com/account/%user%/EnigmaticT/getFilteredProducts?hasHiddenProducts=false&hiddenFlag=0&isUpdated=0&mediaType=1&page=1&sortBy=title&totalPages=1
avatar
skeletonbow: One more thing worthy of note is that GOG announced quite a long time ago that Galaxy would have a documented public API once it was finalized.
avatar
mrkgnao: That's interesting. Are you sure? I remember us asking for it, but I don't remember GOG actually promising it. May have missed it.
Taken from the FAQ at the bottom of the galaxy page:

10. Can we edit, modify, or tweak GOG Galaxy?
If you like to tinker, feel free to start building your own features or even entire clients compatible with GOG Galaxy, assuming you can figure things out right now. We won't actively work against attempts to improve the GOG Galaxy experience, although we can't promise not to break anything as we continue to develop our own tools and infrastructure.
It kind of suggests that they might make an API later.. if you poke around in the files for it there's the HTML and Javascript which you can modify (or possibly learn from).
I haven't had more than cursory poke about to see how possible integrating my script into Galaxy might be though so I don't know what exactly is there or can be done.



And to add to the useful things that you can use;
https://www.gog.com/friends/search
Can be used to retrieve data for a user by their name (including their forum ID, which is different from their Galaxy ID)
I'm not sure if it can be used properly with just a url.. I use it like this in my script:

$.ajax({
type: 'POST',
url: 'https://www.gog.com/friends/search',
contentType: 'application/json; charset=utf-8',
dataType: 'json',
data: JSON.stringify({"query": eventData.data.name})
})
avatar
dobrininvv: Does gog.com have any API(account info, library, wishlist)? OAuth?
Like Sude said, look around MaGog. Anything you find there (except game length) can be obtained from the GOG website.

Ask for any info you need. Preferably, share what you have in mind because there's quite a lot of gotchas when it comes to GOG. Also, maybe something already exists to answer your needs (e.g. Barefoot Essentials or Adalia Fundamentals).
avatar
mrkgnao: That's interesting. Are you sure? I remember us asking for it, but I don't remember GOG actually promising it. May have missed it.
Positive, although I don't have a handy reference for it. Might have been an FAQ, or in the BETA thread, or in a video with Marcin or something, but they specifically promised a public documented API.
avatar
mrkgnao: That's interesting. Are you sure? I remember us asking for it, but I don't remember GOG actually promising it. May have missed it.
avatar
skeletonbow: Positive, although I don't have a handy reference for it. Might have been an FAQ, or in the BETA thread, or in a video with Marcin or something, but they specifically promised a public documented API.
and [url=https://www.gog.com/forum/general/when_do_you_plan_to_publish_galaxy_protocol_specification/post30]no ETA.
avatar
skeletonbow: Positive, although I don't have a handy reference for it. Might have been an FAQ, or in the BETA thread, or in a video with Marcin or something, but they specifically promised a public documented API.
avatar
Gydion: and [url=https://www.gog.com/forum/general/when_do_you_plan_to_publish_galaxy_protocol_specification/post30]no ETA.
I was unable to find the video, but I believe you.
avatar
mrkgnao: I was unable to find the video, but I believe you.
I had a look for the video and couldn't find it. Either I'm too tired, or I'm blind, or TwitchTV has shittastic functionality to search for videos by date range or some other useful way of finding a particular video out of thousands. :)

It was either the very first Galaxy video announcement, or the very first time they mentioned it at E3 or similar after that though.
avatar
mrkgnao: I was unable to find the video, but I believe you.
avatar
skeletonbow: I had a look for the video and couldn't find it. Either I'm too tired, or I'm blind, or TwitchTV has shittastic functionality to search for videos by date range or some other useful way of finding a particular video out of thousands. :)

It was either the very first Galaxy video announcement, or the very first time they mentioned it at E3 or similar after that though.
Yes. I too failed to find it either through Twitch or through Google.

On second thought, it doesn't really matter. It's not as if something that GOG said has any real implication for the future, based on past experience.
avatar
mrkgnao: I was unable to find the video, but I believe you.
Or shmerl in this case. I never actually watched the video myself...