Skip to content

Open app

Game images

A game in the catalog can have an image in six fixed sizes, as PNG and WebP. Your server reads the image configuration and each game’s image fields from the API. Your client then loads the file from a public URL that you build from those values.

The set of files differs from game to game: every size in both formats, some of them, or no image at all. Keep your own fallback image for every size and format that a game does not have.

What your server reads and what your client loads

Section titled “What your server reads and what your client loads”
Step Who Request API key
1. Read the image configuration Your server GET /v1/images/config Required, with the read scope
2. Read a game’s image fields Your server GET /v1/games or GET /v1/games/{game_id} Required, with the read scope
3. Load the image file Your client, a browser or an app GET on the URL you built None

Your API key stays on your server. Pass the configuration and the image fields, or the finished URLs, to your client. Never put the key in browser or app code. Never send an Authorization header to the image host. The image files are public.

Call GET /v1/images/config from your server. The call takes no parameters.

Terminal window
curl -s "<API base URL>/images/config" <<EOF \
--header @-
Authorization: Bearer ${AGGREGATOR_API_KEY:?Set the issued key in the protected environment}
EOF

<API base URL> is the base URL shown in your cabinet. It already ends with /v1, the prefix written in the paths on this page.

A successful response:

{
"hosts": ["https://<image host>"],
"path": "/i/{slot}/{image_key}.{format}",
"slots": {
"s1": {"width": 236, "height": 110},
"s2": {"width": 337, "height": 181},
"s3": {"width": 380, "height": 380},
"s4": {"width": 190, "height": 190},
"s5": {"width": 316, "height": 425},
"s6": {"width": 427, "height": 575}
},
"formats": ["png", "webp"]
}

<image host> stands for the host name that your own response returns.

Field Type Description
hosts array of strings Where the image files are served from, in order of preference. Each entry starts with https:// and has no trailing slash.
path string The path template. It is always /i/{slot}/{image_key}.{format}.
slots object The sizes that can exist. Each key is a slot name. Each value holds width and height in pixels.
formats array of strings The file formats that can exist: png and webp.

All four fields are always present and never null. The six slots are:

Slot Width Height Shape
s1 236 110 Wide
s2 337 181 Wide
s3 380 380 Square
s4 190 190 Square
s5 316 425 Tall
s6 427 575 Tall

slots and formats list what can exist, not what exists for one game. One game can have all six sizes or some of them, in one or both formats. You find out by requesting the file: the image host answers 404 for a size or format that the game does not have.

Only these six sizes exist.

How long to keep the configuration:

  • A successful response carries Cache-Control: private, max-age=300. That is five minutes.
  • Read the configuration when your server starts. Keep it in memory and refresh it on a timer.
  • A five-minute timer matches the header. Never keep a copy for longer than one hour.
  • Never cache a failed response.
  • Never hard-code the image host in a web or app build. Always take it from hosts.
  • The response does not depend on which of your keys reads it. One cached copy is enough.

Use the first entry of hosts. If the list has more entries and an image fails to load, try the next one. Treat an empty list like a failed read.

Step check: the call returns 200 with all four fields, and hosts has at least one entry.

Both catalog calls return the same game object. It is each item of games in GET /v1/games, and game in GET /v1/games/{game_id}. Three of its fields describe the image. The example shows only those three and the game id:

{
"id": "d4f7a2b1-3c8e-4f5a-9b6d-1e2f3a4b5c6d",
"image_key": "studio/Category/Game94",
"image_rev": "1234abcd",
"has_art": true
}
Field Type Description
image_key string or null Identifies the game’s image files. It is case-sensitive and contains /. It is null when the game has no image.
image_rev string or null The revision of the published files: eight characters from 0-9 and a-f. It is null exactly when image_key is null.
has_art boolean true when the image is the game’s artwork. false for a title card, and for a game with no image.

What each combination means:

image_key and image_rev has_art Meaning What to show
Both set true The game has artwork. The image.
Both set false A title card: a generated image that already shows the game name, usually with the studio name. The image. Put no text of your own over it.
Both null false The game has no image. Your fallback.
Missing from the object Missing The same as null. Your fallback.

No other combination occurs. The key and the revision are always set together. has_art is never true without a key.

The three fields can also be missing from the game object. Treat a missing field exactly like null.

has_art: true does not mean that every size and format exists. A set key says only that the game has an image.

The URL is the host, the path template with three values filled in, and the revision as the v query parameter.

{host}/i/{slot}/{image_key}.{format}?v={image_rev}
Part Where it comes from
{host} The first entry of hosts in the configuration.
{slot} A key of slots, for example s3.
{image_key} The game’s image_key, unchanged.
{format} A value of formats: png or webp.
v The game’s image_rev. The parameter is named v, not rev and not image_rev.

For the game above, the square WebP image is:

https://<image host>/i/s3/studio/Category/Game94.webp?v=1234abcd

