const url = ' https://api.thebgdb.org/v1/index/games?lang=fr&order=name&limit=500 ' ;
const options = {method: ' GET ' } ;
const response = await fetch ( url , options );
const data = await response . json ();
--url ' https://api.thebgdb.org/v1/index/games?lang=fr&order=name&limit=500 '
Names only, in alphabetical order unless order says otherwise, up to 500 per call: what an A to Z index or a list of a year’s games needs. Counts as one request for every 25 names limit asks for. Use /games for full summaries. With lang set to de, es, fr, it or pt (or a regional code of one: pt-BR files as pt), each game is filed, ordered and shown under its name in that language (name; the main name is originalName), or its main name when it has none in the language: “Nome in codice” (Codenames) is under N in Italian. With any other lang (ja included), the name in the language is shown but the letter and the order stay those of the main name. Either way a game is under exactly one letter per language.
lang
string
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.
letter
string
/^[A-Za-z0]$/
Only games whose name starts with this letter (A to Z, case ignored), the name in the language of lang as described above. The first letter is read as written, articles included (“Les Aventuriers du Rail” is under L), and an accented letter counts as its plain letter. 0 gives the names that start with anything else.
year
integer
>= -4000 <= 2100
Only games first published this year.
order
string
default: name
Allowed values: name popular famous
name alphabetical. popular ranked games first, best rank first, then the best known (the measure of order=popular on GET /games), then by name. famous the most awards won first, then the most members’ ratings, then the best known, then by name.
limit
integer
default: 500 >= 1 <= 500
cursor
string
The nextCursor of the previous page.
Media type application/json
object Array<object>
object The name in the language asked for with lang, when the game has one; its main name otherwise.
string
The main name, which decides the letter and the order, when name is a translation of it.
string | null
How many games match in all.
integer
Pass as cursor to get the next page. Null on the last page.
string | null
Example
"id" : " 6c45ac28-4841-43f5-a1b3-59ea01e63f16 " ,
letter, year or cursor is not valid.
Media type application/json
object What went wrong, in plain English words. The wording may change: act on code.
string
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.
string
Allowed values: not_found request_too_large catalog_busy internal_error rate_limited weekly_limit missing_address invalid_token invalid_lang invalid_cursor invalid_page page_out_of_range invalid_order invalid_filter invalid_letter invalid_query invalid_language invalid_status game_not_found invalid_ean barcode_not_found paid_plan_required invalid_lookup game_withdrawn not_logged_in moderators_only admins_only email_not_confirmed posting_too_fast daily_posting_limit too_many_attempts human_check_unavailable human_check_missing human_check_failed human_check_unverified invalid_email invalid_display_name password_too_short email_taken wrong_credentials account_suspended own_account account_erased confirmation_mismatch verification_link_expired reset_link_invalid reset_link_used reset_link_expired email_not_sent invalid_token_name too_many_tokens invalid_token_expiry invalid_playlist_provider invalid_preferences too_many_preferences preference_not_found photo_missing photo_too_large photo_type_refused photo_too_small photo_not_square daily_photo_limit official_cover_refused photo_not_found photo_kind_missing invalid_photo_kind list_not_found invalid_list_name list_description_too_long not_list_owner invalid_list_visibility list_kept rating_out_of_range invalid_vote invalid_comment comment_removed_by_moderator comment_not_found comment_hidden_by_votes own_contribution_vote invalid_video_url invalid_video_title invalid_video_category duplicate_video daily_video_limit video_not_found invalid_playlist_url playlist_title_too_long playlist_title_unreadable invalid_playlist_vote duplicate_playlist playlist_hidden daily_playlist_limit playlist_not_found rulebook_missing rulebook_too_large rulebook_image_too_large rulebook_type_refused rulebook_mixed_files rulebook_too_many_images rulebook_edition_too_long invalid_file_type daily_rulebook_limit rulebook_not_found rulebook_rejected invalid_upload_size rulebook_upload_too_large too_many_open_uploads upload_token_missing upload_not_found upload_expired invalid_upload_part wrong_part_size upload_not_pdf part_incomplete upload_parts_missing upload_assembly_failed upload_size_mismatch invalid_correction description_not_declared unknown_credit not_a_publisher_of_the_game lead_not_found lead_not_acceptable correction_stale correction_range daily_correction_limit invalid_email_domain note_too_long publisher_not_found duplicate_publisher_claim too_many_pending_claims edition_not_found name_not_found invalid_edition invalid_rules rules_unchanged daily_rules_limit invalid_tutorial tutorial_image_unknown tutorial_unchanged daily_tutorial_limit proposal_not_found proposal_decided invalid_accepted_sections rules_stale tutorial_stale engine_unavailable publisher_unavailable games_required merge_refused invalid_decision decision_refused game_required cover_candidate_required image_required crop_invalid invalid_cover_side invalid_mode cover_changed cover_choice_invalid cover_not_found engine_refused engine_unknown_game enrich_request_not_found enrich_job_not_found invalid_enrich_choice job_not_found cover_review_closed cover_candidate_unknown cover_not_reusable cover_not_stored web_image_unknown image_host_refused image_not_fetched image_not_readable straighten_failed straighten_risky straightened_unknown no_cover claim_not_found invalid_rejection_reason correction_not_found invalid_accepted_changes correction_decided revision_not_found revision_undone revision_changed invalid_snooze_item invalid_merge_proposal duplicate_merge_proposal invalid_token_scope publisher_access_required publisher_token_required invalid_application duplicate_application application_pending daily_application_limit application_not_found invalid_game_field game_name_required game_name_language_required game_year_required game_players_required game_playtime_required game_min_age_required game_designer_required game_publisher_not_yours game_description_too_short game_description_not_plain game_description_not_own_words game_cover_required cover_too_small cover_too_large cover_type_refused cover_not_box_front cover_not_box_back cover_not_judged cover_kept_by_moderator duplicate_game not_your_game daily_publisher_limit game_refused invalid_submission invalid_admin_change
params
The numbers the sentence names, when it names any: for example { "max": 20 } with daily_photo_limit.
object
Example
"error" : " 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.
Media type application/json
object What went wrong, in plain English words. The wording may change: act on code.
string
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.
string
Allowed values: not_found request_too_large catalog_busy internal_error rate_limited weekly_limit missing_address invalid_token invalid_lang invalid_cursor invalid_page page_out_of_range invalid_order invalid_filter invalid_letter invalid_query invalid_language invalid_status game_not_found invalid_ean barcode_not_found paid_plan_required invalid_lookup game_withdrawn not_logged_in moderators_only admins_only email_not_confirmed posting_too_fast daily_posting_limit too_many_attempts human_check_unavailable human_check_missing human_check_failed human_check_unverified invalid_email invalid_display_name password_too_short email_taken wrong_credentials account_suspended own_account account_erased confirmation_mismatch verification_link_expired reset_link_invalid reset_link_used reset_link_expired email_not_sent invalid_token_name too_many_tokens invalid_token_expiry invalid_playlist_provider invalid_preferences too_many_preferences preference_not_found photo_missing photo_too_large photo_type_refused photo_too_small photo_not_square daily_photo_limit official_cover_refused photo_not_found photo_kind_missing invalid_photo_kind list_not_found invalid_list_name list_description_too_long not_list_owner invalid_list_visibility list_kept rating_out_of_range invalid_vote invalid_comment comment_removed_by_moderator comment_not_found comment_hidden_by_votes own_contribution_vote invalid_video_url invalid_video_title invalid_video_category duplicate_video daily_video_limit video_not_found invalid_playlist_url playlist_title_too_long playlist_title_unreadable invalid_playlist_vote duplicate_playlist playlist_hidden daily_playlist_limit playlist_not_found rulebook_missing rulebook_too_large rulebook_image_too_large rulebook_type_refused rulebook_mixed_files rulebook_too_many_images rulebook_edition_too_long invalid_file_type daily_rulebook_limit rulebook_not_found rulebook_rejected invalid_upload_size rulebook_upload_too_large too_many_open_uploads upload_token_missing upload_not_found upload_expired invalid_upload_part wrong_part_size upload_not_pdf part_incomplete upload_parts_missing upload_assembly_failed upload_size_mismatch invalid_correction description_not_declared unknown_credit not_a_publisher_of_the_game lead_not_found lead_not_acceptable correction_stale correction_range daily_correction_limit invalid_email_domain note_too_long publisher_not_found duplicate_publisher_claim too_many_pending_claims edition_not_found name_not_found invalid_edition invalid_rules rules_unchanged daily_rules_limit invalid_tutorial tutorial_image_unknown tutorial_unchanged daily_tutorial_limit proposal_not_found proposal_decided invalid_accepted_sections rules_stale tutorial_stale engine_unavailable publisher_unavailable games_required merge_refused invalid_decision decision_refused game_required cover_candidate_required image_required crop_invalid invalid_cover_side invalid_mode cover_changed cover_choice_invalid cover_not_found engine_refused engine_unknown_game enrich_request_not_found enrich_job_not_found invalid_enrich_choice job_not_found cover_review_closed cover_candidate_unknown cover_not_reusable cover_not_stored web_image_unknown image_host_refused image_not_fetched image_not_readable straighten_failed straighten_risky straightened_unknown no_cover claim_not_found invalid_rejection_reason correction_not_found invalid_accepted_changes correction_decided revision_not_found revision_undone revision_changed invalid_snooze_item invalid_merge_proposal duplicate_merge_proposal invalid_token_scope publisher_access_required publisher_token_required invalid_application duplicate_application application_pending daily_application_limit application_not_found invalid_game_field game_name_required game_name_language_required game_year_required game_players_required game_playtime_required game_min_age_required game_designer_required game_publisher_not_yours game_description_too_short game_description_not_plain game_description_not_own_words game_cover_required cover_too_small cover_too_large cover_type_refused cover_not_box_front cover_not_box_back cover_not_judged cover_kept_by_moderator duplicate_game not_your_game daily_publisher_limit game_refused invalid_submission invalid_admin_change
params
The numbers the sentence names, when it names any: for example { "max": 20 } with daily_photo_limit.
object
Example
"error" : " Game not found " ,