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
coreydd: I'm far from a competent programmer, but I'm trying my hand at some crawling. Does anyone know how to convert the globalReleaseDate to a human-readable form? I can't figure out the conversion. It doesn't seem to be an offset, so I just don't know, and there's nothing I can find in a pretty extensive search. Thanks!
Let me check the datetime format...

From https://api.gog.com/v2/games/1295420179

title: "BEAUTIFUL DESOLATION",
globalReleaseDate: "2020-02-26T00:00:00+02:00"

Um, how is that not human readable? The game was released on the 26th February 2020 on midnight CEST.

This is a standard daytime format the is easily readable for machines as well as humans. If you don't know how to read it: First there is the date in year-month-day with year having 4 digits and month and day 2 digits with leading 0 if neccessary. That is followed by a capital T which separates the time from the date and the time in hour:minute:second format. This is in 24h format and also with leading zeroes, so time ranges from 00:00:00 to 23:59:59. And the last part is the offset to UTC if you don't enter the time in UTC. +02:00 means UTC + 2 hours which is CEST (Central European Summer Time).

Though midnight CEST seams to be a placeholder in my eyes I wouldn't count on the time to be correct. It's probably just supposed to mean the game was released on the 26th February 2020.

P.S.: Any modern programming language should be able to interpret this string and make a datetime object out of it.
avatar
coreydd:
HAMMER TIME



it's unix time
api.gog.com/discover_games/new

The URL's JSON page shows 10 latest new arrivals not by release date. By what and how to do it less limited, like 100 or more?

I tired to poke the API with a stick, no luck so far, like I am missing an important detail. This should not be ordered by official "release date," I am searching for the value showing only buyable products in the order of arrival on GOG Store, preferably without DLCs. I am not aware there is such a sort option. The target is to then parse and add to an RSS reader. I am afraid 10 might lead to me missing newcomers.
Post edited July 16, 2022 by IndefiniteRoll
avatar
IndefiniteRoll: The URL's JSON page shows 10 latest new arrivals not by release date. By what and how to do it less limited, like 100 or more?
You can't, from what I can tell. It's what the main page uses to list the 10-sized subsections and looks hardcoded on the last 10 entries + a redirect to the catalog API for more.

And yes, the "released on GOG date" is not a sort option for the catalog API unfortunately. It will only use the publisher-declared/official game release date to sort. On the positive side all the new entries are indeed there in the list under releaseStatuses=new-arrival.