Rules for the key:

  • Take the key from the catalog. Never build it from the game name, the game id or provider_game_id.
  • Insert it unchanged. Keep its case, and keep every / as a path separator.
  • Do not percent-encode it. encodeURIComponent would turn each / into %2F and break the URL.
  • A key has two to four segments separated by /. No segment is . or ...
  • The first segment uses lowercase letters, digits, _ and -.
  • The other segments use letters in either case, digits, ., _ and -.
  • Treat the key as opaque. Do not read meaning into its segments.

A function that returns the URL, or null when you must show your fallback:

type ImagesConfig = {
hosts: string[];
path: string;
slots: Record<string, { width: number; height: number }>;
formats: string[];
};
type GameImageFields = { image_key?: string | null; image_rev?: string | null };
function gameImageUrl(
config: ImagesConfig | null,
game: GameImageFields,
slot: string,
format: string,
): string | null {
const host = config?.hosts[0];
if (!config || !host || !game.image_key || !game.image_rev) return null;
if (!Object.hasOwn(config.slots, slot) || !config.formats.includes(format)) return null;
const path = config.path
.replace("{slot}", slot)
.replace("{image_key}", game.image_key)
.replace("{format}", format);
return `${host}${path}?v=${game.image_rev}`;
}

Load the URL with a plain GET and no Authorization header. If your site sets a Content Security Policy, allow the entries of hosts in img-src.

Every file has exactly the pixel size of its slot. Transparency varies between images, so put a background behind the image.

Step check: take a game with a set image_key and request every size in both formats. Your client shows the image on 200 and your fallback on 404.

Image files are served with Cache-Control: public, max-age=86400. Browsers and other caches can keep a file for up to one day.

image_rev identifies the published files of a game. It stays the same while the files stay the same. A new image appears with a new revision.

The file path does not change when the image changes. The v parameter is what makes a cache fetch the new file.

  • Put ?v= with the current image_rev on every image URL.
  • In a native app, make the revision part of your image cache key.
  • Without v, a client can keep showing the old image for up to one day.
  • v only separates cache entries.

You learn about a new revision from the catalog. Refresh your copy of the catalog at least once a week. When a game’s image_rev changes, build its URLs again with the new value.

Situation How you see it What to do
The game has no image image_key is null or missing Show your fallback.
This size or format does not exist The image URL answers 404 Show your fallback. You can try the other format or another size first.
The image fails to load A network error, a timeout or another status Try the next entry of hosts if there is one. Then show your fallback.
You have no configuration The configuration call fails, or hosts is empty Show your fallback for every game. Read the configuration again later.
  • A 404 for one file says nothing about the others. Another size or the other format of the same game can exist.
  • After a 404, read that game from the catalog again. A newer revision may be there. If image_rev is unchanged, keep your fallback for that file.
  • The image host does not answer with the API’s JSON error body. Decide by the HTTP status alone.
  • Never leave a broken image in your lobby.
  • An image that loads does not mean the game can be launched. Decide what to list from the catalog, never from the image host.
  • Your fallback can be your own placeholder or the game’s thumbnail_url.

Every game object carries thumbnail_url. The image fields do not replace it and do not change its value. A client that reads only thumbnail_url keeps working.

thumbnail_url image_key, image_rev, has_art
What it holds A string: empty, one URL, or a text map of size names to URLs A key and a revision that you turn into a URL
Sizes Not fixed. They differ from game to game Six fixed sizes
Formats Not fixed PNG and WebP
Cache refresh None The revision in the v parameter

The text map looks like {'512x512': '<URL>', '300x300': '<URL>'}. It is usually written with single quotes, so a JSON parser can reject it. Write your parser to accept all three shapes.

How the two live side by side:

  • Use the image fields when image_key is set.
  • Use thumbnail_url or your own placeholder when the key is not set, or when a file answers 404.
  • thumbnail_url does not promise any of the six sizes.
  • You choose when to move to the image fields. The two sets of fields do not depend on each other.
HTTP Code Meaning What to do
401 invalid_token The key is missing or not accepted. Fix the key or the Authorization header. Do not retry.
403 insufficient_scope The key lacks the read scope. Use a key that has read. Do not retry.
404 not_found Your key and its read scope are accepted. Show your fallback. Ask again at your next refresh.
503 images_unavailable Your key and its read scope are accepted. Show your fallback. Retry with backoff.

401 and 403 use the flat key-error body, with the code in a top-level error string. See Errors.

404 and 503 use a nested error object. Its code is a word, not an E number:

{"error": {"code": "not_found", "type": "not_found", "message": "Not found"}}
  • Match on the HTTP status and the code. Never match on message.
  • 404 and 503 carry Cache-Control: no-store. Do not cache them.
  • The API checks the key and its scope first. A 404 or 503 therefore means your key was accepted.
  • Rate limiting and the other shared errors work as on every API call. See Errors and Rate limiting.