List what is in a game's box
const url = 'https://api.thebgdb.org/v1/games/5c9b0f43-7a39-4f0c-8a4e-2f2d2b1d9a77/contents';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/contentsThe components of the game’s box (“1 game board, 170 bird cards, 75 eggs”), as lists read from a source: the components page of one of its rulebooks, the back of its box, or its publisher’s product page. One list per edition, language and source; the original edition first, then the surest lists.
Each list names its edition as /games/{id}/editions does, and says how that edition was found (editionBasis): stated when the source belongs to it (the rulebook filed under it, the back of its box), language when it is the game’s only edition in the list’s language, assumed when nothing said and the original edition was taken. confidence is high when the source names the list as the box’s contents and its quantities read cleanly.
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”Only this edition’s lists: its slug (original) or its id.
A language code such as “en”, “fr” or “pt-BR”.
Only the lists printed in this language.
Responses
Section titled “Responses”The lists, possibly none.
object
object
object
object
object
The rulebook the list was read from (/games/{id}/rulebooks).
The publisher’s page the list was read from.
object
As the source prints it, in its language.
The index in items of the component this one is part of, so totals are not counted twice.
Example
{ "data": [ { "id": "c2f9a7e0-1b3d-4c5e-9f00-2a6b8d4e1f37", "edition": { "id": "2e8eb86c-73f6-4343-a04a-c546debfd484:original", "slug": "original", "name": null, "original": true, "language": null, "publisher": null, "year": null }, "editionBasis": "stated", "language": "en", "source": { "type": "rulebook", "rulebookId": "6f1d2c3b-8a9e-4b7c-9d0e-1f2a3b4c5d6e", "page": 2, "url": null }, "confidence": "high", "items": [ { "quantity": 1, "name": "goal board", "nameEn": "goal board", "detail": null, "partOf": null }, { "quantity": 170, "name": "bird cards", "nameEn": "bird cards", "detail": null, "partOf": null }, { "quantity": 75, "name": "egg miniatures", "nameEn": "egg miniatures", "detail": null, "partOf": null } ] } ]}The language 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
On every refusal over a limit (rate_limited, weekly_limit, coverage_limit): where higher limits are to be had. The same pricing address is in the Link header, with rel="payment".
object
The plans and prices page.
The account page, where a member makes a free API token.
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
On every refusal over a limit (rate_limited, weekly_limit, coverage_limit): where higher limits are to be had. The same pricing address is in the Link header, with rel="payment".
object
The plans and prices page.
The account page, where a member makes a free API token.
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
On every refusal over a limit (rate_limited, weekly_limit, coverage_limit): where higher limits are to be had. The same pricing address is in the Link header, with rel="payment".
object
The plans and prices page.
The account page, where a member makes a free API token.
Example
{ "error": "Game not found", "code": "game_not_found"}