# Data and API

> Built from commit 3effc4a043e0 on 2026-11-24. The current build: https://abdess.github.io/retrobios/version.json

Source: https://abdess.github.io/retrobios/data/

RetroBIOS publishes the same metadata used by its verifier, pack builder and website as versioned static files. No account or API key is required.

[API catalog](https://abdess.github.io/retrobios/api/v1/catalog.json) [SQLite snapshot](https://abdess.github.io/retrobios/downloads/retrobios.sqlite) [Collection DAT](https://abdess.github.io/retrobios/downloads/retrobios.dat)

**Licence:** the metadata is offered under the MIT terms of [LICENSE](https://github.com/Abdess/retrobios/blob/main/LICENSE), which cover the scripts, tooling, schemas, documentation and metadata. They never cover a BIOS or firmware file ([NOTICE](https://github.com/Abdess/retrobios/blob/main/NOTICE)). `catalog.json` and the SQLite `metadata` table carry the same `license`.

## Stable JSON endpoints

Start at [`api/v1/index.json`](https://abdess.github.io/retrobios/api/v1/index.json): it names the catalog, the two id indexes and the envelope schema.

| Dataset | Endpoint | Schema | Size |
|---|---|---|---|
| Content database | [`api/v1/database.json`](https://abdess.github.io/retrobios/api/v1/database.json) | [JSON Schema](https://abdess.github.io/retrobios/api/v1/schemas/database.schema.json) | 27.9 MB |
| Platform contracts | [`api/v1/platforms.json`](https://abdess.github.io/retrobios/api/v1/platforms.json) | [JSON Schema](https://abdess.github.io/retrobios/api/v1/schemas/site-api-envelope.schema.json) | 3.7 MB |
| Emulator profiles | [`api/v1/emulators.json`](https://abdess.github.io/retrobios/api/v1/emulators.json) | [JSON Schema](https://abdess.github.io/retrobios/api/v1/schemas/site-api-envelope.schema.json) | 11.1 MB |
| Verification and coverage gaps | [`api/v1/gaps.json`](https://abdess.github.io/retrobios/api/v1/gaps.json) | [JSON Schema](https://abdess.github.io/retrobios/api/v1/schemas/site-api-envelope.schema.json) | 5.4 MB |
| Where each file's card is, by SHA1 | [`api/v1/file-locations.json`](https://abdess.github.io/retrobios/api/v1/file-locations.json) | [JSON Schema](https://abdess.github.io/retrobios/api/v1/schemas/site-api-envelope.schema.json) | 3.7 MB |
| Project statistics | [`api/v1/stats.json`](https://abdess.github.io/retrobios/api/v1/stats.json) | [JSON Schema](https://abdess.github.io/retrobios/api/v1/schemas/stats.schema.json) | 572 B |
| System ids, their names and sections | [`api/v1/systems.json`](https://abdess.github.io/retrobios/api/v1/systems.json) | [JSON Schema](https://abdess.github.io/retrobios/api/v1/schemas/site-api-envelope.schema.json) | 344.2 KB |
| Core names and the profile each one is | [`api/v1/cores.json`](https://abdess.github.io/retrobios/api/v1/cores.json) | [JSON Schema](https://abdess.github.io/retrobios/api/v1/schemas/site-api-envelope.schema.json) | 101.6 KB |
| Latest release: packs, sizes and assets | [`api/v1/release.json`](https://abdess.github.io/retrobios/api/v1/release.json) | [JSON Schema](https://abdess.github.io/retrobios/api/v1/schemas/release.schema.json) | 2.1 KB |

Every envelope carries `schema_version`, `kind` and `commit`, the revision of this repository the data was read at. Breaking changes use a new URL prefix (`/api/v2/`), and fields may only be added compatibly within v1. Each schema's `$id` is the address it is served at.

Schemas:

- [`arcade-parents.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/arcade-parents.schema.json): RetroBIOS arcade parent index of one core version
- [`campaign-finding.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/campaign-finding.schema.json): RetroBIOS campaign finding
- [`campaign-run.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/campaign-run.schema.json): RetroBIOS campaign run
- [`core-probe-record.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/core-probe-record.schema.json): RetroBIOS core probe record
- [`database.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/database.schema.json): RetroBIOS content database
- [`emulator.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/emulator.schema.json): Emulator BIOS Profile
- [`game-catalog.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/game-catalog.schema.json): RetroBIOS game catalog of one system
- [`game-extras.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/game-extras.schema.json): RetroBIOS per-game extra files
- [`game-headers.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/game-headers.schema.json): RetroBIOS game header readers
- [`game-regions.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/game-regions.schema.json): RetroBIOS region rules per system and core
- [`games-index.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/games-index.schema.json): RetroBIOS games index
- [`install-events.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/install-events.schema.json): RetroBIOS installer event
- [`install-manifest.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/install-manifest.schema.json): RetroBIOS installer manifest
- [`install-standalone.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/install-standalone.schema.json): RetroBIOS standalone build layouts
- [`pack-manifest.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/pack-manifest.schema.json): RetroBIOS pack integrity manifest
- [`pack-probe.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/pack-probe.schema.json): RetroBIOS pack probe
- [`platform.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/platform.schema.json): Platform Configuration
- [`registry.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/registry.schema.json): RetroBIOS platform registry
- [`release.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/release.schema.json): RetroBIOS release record
- [`romfolders.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/romfolders.schema.json): RetroBIOS rom folders of one setup
- [`site-api-envelope.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/site-api-envelope.schema.json): RetroBIOS static API v1 envelope
- [`stats.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/stats.schema.json): RetroBIOS public statistics
- [`target-manifest.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/target-manifest.schema.json): RetroBIOS hardware target manifest

`database.json`, `stats.json`, `release.json` and the manifests are not envelopes. Their revision is the `commit` of `catalog.json` that lists their SHA256.

One emulator profile without the whole list: `api/v1/emulators/<id>.json`, the envelope of `emulators.json` holding that one item, its `profile` valid against [`emulator.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/emulator.schema.json). Each emulator page links its own. `api/v1/platforms/<id>.json` holds one platform of `platforms.json`, its `contract` valid against [`platform.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/platform.schema.json) and its `registry` the install and scraper settings beside the list. `api/v1/systems/<slug>.json` holds the files of one system page by console. Each platform and system page links its own.

By id: [`systems.json`](https://abdess.github.io/retrobios/api/v1/systems.json) gives each system id a platform or a profile writes (`sony-playstation`) with its name, its manufacturer, the `url` of the section holding its files, the `api` document of that section and the files' SHA1. [`cores.json`](https://abdess.github.io/retrobios/api/v1/cores.json) gives each core name the buildbot or a platform uses (`mednafen_psx`) the profile it designates (`beetle_psx`), whose document is `api/v1/emulators/<profile>.json`. A name two profiles claim (`pcsx2`) has one item per profile, and `preferred: true` marks the one a platform list naming that core gets: the profile with that very id, else the first id in alphabetical order.

One hash without the whole list: `api/v1/lookup/<xx>.json`, where `<xx>` is the first two characters of the hash in lowercase, holds every SHA1, MD5, CRC32 and SHA256 starting with them. Each record names its `layer` (the collection, a member of a collection archive, a file that left the collection, a data directory, a platform's list or an emulator profile), the file `name`, the `url` of the page that shows it and, when one is known, the `system_name` the site gives its system. [Find or check a file](https://abdess.github.io/retrobios/files/) reads it.

`catalog.json` lists the datasets, manifests, exports and downloads. It does not list these one-item documents, which hold no SHA256 of their own.

In a browser, the SHA1 of a file the reader picks finds its records when the collection holds that file. A list naming a file the collection lacks is filed under its MD5 or CRC32 alone, and Web Crypto has no MD5: that page computes MD5 and CRC32 in script and looks up all four.

```
// The records of the file a reader picked, by its SHA1.
async function lookUp(file) {
  const digest = await crypto.subtle.digest("SHA-1", await file.arrayBuffer());
  const sha1 = [...new Uint8Array(digest)]
    .map((byte) => byte.toString(16).padStart(2, "0"))
    .join("");
  const base = "https://abdess.github.io/retrobios/api/v1/lookup/";
  const response = await fetch(`${base}${sha1.slice(0, 2)}.json`);
  if (!response.ok) return [];
  const shard = await response.json();
  // layer: collection, archive-member, retired, data-directory, platform, emulator.
  return shard.items.filter((item) => item.value === sha1);
}
```

Two kinds of `url`:

- In `catalog.json` and `index.json`, a `url` is relative to the document holding it, as RFC 3986 resolves it.
- In the lookup shards, `file-locations.json` and `systems.json`, a `url` is site-absolute (`/retrobios/systems/sony/#...`). Prefix `https://abdess.github.io` for a full address.

## Platform manifests

A platform's list is what the setup checks. Its manifest is what the pack installs: the list's files plus every file the setup's cores load. `api/v1/manifests/<platform>.json` is the file `install.py` reads, byte for byte, valid against [`install-manifest.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/install-manifest.schema.json). [`api/v1/release.json`](https://abdess.github.io/retrobios/api/v1/release.json) records the packs of the latest release and the files each one holds.

Manifests: [amberelec](https://abdess.github.io/retrobios/api/v1/manifests/amberelec.json), [batocera](https://abdess.github.io/retrobios/api/v1/manifests/batocera.json), [bizhawk](https://abdess.github.io/retrobios/api/v1/manifests/bizhawk.json), [emudeck](https://abdess.github.io/retrobios/api/v1/manifests/emudeck.json), [emuelec](https://abdess.github.io/retrobios/api/v1/manifests/emuelec.json), [knulli](https://abdess.github.io/retrobios/api/v1/manifests/knulli.json), [lakka](https://abdess.github.io/retrobios/api/v1/manifests/lakka.json), [minui](https://abdess.github.io/retrobios/api/v1/manifests/minui.json), [misterfpga](https://abdess.github.io/retrobios/api/v1/manifests/misterfpga.json), [myminui](https://abdess.github.io/retrobios/api/v1/manifests/myminui.json), [nextui](https://abdess.github.io/retrobios/api/v1/manifests/nextui.json), [recalbox](https://abdess.github.io/retrobios/api/v1/manifests/recalbox.json), [retroarch](https://abdess.github.io/retrobios/api/v1/manifests/retroarch.json), [retrobat](https://abdess.github.io/retrobios/api/v1/manifests/retrobat.json), [retrodeck](https://abdess.github.io/retrobios/api/v1/manifests/retrodeck.json), [retropie](https://abdess.github.io/retrobios/api/v1/manifests/retropie.json), [rocknix](https://abdess.github.io/retrobios/api/v1/manifests/rocknix.json), [romm](https://abdess.github.io/retrobios/api/v1/manifests/romm.json).

`api/v1/targets/<platform>.json` gives each hardware target of a platform the cores it runs, valid against [`target-manifest.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/target-manifest.schema.json). `install.py --target` reads the same file. Like the manifests, they are copied byte for byte and are not envelopes.

Target lists: [amberelec](https://abdess.github.io/retrobios/api/v1/targets/amberelec.json), [batocera](https://abdess.github.io/retrobios/api/v1/targets/batocera.json), [emudeck](https://abdess.github.io/retrobios/api/v1/targets/emudeck.json), [emuelec](https://abdess.github.io/retrobios/api/v1/targets/emuelec.json), [knulli](https://abdess.github.io/retrobios/api/v1/targets/knulli.json), [lakka](https://abdess.github.io/retrobios/api/v1/targets/lakka.json), [recalbox](https://abdess.github.io/retrobios/api/v1/targets/recalbox.json), [retroarch](https://abdess.github.io/retrobios/api/v1/targets/retroarch.json), [retrobat](https://abdess.github.io/retrobios/api/v1/targets/retrobat.json), [retrodeck](https://abdess.github.io/retrobios/api/v1/targets/retrodeck.json), [retropie](https://abdess.github.io/retrobios/api/v1/targets/retropie.json), [rocknix](https://abdess.github.io/retrobios/api/v1/targets/rocknix.json), [romm](https://abdess.github.io/retrobios/api/v1/targets/romm.json).

`api/v1/exports/<platform>.json` lists every change of a setup's [updated file](https://abdess.github.io/retrobios/exports/), the report that page is written from, copied byte for byte like the manifests.

| Field | Meaning |
|---|---|
| `platform` | Registry key of the platform (batocera). |
| `version` | Version of the platform's own list this manifest was built from, as the platform YAML records it (inherits: resolved): the release tag the scraper read (Batocera 43.1, Recalbox 10.1.1). A list kept on a branch with no release records what the scraper pinned instead: MinUI, MyMinUI and NextUI the date of the pinned commit, MiSTer the timestamp of the BiosDB it read. RetroArch and Lakka name the RetroArch release current when System.dat was read at its pinned commit, RetroPie the __version of RetroPie-Setup at its pinned commit. |
| `base_destination` | The BIOS folder entries are written below, as the platform names it. Empty when entries start one level higher (RetroDECK). |
| `files` | Every file the installer fetches, one entry per destination. |
| `omitted_files` | Files the pack needs and the repository cannot serve, with the reason. |
| `pack_files` | Files the platform's pack holds once extracted: this list, the data directories and the pack's own documents. |
| `core_names` | Each core the platform runs or a file names, with the other names it goes by upstream (the buildbot's mednafen_psx for beetle_psx), empty when it has none. |
| `system_cores` | Each platform system with the cores whose presence keeps it. A system absent here is kept whatever cores are available. |

Each entry of `files`:

| Field | Meaning |
|---|---|
| `dest` | Path below base_destination, below the save directory when root is save, below the roms folder when root is roms, below the configs folder when root is configs, or in an emulator folder when root is emulators (its key first). |
| `sha1` | SHA1 of the copy the repository serves. The installer checks it after download. |
| `size` | Bytes of the same copy. |
| `repo_path` | Path in the repository. Fetched from `https://raw.githubusercontent.com/Abdess/retrobios/<ref>/<repo_path>`, ref being main unless RETROBIOS_REF names a tag. |
| `release_asset` | Asset of the large-files release, fetched from `https://github.com/Abdess/retrobios/releases/download/large-files/<asset>` instead of repo_path. |
| `cores` | Profiles whose core brings the file into the pack. Null for a file the platform's own list declares. |
| `systems` | Every platform system that declares the file, for the installer's --system. |
| `category` | game_data: a game's own data, not firmware. Absent on firmware. The installer's --no-game-data leaves these out, as a pack built with --no-game-data does. |
| `alternatives` | Copies other cores read at this destination when they disagree on its content, in the order the pack builder tries them. A narrowing that drops the entry's cores takes the first whose cores remain. |

**All fields**

The manifest:

| Field | Meaning |
|---|---|
| `manifest_version` | Format version of the manifest. install.py refuses a version it does not know. |
| `source` | Which files the pack was built from: full (the platform's list plus the files its cores load), platform (the list alone) or truth (the cores' files alone). |
| `regions` | Region priority the manifest was narrowed to, best first. Empty when it was not narrowed. |
| `target` | Hardware target this manifest was filtered for, absent when unfiltered |
| `categorized` | Every game data file carries category: game_data. Without it the list records no category, and the installer refuses --no-game-data. |
| `no_game_data` | Built without game data, absent when the game data is listed |
| `slot_fields` | The entries a slot decides carry slot, which --one-per-slot reads. Without it the installer refuses --one-per-slot. |
| `display_name` | Name the site shows for the platform. |
| `generated` | When the manifest was written. |
| `detect` | Rules install.py follows to find this setup and its BIOS folder on a machine, one per method and operating system. |
| `standalone_copies` | Files install.py also copies into the folders of standalone emulators it finds, or a note it prints when their folder exists. |
| `total_files` | Number of entries in files. |
| `total_size` | Bytes of the files in files. |
| `pack_size` | Bytes those files occupy once extracted. |
| `total_omitted` | Number of entries in omitted_files. |
| `downloaded_cores` | Each core only the platform's RetroArch core downloader brings, with the boards and board aliases whose downloader offers it. install.py --target keeps the files of such a core on those boards only. |
| `offered_boards` | Each core a roms folder of the platform offers on some boards only, with the folder (below the roms root, or the install tree) and the boards and board aliases it is offered on. install.py --target keeps the core's files in that folder on those boards only. |
| `system_titles` | Each system id with the name a person reads for it, the one the site prints (Sony PlayStation). A system the site cannot name is absent. |
| `system_names` | Each platform system with the names the platform's own file gives it (native_system), which the installer accepts for --system. |
| `case_variants` | Files the folded list serves under another case, installed only where the target directory keeps case. |
| `truth_files` | Files only the list --source truth installs holds, at their destination with their bytes. With the files not marked truth: false they make that list. Absent on a list built before it, on which --source truth is refused. |
| `truth_omitted` | Omissions only the list --source truth installs holds. |
| `standalone_builds` | The emulators whose standalone build install/standalone/<platform>.json describes, which --emulator NAME --standalone reads. Absent when none has one. |
| `data_directories` | Data trees the pack carries, rebuilt by the installer from their source archive. Each file is kept only when its sha1 matches, except in a rolling tree, which is written as its source serves it. |
| `save_directory` | Where the platform keeps the save directory its frontend hands a core, present when an entry carries root: save. folder is the pack folder holding those files and the save directory's default place beside the BIOS directory, and by_core says the frontend appends each core's library_name (core_folder). |
| `roms_directory` | Where the platform keeps its roms root, present when an entry carries root: roms. from_bios is that root relative to the BIOS folder ("." for the folder itself, else one or two ".." then plain names), as platforms/romfolders/<platform>.yml records it from the OS's own source (roms_root.from_bios). It is followed only from a BIOS folder named bios_folder (the platform's base_destination). Any other leaves root: roms entries out (no_roms_directory). |
| `emulators_directory` | Where the platform keeps its emulator folders, present when an entry carries root: emulators. Paths are relative to the folder holding the BIOS folder, which is named bios_folder. searched are the places the launcher tries for a key, in order, default the one the installer creates when none exists, and config the launcher's key=value file: a key it sets moves the folder, and its files are left out (no_emulators_directory). |
| `configs_directory` | Where the frontend keeps its emulators' configs, present when an entry carries root: configs. from_bios is that folder relative to the BIOS folder, as the platform's own path code builds it (Batocera's batoceraPaths CONFIGS, ../system/configs), with the rules of roms_directory.from_bios. It is followed only from a BIOS folder named bios_folder. Any other leaves root: configs entries out (no_configs_directory). |

Each entry of `files`:

| Field | Meaning |
|---|---|
| `sha256` | SHA256 of the same copy. |
| `storage` | release when the file is a large-files release asset. |
| `regions` | The regions the emulator code selects the file for. Absent when it never competes. |
| `region_groups` | Groups the file competes in as a core extra, whatever systems are chosen. |
| `region_system_groups` | Groups the file competes in as the platform's own declaration: present only when that system is kept. |
| `priority` | The rank the code searches the file at, lower first: a world file withdraws an unmatched regional one only when it ranks no worse. |
| `truth` | false when the list --source truth installs lacks this file at this destination with these bytes. |
| `slot` | What --one-per-slot reads for this entry: the groups it competes in and what each emulator declares at each key the slot lookup tries. |
| `slot_choices` | On a platform file a core's own source contradicts while the frontend only checks the path: the copy each core's presence puts there, in the order the pack builder settles the slot. A narrowing serves the first whose cores remain. One naming only cores, or none remaining, leaves `declared_choices`. |
| `declared_choices` | The platform's own answer at the destination by the declaring systems that remain, in the order the pack builder takes the declarations. A narrowing serves the first whose systems remain. |
| `executable` | The repository keeps the file executable, and the installer gives it the execute bits the umask allows. |
| `declared_in` | The platform systems declaring the file, when fewer than `systems`, which also names the systems whose cores read it there. |
| `absent_claims` | Cores that want this destination and have nothing held, after the cores served here: a narrowing that keeps none of those takes the first named one as a file left out, as a pack built for it lists it. |
| `root` | save: dest is relative to the save directory the frontend hands the core (RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY), not to the BIOS directory. roms: dest is relative to the platform's roms folder, which roms_directory locates (a file its launcher runs from there, ROCKNIX's roms/pico-8). emulators: dest is the key of an emulator folder of the platform, then the path in it, located by emulators_directory (RetroBat's emulators/pico8). configs: dest is relative to the frontend's configs folder, which configs_directory locates (Batocera starts shadPS4 from configs/shadps4). Absent for a file of the BIOS tree. |
| `core_folder` | The core's library_name, the folder a frontend sorting saves by core (RetroArch's sort_savefiles_enable) inserts between its save directory and dest. Only with root: save. Absent on a save entry when the core reads the same place sorted or not. |

Each entry of `omitted_files`:

| Field | Meaning |
|---|---|
| `dest` | Where the file would go, below base_destination, below the save directory when root is save, below the roms folder when root is roms, in an emulator folder when root is emulators (its key first), or in the emulator's own folder when root is emulator. |
| `name` | File name the declaration gives. |
| `system` | System id of the declaration. Empty when the core's file names none. |
| `required` | The platform or the core needs the file to run, as the declaration says. |
| `reason` | Why the file is left out, as a code. enumDescriptions gives the meaning of each code, in the order of enum. |
| `category` | game_data: a game's own data, not firmware. Absent on firmware. |
| `held` | The pack builder holds this file and the installer cannot download it. Region narrowing counts it held, as the builder does, so it displaces the same fallback. |
| `cores` | Profiles whose core wants the file. Null for a file the platform's own list declares. |
| `regions` | The regions the emulator code selects the file for. Absent when it never competes. |
| `region_groups` | Groups the file competes in as a core extra, whatever systems are chosen. |
| `region_system_groups` | Groups the file competes in as the platform's own declaration: present only when that system is kept. |
| `systems` | Every platform system that declares the file, for the installer's --system. |
| `priority` | The rank the code searches the file at, lower first: a world file withdraws an unmatched regional one only when it ranks no worse. |
| `truth` | false when the list --source truth installs lacks this omission. |
| `slot` | What --one-per-slot reads for this entry: the groups it competes in and what each emulator declares at each key the slot lookup tries. |
| `declared_in` | The platform systems declaring the file, when fewer than `systems`, which also names the systems whose cores read it there. |
| `alternatives` | Cores claiming this destination behind the platform's own declaration, in the order the pack builder tries them. A narrowing that drops every declaring system takes the first whose cores remain. |
| `root` | save: dest is relative to the save directory the frontend hands the core (RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY), not to the BIOS directory. emulator: dest is the path the emulator reads in its own folder, which the platform keeps outside the BIOS tree (reason outside_bios_folder). roms: dest is relative to the platform's roms folder (roms_directory). emulators: dest is the emulator folder's key then the path in it (emulators_directory). configs: dest is relative to the frontend's configs folder (configs_directory). Absent for a file of the BIOS tree. |
| `core_folder` | The core's library_name, the folder a frontend sorting saves by core (RetroArch's sort_savefiles_enable) inserts between its save directory and dest. Only with root: save. Absent on a save entry when the core reads the same place sorted or not. |

Codes of `omitted_files[].reason`:

- `hash_mismatch`: The platform checks the hash and the only copy held contradicts the one it declares, so the frontend would refuse it.
- `not_found`: The collection holds no copy the declaration accepts.
- `external`: The declaration keeps the file outside the repository (storage: external). The pack builder downloads it from its own address, the installer does not.
- `user_provided`: The user supplies the file (storage: user_provided). The pack writes its instructions in its place.
- `no_platform_slug`: The platform keeps one folder per system and has none for the system the core's file belongs to.
- `below_platform_folder`: The platform lists each system folder flat (firmware_folder_flat) and the file would sit in a subfolder it does not read.
- `no_save_directory`: The core reads the file below the save directory and the platform has no save directory a pack can fill.
- `no_core_folder`: The frontend sorts saves by core and the core's profile does not name its folder (core_folder).
- `no_save_system`: The launcher gives each system its own save folder and no system of the platform runs the core.
- `outside_bios_folder`: The platform runs the emulator from a folder outside the BIOS tree and links none of the BIOS tree where the emulator reads this file (root: emulator).
- `no_roms_directory`: The platform's launcher runs the file from its roms folder (root: roms) and the run cannot tell where that folder is: the BIOS folder is not the one the platform keeps in it.
- `no_emulators_directory`: The platform's launcher runs the file from one of its emulator folders (root: emulators) and the run cannot place it there: the BIOS folder is not the one beside the platform's launcher config, or that config sets the folder.
- `no_configs_directory`: The platform's launcher starts the emulator from a folder of its configs folder (root: configs) and the run cannot tell where that folder is: the BIOS folder is not the one the platform keeps beside it.

Each entry of `omitted_files[].alternatives`:

| Field | Meaning |
|---|---|
| `cores` | Profiles of the cores that claim the destination together. |

Each entry of `data_directories`:

| Field | Meaning |
|---|---|
| `ref` | Key of the data directory in platforms/_data_dirs.yml. |
| `dest` | Folder below base_destination the tree is rebuilt in. Empty for base_destination itself. |
| `url` | HTTPS address of the source archive the installer downloads. |
| `type` | Format of the source archive: zip, or tarball (gzip). |
| `strip_components` | With type zip: leading path parts dropped from each member. |
| `archive_size` | Bytes of the source archive when it was last downloaded: what fetching the tree costs. Absent when not recorded. |
| `source_path` | With type tarball: only members below this path are kept, relative to it. |
| `exclude` | First path parts left out of the tree. |
| `systems` | Platform systems whose cores read the tree. |
| `optional` | Every core reading the tree runs without it (required: false in its profile): --required-only leaves it out. |
| `rolling` | The source names no revision (the buildbot's nightly assets, a release asset): the installer writes each listed file as the source serves it now, as RetroArch's downloader does, and the hashes describe the pack's copy. Absent for a source listed at a commit, whose files must hash as listed. |
| `cores` | The cores that read the tree, when no platform system declares it: an install for the games of a card keeps it only when its plan runs one of them. |
| `files` | Every file of the tree by its path below dest. A member whose sha1 differs is refused. |

Each value of `data_directories[].files`:

| Field | Meaning |
|---|---|
| `sha1` | SHA1 the file must have. |
| `size` | Bytes of the file. |

Fields of `save_directory`:

| Field | Meaning |
|---|---|
| `folder` | Pack folder holding the save entries, also the save directory's default place beside the BIOS directory. |
| `by_core` | true when the frontend inserts each core's library_name (core_folder) below the save directory. |
| `by_system` | true when the platform's launcher hands each core <save directory>/<system> at each launch (Batocera, RetroBat). Each dest then starts with that system's folder, and no frontend config read at install time changes it. |

Fields of `roms_directory`:

| Field | Meaning |
|---|---|
| `bios_folder` | Name of the BIOS folder from_bios starts from, the platform's base_destination. |
| `from_bios` | The roms root relative to that BIOS folder. |

Fields of `emulators_directory`:

| Field | Meaning |
|---|---|
| `bios_folder` | Name of the BIOS folder. The other paths are relative to the folder holding it. |
| `searched` | The places the launcher tries for an emulator key, in order, {key} standing for it. |
| `default` | The place the installer creates when none of searched exists. |
| `config` | The launcher's key=value file, a key of which moves the folder. |

Fields of `configs_directory`:

| Field | Meaning |
|---|---|
| `bios_folder` | Name of the BIOS folder from_bios starts from, the platform's base_destination. |
| `from_bios` | The configs folder relative to that BIOS folder. |

Each entry of `files[].alternatives`:

| Field | Meaning |
|---|---|
| `sha1` | SHA1 of this copy. |
| `sha256` | SHA256 of this copy. |
| `size` | Bytes of this copy. |
| `repo_path` | Path of this copy in the repository, fetched as the entry's repo_path is. |
| `storage` | release when this copy is a large-files release asset. |
| `release_asset` | Asset of the large-files release holding this copy, fetched instead of repo_path. |
| `cores` | Profiles whose core reads this copy. |
| `executable` | The repository keeps this copy executable. |

Each entry of `files[].slot_choices`:

| Field | Meaning |
|---|---|
| `sha1` | SHA1 of this copy. |
| `sha256` | SHA256 of this copy. |
| `size` | Bytes of this copy. |
| `repo_path` | Path of this copy in the repository, fetched as the entry's repo_path is. |
| `storage` | release when this copy is a large-files release asset. |
| `release_asset` | Asset of the large-files release holding this copy, fetched instead of repo_path. |
| `cores` | Profiles whose presence puts this copy in the slot. |
| `executable` | The repository keeps this copy executable. |

Each entry of `files[].declared_choices`:

| Field | Meaning |
|---|---|
| `sha1` | SHA1 of this copy. |
| `sha256` | SHA256 of this copy. |
| `size` | Bytes of this copy. |
| `repo_path` | Path of this copy in the repository, fetched as the entry's repo_path is. |
| `storage` | release when this copy is a large-files release asset. |
| `release_asset` | Asset of the large-files release holding this copy, fetched instead of repo_path. |
| `executable` | The repository keeps this copy executable. |
| `systems` | Platform systems whose declaration this copy answers. |

Each entry of `files[].absent_claims`:

| Field | Meaning |
|---|---|
| `name` | File name the declaration gives. |
| `system` | System id of the declaration. Empty when the core's file names none. |
| `required` | The platform or the core needs the file to run, as the declaration says. |
| `reason` | Why the file is left out, as a code. enumDescriptions gives the meaning of each code, in the order of enum. |
| `cores` | Profiles whose core wants the file. Null for a file the platform's own list declares. |
| `regions` | The regions the emulator code selects the file for. Absent when it never competes. |
| `region_groups` | Groups the file competes in as a core extra, whatever systems are chosen. |
| `region_system_groups` | Groups the file competes in as the platform's own declaration: present only when that system is kept. |
| `systems` | Every platform system that declares the file, for the installer's --system. |
| `priority` | The rank the code searches the file at, lower first: a world file withdraws an unmatched regional one only when it ranks no worse. |
| `declared_in` | The platform systems declaring the file, when fewer than `systems`, which also names the systems whose cores read it there. |

Codes of `files[].absent_claims[].reason`:

- `hash_mismatch`: The platform checks the hash and the only copy held contradicts the one it declares, so the frontend would refuse it.
- `not_found`: The collection holds no copy the declaration accepts.
- `external`: The declaration keeps the file outside the repository (storage: external). The pack builder downloads it from its own address, the installer does not.
- `user_provided`: The user supplies the file (storage: user_provided). The pack writes its instructions in its place.
- `no_platform_slug`: The platform keeps one folder per system and has none for the system the core's file belongs to.
- `below_platform_folder`: The platform lists each system folder flat (firmware_folder_flat) and the file would sit in a subfolder it does not read.

## Check a folder for one platform

The job most tools come for: is this BIOS folder what the platform checks? Read `api/v1/platforms/<id>.json` and apply the platform's own rules:

- `verification_mode: existence`: a file at its `destination` passes.
- An entry with no hash in the mode's field is checked on presence too.
- `zipped_file` set: the md5 is that of this member inside the ZIP, never the ZIP's. Member names compare casefolded. A ZIP declared once per member appears once per member: Batocera lists 692 entries for 353 destinations.
- An md5 shorter than 32 characters (Batocera) compares by its prefix. Recalbox writes several accepted md5 in one field, comma separated.
- `zip_digest: composite` (Recalbox): the md5 of a ZIP is that of its members read in name order, never the archive's.
- An entry with no `destination` (EmuDeck) names no file: the system passes when any file in the BIOS folder has one of its md5.
- `hash_rule: size_and_any_hash` (RomM) wants the size and any one hash. The script below does not apply it.
- MinUI, MyMinUI and NextUI have no list of their own (`native_list: none`). An empty list does not mean nothing is needed.

```
"""Usage: python check_platform_folder.py batocera path/to/bios. Exit 1 on a file wrong or missing."""
from __future__ import annotations

import hashlib
import json
import sys
import urllib.request
import zipfile
from pathlib import Path

API = "https://abdess.github.io/retrobios/api/v1/platforms/"
DIGESTS = {"md5": "md5", "sha1": "sha1"}  # without one (existence), presence passes

def accepts(entry: dict, path: Path, mode: str) -> bool:
    """Whether the platform's own check passes the file at path."""
    digest, raw = DIGESTS.get(mode), entry.get(mode) or ""
    values = [v.strip().lower() for v in (raw if isinstance(raw, list) else str(raw).split(",")) if v.strip()]
    if digest is None or not values:
        return path.is_file()  # nothing to compare: the platform checks presence
    try:
        if entry.get("zipped_file"):  # the hash of one member, its name casefolded
            with zipfile.ZipFile(path) as archive:
                names = {name.casefold(): name for name in archive.namelist()}
                member = names.get(entry["zipped_file"].casefold())
                return member is not None and hashlib.new(digest, archive.read(member)).hexdigest() in values
        actual = hashlib.new(digest, path.read_bytes()).hexdigest()
        if entry.get("zip_digest") != "composite" and actual in values:
            return True  # whole digests, as batocera-systems:1088 compares them
        if digest == DIGESTS["md5"] and path.suffix.lower() == ".zip":  # Recalbox: members in name order
            with zipfile.ZipFile(path) as archive:
                members = sorted(name for name in archive.namelist() if not name.endswith("/"))
                return hashlib.md5(b"".join(map(archive.read, members))).hexdigest() in values
    except (OSError, zipfile.BadZipFile):
        return False
    return False

def check(platform: str, root: Path, api: str = API) -> list[tuple[str, str]]:
    """(destination, ok | wrong | missing) per entry. With no destination (EmuDeck), any file with its hash passes."""
    with urllib.request.urlopen(f"{api}{platform}.json") as response:
        contract = json.load(response)["items"][0]["contract"]
    mode, results, loose = contract["verification_mode"], [], [p for p in root.iterdir() if p.is_file()]
    for system_id, system in contract["systems"].items():
        listed = [e for e in system.get("files") or [] if not e.get("destination")]
        for entry in (e for e in system.get("files") or [] if e.get("destination")):
            path = root / entry["destination"]
            results.append((entry["destination"], "ok" if accepts(entry, path, mode) else "wrong" if path.is_file() else "missing"))
        if listed:
            held = any(accepts(e, path, mode) for e in listed for path in loose)
            results.append((f"{system_id}: any file", "ok" if held else "missing"))
    return results

if __name__ == "__main__":
    if len(sys.argv) != 3:
        sys.exit(__doc__)
    try:
        found = check(sys.argv[1], Path(sys.argv[2]))
    except urllib.request.HTTPError as error:  # a 404: no platform has that name
        with urllib.request.urlopen(API.replace("platforms/", "catalog.json")) as response:
            known = sorted(i["url"][10:-5] for i in json.load(response)["items"] if i["url"].startswith("manifests/"))
        sys.exit(f"unknown platform: {sys.argv[1]}. Known: {', '.join(known)}" if error.code == 404 else str(error))
    except OSError as error:  # no such folder, or no network (URLError)
        sys.exit(f"error: {error}")
    for verdict in ("ok", "wrong", "missing"):
        names = sorted({dest for dest, seen in found if seen == verdict})
        print(f"{verdict}: {len(names)}" + "".join(f"\n  {name}" for name in names if verdict != "ok"))
    sys.exit(int(any(seen != "ok" for _dest, seen in found)))
```

The script is [`scripts/check_platform_folder.py`](https://github.com/Abdess/retrobios/blob/main/scripts/check_platform_folder.py). A test runs it against the verifier on a sample folder, so the two give the same answer. It exits 1 when a file is wrong or missing. For an unknown platform it prints the known ones, and it names a folder that does not exist.

`install.py --check` answers another question by default: whether the folder holds what the pack installs, the manifest above. With `--declared-only`, or from the `declared` event, `install.py --check` answers it too.

## Bulk downloads

| Export | Format | Size | SHA256 |
|---|---|---|---|
| [File hashes CSV](https://abdess.github.io/retrobios/downloads/files.csv) | `text/csv` | 5.0 MB | [`550a5409653c`](https://abdess.github.io/retrobios/api/v1/catalog.json) |
| [Collection DAT (Logiqx XML, for clrmamepro and RomVault)](https://abdess.github.io/retrobios/downloads/retrobios.dat) | `application/xml` | 3.9 MB | [`e6a5f042e7e2`](https://abdess.github.io/retrobios/api/v1/catalog.json) |
| [Platform declarations CSV](https://abdess.github.io/retrobios/downloads/platform-files.csv) | `text/csv` | 1.5 MB | [`060bf0f953eb`](https://abdess.github.io/retrobios/api/v1/catalog.json) |
| [Cross-reference CSV](https://abdess.github.io/retrobios/downloads/cross-reference.csv) | `text/csv` | 4.3 MB | [`fffa812db255`](https://abdess.github.io/retrobios/api/v1/catalog.json) |
| [Verification and coverage gaps CSV](https://abdess.github.io/retrobios/downloads/gaps.csv) | `text/csv` | 2.7 MB | [`af19b9b3cc95`](https://abdess.github.io/retrobios/api/v1/catalog.json) |
| [Accepted hashes, one row per value](https://abdess.github.io/retrobios/downloads/accepted-hashes.csv) | `text/csv` | 3.6 MB | [`3b5bf73b932e`](https://abdess.github.io/retrobios/api/v1/catalog.json) |
| [Catalogued dumps the collection lacks](https://abdess.github.io/retrobios/downloads/provenance-wanted.csv) | `text/csv` | 488.4 KB | [`82518476156b`](https://abdess.github.io/retrobios/api/v1/catalog.json) |
| [SQLite snapshot](https://abdess.github.io/retrobios/downloads/retrobios.sqlite) | `application/vnd.sqlite3` | 33.5 MB | [`4192560ec4b3`](https://abdess.github.io/retrobios/api/v1/catalog.json) |
| [Core probe measurements (SQLite)](https://abdess.github.io/retrobios/downloads/measurements.sqlite) | `application/vnd.sqlite3` | 15.9 MB | [`4cc99cc572f2`](https://abdess.github.io/retrobios/api/v1/catalog.json) |

Each SHA256 is cut to 12 characters. Point at it for the whole value, or read it in [`catalog.json`](https://abdess.github.io/retrobios/api/v1/catalog.json).

The DAT is Logiqx XML, the format clrmamepro and RomVault read: one game per `bios/<Manufacturer>/<Console>/` folder of the collection, named `Manufacturer\Console` so the tools look in that subfolder, each file a rom named by its path below that folder. It audits a copy of the collection's `bios/` tree, or rebuilds that layout from a reader's own dumps.

A setup's DAT, `downloads/dat/<platform>.dat`, describes its BIOS folder once installed: one game named after the folder (`bios`, `system`), each file a rom named by its place below it, as its manifest lists it. It audits that folder with the same tools. Setup DATs: [amberelec](https://abdess.github.io/retrobios/downloads/dat/amberelec.dat), [batocera](https://abdess.github.io/retrobios/downloads/dat/batocera.dat), [bizhawk](https://abdess.github.io/retrobios/downloads/dat/bizhawk.dat), [emudeck](https://abdess.github.io/retrobios/downloads/dat/emudeck.dat), [emuelec](https://abdess.github.io/retrobios/downloads/dat/emuelec.dat), [knulli](https://abdess.github.io/retrobios/downloads/dat/knulli.dat), [lakka](https://abdess.github.io/retrobios/downloads/dat/lakka.dat), [minui](https://abdess.github.io/retrobios/downloads/dat/minui.dat), [misterfpga](https://abdess.github.io/retrobios/downloads/dat/misterfpga.dat), [myminui](https://abdess.github.io/retrobios/downloads/dat/myminui.dat), [nextui](https://abdess.github.io/retrobios/downloads/dat/nextui.dat), [recalbox](https://abdess.github.io/retrobios/downloads/dat/recalbox.dat), [retroarch](https://abdess.github.io/retrobios/downloads/dat/retroarch.dat), [retrobat](https://abdess.github.io/retrobios/downloads/dat/retrobat.dat), [retrodeck](https://abdess.github.io/retrobios/downloads/dat/retrodeck.dat), [retropie](https://abdess.github.io/retrobios/downloads/dat/retropie.dat), [rocknix](https://abdess.github.io/retrobios/downloads/dat/rocknix.dat), [romm](https://abdess.github.io/retrobios/downloads/dat/romm.dat).

The SQLite file contains indexed tables for content hashes, provenance catalog matches, platform declarations, emulator profiles and current gaps. It contains metadata only, never BIOS or firmware bytes.

To find who accepts a hash, query `accepted_hashes` (or `accepted-hashes.csv`): one lowercase row per accepted value, per algorithm, for platform declarations and emulator profiles alike, indexed on `(algorithm, value)`. A ROM inside a MAME or FBNeo set has its own row, its `path` naming the archive and the member (`nmk004.zip/nmk004.bin`). The hash columns of `platform_files` and `emulator_files` keep each source's own form: a Recalbox md5 may list several revisions separated by commas, and an emulator field holding several accepted values is a JSON array.

```
SELECT layer, owner, name FROM accepted_hashes
WHERE algorithm = 'md5' AND value = 'c87a52c277f7952b41c639fc7bf0a43b';
```

The gaps dataset carries both layers behind one `layer` column: `platform` rows are anomalies against a platform's own BIOS list, `emulator` rows are files a profiled core loads that no platform declares. The two answer different questions and are not comparable totals. Each row is listed once.

`platform-files.csv` and the gaps add what the check found: `status` (`ok`, `untested`, `missing`), `category` (`bios`, `game_data`, `unread`), and for a held file `collection_path` and `resolved_sha1`, the collection file that answers the declaration. `provenance-wanted.csv` is the Wanted list of [Dump provenance](https://abdess.github.io/retrobios/provenance/): each dump a catalog describes and the collection lacks.

`platform-files.csv` and the `platform_files` table also carry the entry fields a check needs:

- `zipped_file` set: the md5 is the md5 of that member inside the ZIP.
- `zip_digest` is `composite` where the md5 of a ZIP covers its members.
- `hash_match_mandatory` and `mandatory_declared` are Recalbox's flags.
- `curated`, `shared_group` and `mirror_of` mark an entry the platform's own file does not carry.

## Measurements

[`measurements.sqlite`](https://abdess.github.io/retrobios/downloads/measurements.sqlite) holds every core probe record kept in [`measurements/`](https://github.com/Abdess/retrobios/tree/main/measurements), and `downloads/measurements/<emulator>.sqlite` the records of one emulator. The [Measurements](https://abdess.github.io/retrobios/measurements/) page reads [`data/measurements/index.json`](https://abdess.github.io/retrobios/data/measurements/index.json). A record line is valid against [`core-probe-record.schema.json`](https://abdess.github.io/retrobios/api/v1/schemas/core-probe-record.schema.json).

| Table | Columns |
|---|---|
| `meta` | `key`, `value` |
| `cores` | `sha256`, `file`, `repo`, `commit_sha`, `build_command`, `compiler`, `library_name`, `library_version` |
| `hosts` | `id`, `cpu_model`, `cpu_count`, `os`, `kernel`, `machine`, `python` |
| `emulator_systems` | `emulator`, `system` |
| `runs` | `id`, `emulator`, `subject`, `kind`, `recorded_at`, `supersedes`, `superseded`, `core_sha256`, `host_id`, `load_before`, `load_after`, `max_load`, `frontend_commit`, `script_sha256`, `script_modified`, `flags`, `record_url`, `line`, `migrated_from_version` |
| `inputs` | `run_id`, `content_label`, `content_sha1`, `content_size`, `options`, `env`, `frames`, `warmup`, `repetitions`, `presses`, `observables`, `frame_hash_every`, `joypad_ports` |
| `content_tracks` | `run_id`, `position`, `file`, `sha1`, `size` |
| `checks` | `run_id`, `claim`, `method`, `observable`, `variable`, `status`, `statement` |
| `check_groups` | `run_id`, `position`, `value`, `value_sha1`, `variants` |
| `variants` | `run_id`, `position`, `label`, `repetitions`, `loaded`, `flags`, `observables`, `files_opened`, `files_probed_absent`, `tracing`, `verdict`, `verdict_evidence` |
| `system_files` | `run_id`, `variant_position`, `destination`, `sha1` |
| `benchmarks` | `run_id`, `metric`, `median`, `mean`, `stdev`, `min`, `max` |

`meta` names the commit the record links point to and the record version. A list or object value is JSON text, an absent one empty. `runs.superseded` is 1 for a record a later one corrects.

```
SELECT r.emulator, c.claim, c.status, r.recorded_at, h.cpu_model
FROM runs r JOIN checks c ON c.run_id = r.id JOIN hosts h ON h.id = r.host_id
WHERE r.superseded = 0 ORDER BY r.recorded_at;
```

## Hosting, rate limits and caching

- Static files on GitHub Pages, read with a plain GET. No key, no account.
- Any origin may read them (`Access-Control-Allow-Origin: *`), so a browser tool can call them directly.
- Responses are cached for 10 minutes (`Cache-Control: max-age=600`). Send the `ETag` back in `If-None-Match` to skip an unchanged download.
- GitHub may answer HTTP 429 to a client that sends too many requests, and a Pages site has a soft limit of 100 GB of traffic a month ([GitHub Pages limits](https://docs.github.com/en/pages/getting-started-with-github-pages/github-pages-limits)). Fetch the one shard or document a question needs.
- The base is the project's address, `https://abdess.github.io/retrobios/api/v1/`. Compare `commit` to know whether two downloads differ.

## Semantics and limits

Treat four questions separately: content identity (hashes), presence in the collection, acceptance by a specific emulator, and catalog provenance. One does not imply the others. In particular, presence, a matching dump catalog, or emulator compatibility is not a statement about copyright, ownership, or redistribution rights.

The data can be newer than the [latest published pack](https://github.com/Abdess/retrobios/releases/latest). A pack is published by hand, once every release check has passed.

See the [data model](https://abdess.github.io/retrobios/wiki/data-model/), [verification modes](https://abdess.github.io/retrobios/wiki/verification-modes/), and [methodology](https://abdess.github.io/retrobios/wiki/architecture/) before interpreting aggregate counts.

## Next steps

- [Reference index](https://abdess.github.io/retrobios/wiki/), every reference page in one list
- For contributors: [How to contribute](https://abdess.github.io/retrobios/contributing/)
