Texts and images to credit
const url = 'https://api.thebgdb.org/v1/credits?kind=text&limit=100&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/credits?kind=text&limit=100&lang=fr'What a Wikimedia licence asks us to credit: descriptions taken from Wikipedia (CC BY-SA) and covers from Wikimedia Commons under a licence asking for credit (CC BY, CC BY-SA). Facts from Wikidata are CC0 and need no credit. Nothing else is listed. One entry per text or image, ordered by the game’s main name; a game with both has its text first. Show the source, the licence and the author wherever you reuse them. The website lists the same at https://thebgdb.org/credits.
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Only texts, or only images. Both when absent.
The nextCursor of the previous page.
A language code (BCP 47) such as “fr”, “ja” or “pt-BR”. A game that has a name in that language is returned with it as name, and its main name as originalName; a regional code falls back on its language (“fr-CA” on “fr”), a language with no name of its own takes a regional one (“pt” shows a name the game only has in “pt-BR”), and a game with no name in the language keeps its main name. A game that has a cover of its own in that language (the box of its French edition) is returned with it as image; otherwise image is its main cover. Only names and covers are localised: descriptions and summaries stay in English.
Example
frResponses
Section titled “Responses”A page of credits.
object
object
text: the game’s description, from Wikipedia. image: the game’s cover, from Wikimedia Commons.
object
The game’s main name, or its name in the language asked for with lang.
The Wikipedia article the text was taken from, or the Wikimedia Commons page of the image. Null when no such page is on record. No other source is ever named.
The Wikipedia article’s title or the image’s file name. Null when the address does not give one.
The licence, by its short name.
The licence’s deed. Null when the short name does not say which version.
The author to name, as the source names them. Null when the source names nobody (Wikipedia texts are credited to the article): credit the source itself.
How many credits match.
Pass as cursor to get the next page. Null on the last page.
Example
{ "data": [ { "kind": "text", "game": { "id": "5c9b0f43-7a39-4f0c-8a4e-2f2d2b1d9a77", "slug": "catan", "name": "Catan" }, "sourceUrl": "https://en.wikipedia.org/wiki/Catan", "sourceTitle": "Catan", "license": "CC BY-SA 4.0", "licenseUrl": "https://creativecommons.org/licenses/by-sa/4.0/", "author": null } ], "total": 1, "nextCursor": null}kind or cursor is not an accepted value, or 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"}Over a request limit. rate_limited: without a token, 60 a minute and 2,000 a UTC day per address (more with a token; see Limits above). weekly_limit: the week’s requests or game details are used up (params.max is the cap). The retry-after header says how many seconds to wait: 60 for a minute’s limit, until midnight UTC for a day’s, until Monday 00:00 UTC for a week’s.
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"}