minecraft-registry-api
Typed API clients for Minecraft modding platforms — Modrinth, Mojang, Paper, Purpur, Fabric, Forge, NeoForge.
use ModrinthClient;
use ;
let client = new;
let result = client.search.await?;
println!;
// Faceted search
use ;
let facets = vec!;
let result = client.search.await?;
use MojangClient;
let client = new;
let manifest = client.get_manifest.await?;
let latest = manifest.versions.iter
.find
.unwrap;
use ;
let client = new;
let promos = client.get_promos.await?;
let jar = client.download_installer.await?;
APIs
Each API is behind an optional Cargo feature:
| Feature | Module | Client | Methods |
|---|---|---|---|
modrinth |
modrinth |
ModrinthClient |
search, get_project, get_versions, get_version, get_loaders, get_game_versions |
mojang |
mojang |
MojangClient |
get_manifest, download |
paper |
paper |
PaperClient |
get_project, get_build, download_build |
purpur |
purpur |
PurpurClient |
get_project, get_version, download_build |
fabric |
fabric |
FabricClient |
get_game_versions, get_loaders, get_installer_versions, download_installer |
forge |
forge |
ForgeClient |
get_promos, download_installer |
neoforge |
neoforge |
NeoForgeClient |
get_metadata, download_installer |
# Default: modrinth + mojang
# Single API
# All APIs
Modrinth facets
ModrinthClient::search accepts facets — typed filters that narrow results:
use ;
let facets = vec!;
Multiple facets in the same inner Vec are OR'd. Multiple inner Vecs are AND'd.
Models
Models map 1:1 to each API's JSON. There is no unified domain model — that belongs in the consumer (e.g. conduit-core). Each models.rs module exposes the raw serde structs.
Error handling
All methods return Result<T, minecraft_registry_api::error::ApiError>:
ApiError::Http(reqwest::Error)— request failed or returned a non-2xx statusApiError::Xml(quick_xml::de::DeError)— XML deserialization (forge, neoforge)
ApiError implements From<reqwest::Error> and std::error::Error.
Install
Then enable the features you need (modrinth and mojang are on by default).
Tests
Tests hit real APIs. No mocks, no fixtures.
Clippy lints deny unwrap_used and expect_used across the library. Test modules use #[allow(clippy::unwrap_used)].
License
MIT