Check whether a game has rules and a tutorial
const url = 'https://api.thebgdb.org/v1/games/5c9b0f43-7a39-4f0c-8a4e-2f2d2b1d9a77/rules/summary?lang=fr';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.thebgdb.org/v1/games/5c9b0f43-7a39-4f0c-8a4e-2f2d2b1d9a77/rules/summary?lang=fr'A light answer for a game’s page: whether the game has rules in plain words and a step-by-step tutorial in any edition and language, and which to point to. For the rules, the opening of the summary section (or of the first section written) as plain text of up to 300 characters, and how many sections there are; for the tutorial, how many steps. The edition and language shown are the language asked for in the first edition that has it, the original edition first; otherwise the first edition with anything, in English when it can. Read the whole text with GET /games/{id}/rules and GET /games/{id}/tutorials.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The game’s id, as returned in every game object. The game’s slug is accepted too.
Example
5c9b0f43-7a39-4f0c-8a4e-2f2d2b1d9a77Query Parameters
Section titled “Query Parameters”A language code such as “en”, “fr” or “pt-BR”.
The language wanted, or its base language. When no edition has it, the first edition with rules, in English when it can.
Example
frResponses
Section titled “Responses”What the game has; null for what it has not.
object
object
object
object
Its address under the game (GET /games/{id}/editions/{slug}, and on the website /games/{game}/editions/{slug}): language, publisher and year, then a tag that never changes (fr-iello-2019-k3x9q2); original for the original edition. The tag keeps an older address finding the edition after its facts are corrected.
Null for the original edition.
The language it is printed in, when known.
object
The publisher’s product code or SKU, when known.
This edition’s own barcode (EAN-13), when a source states it. Null for the original edition: its barcode is the game’s ean.
The box of this edition (the game’s main cover for the original edition), as in the game’s covers: the same as covers.front. Null when the catalog has none.
object
The front and the back of this edition’s box, each a path on this API (/v1/media/…) when we hold a copy, otherwise null. The back is never a game’s cover.
object
object
object
The language of the rules shown.
How many of the six sections are written in that edition and language.
The opening of the section, as plain text without formatting, cut at a word with an ellipsis.
The section the excerpt comes from: summary when there is one.
Every language the game has rules in, any edition.
How many editions have rules.
object
object
Its address under the game (GET /games/{id}/editions/{slug}, and on the website /games/{game}/editions/{slug}): language, publisher and year, then a tag that never changes (fr-iello-2019-k3x9q2); original for the original edition. The tag keeps an older address finding the edition after its facts are corrected.
Null for the original edition.
The language it is printed in, when known.
object
The publisher’s product code or SKU, when known.
This edition’s own barcode (EAN-13), when a source states it. Null for the original edition: its barcode is the game’s ean.
The box of this edition (the game’s main cover for the original edition), as in the game’s covers: the same as covers.front. Null when the catalog has none.
object
The front and the back of this edition’s box, each a path on this API (/v1/media/…) when we hold a copy, otherwise null. The back is never a game’s cover.
object
object
object
How many steps the tutorial shown has.
Every language the game has a tutorial in, any edition.
How many editions have a tutorial.
Example
{ "data": { "rules": { "edition": { "id": "5c9b0f43-7a39-4f0c-8a4e-2f2d2b1d9a77:original", "slug": "original", "name": null, "original": true, "language": null, "publisher": null, "year": 1995, "productCode": null, "ean": null, "cover": null, "covers": { "front": null, "back": null } }, "language": "en", "sections": 5, "excerpt": "Settle an island: build roads, settlements and cities, trade resources, and be first to 10 victory points.", "excerptSection": "summary", "languages": [ "en", "fr" ], "editions": 1 }, "tutorial": null }}lang is not a language code.
object
What went wrong, in plain English words. The wording may change: act on code.
A stable name for this refusal, for programs and for showing the message in another language. A code is never renamed; new ones may be added.
The numbers the sentence names, when it names any: for example { "max": 20 } with daily_photo_limit.
object
Example
{ "error": "Game not found", "code": "game_not_found"}No game has this id, or it has no such edition.
object
What went wrong, in plain English words. The wording may change: act on code.
A stable name for this refusal, for programs and for showing the message in another language. A code is never renamed; new ones may be added.
The numbers the sentence names, when it names any: for example { "max": 20 } with daily_photo_limit.
object
Example
{ "error": "Game not found", "code": "game_not_found"}Too many requests, or too many of these sent today (code says which).
object
What went wrong, in plain English words. The wording may change: act on code.
A stable name for this refusal, for programs and for showing the message in another language. A code is never renamed; new ones may be added.
The numbers the sentence names, when it names any: for example { "max": 20 } with daily_photo_limit.
object
Example
{ "error": "Game not found", "code": "game_not_found"}