[url=https://catalog.gog.com/v1/catalog?limit=48&releaseStatuses=in:new-arrival&order=desc:releaseDate&productType=in:game,pack,dlc,extras&page=1]https://catalog.gog.com/v1/catalog?limit=48&releaseStatuses=in:new-arrival&order=desc:releaseDate&productType=in:game,pack,dlc,extras&page=1[/url]

You can tweak the limit on this endpoint.

P.S.: There's also this endpoint, which may be removed soon however, since it's no longer used by the website, that actually does preserve the released on GOG order:

https://www.gog.com/games/ajax/filtered?availability=new&mediaType=game&page=1&sort=date
Post edited July 16, 2022 by WinterSnowfall
I see. Thank you!
Hi guys,

I'm trying to use the price range query param in this GET request:
gogapidocs DOT readthedocs DOT io SLASH en SLASH latest SLASH listing DOT html

but i still don't understand how to use it. I'd like to send a min and max value. Is there a possible way to do it?

And another question: Is it smart to use this endpoint? I've already seen newer ones but I can't use a search string on them.

Thx alot

Medy
avatar
medy94: I'm trying to use the price range query param in this GET request:
gogapidocs DOT readthedocs DOT io SLASH en SLASH latest SLASH listing DOT html
That API endpoint was used by the old game search page and I'm surprised it still works.

You're better off with what the current game search page uses, which is the "catalog" API. If you want to search for titles in a particular price range for, let's say euros, simply do:

[url=https://catalog.gog.com/v1/catalog?price=between:0,100&countryCode=DE&locale=en-US&currencyCode=EUR]https://catalog.gog.com/v1/catalog?price=between:0,100&countryCode=DE&locale=en-US&currencyCode=EUR[/url]

How can you figure out such black magic? It's simple really... go on the search page (Browse All Games), set the query you want in the UI and enter developer mode in the browser of your choice. Monitor the outgoing backend queries for the win.
Post edited August 01, 2022 by WinterSnowfall
Hi folks. I want to get a list of my owned games using Python. I read a bit about the api but can't get to it.

I know, that I can access this info via embed.gog.com/user/data/games. But that requires, that I am logged in. Is there a way I can authenticate using Python so I can request the mentioned url?

Thanks for any pointers.

Frank
avatar
FrankBlack78: Is there a way I can authenticate using Python so I can request the mentioned url?
No point to reinvent any wheels, so here's some inspiration ;).

P.S.: Or there's even this, if you want a shameless copy-paste.
Post edited September 07, 2022 by WinterSnowfall
Thanks, WinterSnowfall. That looks way more complicated than Steam, were I can just apply for an web api key and authenticate and request with just one line: requests.get(<steam_url>).

There is no way to do this with GOG, isn't it?

Just to be clear, I don't want to download any game-files, just the titles of the games I own. The pointers you sent me seem to accomplish way more than just that and I am not sure if I am able to extract the relevant information. Besides of that, thank you anyways.

Frank
avatar
FrankBlack78: Just to be clear, I don't want to download any game-files, just the titles of the games I own.
Got that, but you'll have to be logged in to use any user-specific API calls, so you still have to go through the login process, sadly. This method is what you need to follow mostly, though it's a bit over-engineered and deals with corner cases as well.

avatar
FrankBlack78: Thanks, WinterSnowfall. That looks way more complicated than Steam, were I can just apply for an web api key and authenticate and request with just one line: requests.get(<steam_url>).
I believe you only get an API key here if you're a Galaxy dev (game dev working with Galaxy), not as a regular user, so yeah...
Post edited September 07, 2022 by WinterSnowfall
Thank you. I really appreciate your help.
I read about the auth-process in the docs but didn't know how to execute it. I will take a look in the mentioned function. Thank you.

Frank
Hey guys,

I got a question. Is there a way to get the horizontal/vertical cover image from catalog/v1 API in a lower size or lower resolution?

And how to handle the Screenshots URL. I get this URL from API:
HTTPS.... a40e78d866b6fe290af81f439e82daa7d0de6ac9b0c49ad182e80af584c9d582_{formatter}.jpg

How to use the {formatter} tag? I already tried a lot and searched in this forum, but I can't find how to use it.
Post edited September 21, 2022 by medy94
avatar
medy94: Hey guys,

I got a question. Is there a way to get the horizontal/vertical cover image from catalog/v1 API in a lower size or lower resolution?

And how to handle the Screenshots URL. I get this URL from API:
HTTPS.... a40e78d866b6fe290af81f439e82daa7d0de6ac9b0c49ad182e80af584c9d582_{formatter}.jpg

How to use the {formatter} tag? I already tried a lot and searched in this forum, but I can't find how to use it.
Here is an example from UT 2004 (I cut down the JSON to the interesting bits):

{
"id": 1207658691,
"title": "Unreal Tournament 2004 Editor's Choice Edition",
"screenshots": [
{
"image_id": "de2a58c68c63b5a60603394ab8fdb4c66810807671d5985bce958c566a02ef08",
"formatter_template_url": "[url=https://images-4.gog-statics.com/de2a58c68c63b5a60603394ab8fdb4c66810807671d5985bce958c566a02ef08_{formatter}.png]https://images-4.gog-statics.com/de2a58c68c63b5a60603394ab8fdb4c66810807671d5985bce958c566a02ef08_{formatter}.png[/url]",
"formatted_images": [
{
"formatter_name": "ggvgt",
"image_url": "https://images-3.gog-statics.com/de2a58c68c63b5a60603394ab8fdb4c66810807671d5985bce958c566a02ef08_ggvgt.jpg"
},
{
"formatter_name": "ggvgt_2x",
"image_url": "https://images-2.gog-statics.com/de2a58c68c63b5a60603394ab8fdb4c66810807671d5985bce958c566a02ef08_ggvgt_2x.jpg"
},
{
"formatter_name": "ggvgm",
"image_url": "https://images-2.gog-statics.com/de2a58c68c63b5a60603394ab8fdb4c66810807671d5985bce958c566a02ef08_ggvgm.jpg"
},
{
"formatter_name": "ggvgm_2x",
"image_url": "https://images-2.gog-statics.com/de2a58c68c63b5a60603394ab8fdb4c66810807671d5985bce958c566a02ef08_ggvgm_2x.jpg"
},
{
"formatter_name": "ggvgl",
"image_url": "https://images-2.gog-statics.com/de2a58c68c63b5a60603394ab8fdb4c66810807671d5985bce958c566a02ef08_ggvgl.jpg"
},
{
"formatter_name": "ggvgl_2x",
"image_url": "https://images-4.gog-statics.com/de2a58c68c63b5a60603394ab8fdb4c66810807671d5985bce958c566a02ef08_ggvgl_2x.jpg"
}
]
},
...

Instead of using formatter_template_url you could simply parse the formatted_images for each screenshot which contains all size variations and use Image_url to get the screenshot of the variation you want if you don't mind getting a .jpg. If you want the original .png you get the formatter_name of the desired variation and replace the string {formatter} in the formatter_template_url with the formatter_name.

So you get this url for example.
Post edited September 21, 2022 by Geralt_of_Rivia
avatar
medy94: How to use the {formatter} tag? I already tried a lot and searched in this forum, but I can't find how to use it.
The way I figure out formatters is to just visit gog pages with images in them and take the formatter string from the end of the image URLs. They work for every image.