Expand description
§banished-nexus
Optional Nexus Mods support for Un-Banished. It is not part of the original game: Banished’s Steam version browses the Steam Workshop in the Mods menu’s Browse tab, and Un-Banished can show that tab for Nexus Mods instead, when the player has set an API key.
| Module | What it contains |
|---|---|
api | The requests (search, a mod’s files, the account, download links) and their answers |
nxm | nxm:// links from the website’s “Mod Manager Download” button |
install | The .pkm packages in a download (.zip or a bare .pkm) |
native | With the native feature: sending requests and downloading (ureq), writing packages, and finding the API key |
The crate builds each request as a Request (method, address, headers, body) and reads each
answer from its bytes. So the game sends them with fetch in the browser and with
native::send on the desktop.
§Use it
[dependencies]
banished-nexus = { path = "../../crates/nexus", features = ["native"] }use banished_nexus::{api, native, App};
let app = App::un_banished("0.2.0");
// Searches need no key.
let page = api::parse_search(&native::send(&api::search(&app, "terrain", api::Sort::Downloads, 0, 20), false)?)?;
for m in &page.mods {
println!("{} {} by {}", m.mod_id, m.name, m.author);
}
// Downloads need the player's key, and Premium or an nxm:// link.
let key = native::stored_key().expect("set BANISHED_NEXUS_API_KEY");
let files = api::parse_files(&native::send(&api::files(&app, 19), false)?)?;
let file = api::main_file(&files).unwrap();
let source = native::Source::File { mod_id: 19, file_id: file.file_id, file_name: file.file_name.clone() };
native::install_from(&app, &key, &source, "WinData".as_ref(), |_| {})?;§Rules
Nexus Mods asks every application to send its name and version (Application-Name,
Application-Version), which api::headers does. A personal API key is for testing and personal
use; a public build of Un-Banished needs a registered application. The key stays with the player
(the settings file, BANISHED_NEXUS_API_KEY, or the browser’s storage) and is sent only to
api.nexusmods.com.
Of the 80 Banished mods listed in October 2026, the main file was a .zip for 62, a .7z for 7
and a .rar for 9. Only .zip and bare .pkm files are unpacked here.
Modules§
- api
- The Nexus Mods requests Un-Banished sends, and how their answers are read.
- install
- The
.pkmpackages in a downloaded file. - native
- Sending requests and downloading files on native builds (blocking; run it off the main thread in the game), and writing installed packages to the pack folder.
- nxm
nxm://links. The website’s “Mod Manager Download” button gives one for a file:nxm://banished/mods/19/files/49?key=…&expires=…&user_id=…. Itskeyandexpireslet an account without Premium get that file’s download link for a short time.
Structs§
- App
- The application that sends the requests, as Nexus Mods asks every application to say.
- Request
- An HTTP request to send.
Enums§
- Error
- Something that went wrong with Nexus Mods.
Constants§
- API_V1
- The REST API (version 1), which needs an API key.
- API_V2
- The GraphQL API (version 2), which answers searches without a key.
- GAME_
DOMAIN - The game’s domain name on Nexus Mods, used in its addresses.
- GAME_ID
- The game’s id on Nexus Mods, used by the GraphQL API.