Skip to content

banished-banishedinfo ​

Optional banishedinfo.com support for Un-Banished: list and search the site's Banished mods, read a mod's versions, and install the .pkm packages of a version. It is not part of the original game.

The site has no public API. The crate reads what its own pages use:

WhatWhere
The mod list, by order and section/mods/ajax?action=mods&start=…&count=…&section=…&sort=… (JSON)
Search resultsthe search page's var mods = […]
A mod's versionsthe links /mods/download/<id>-<name>/<n> on its page
A version's file/mods/file/<id>-<name>/<n>, which redirects to the download

No account is needed. Requests carry a user agent that names Un-Banished, and are made only when the player lists, searches or installs. The site sends no CORS headers, so only native builds can use it (feature native).

rust,ignore
use banished_banishedinfo::{native::Client, Sort};

let client = Client::new("0.2.0");
for m in client.list(Sort::Downloads, "", 0, 20)? {
    println!("{} {} by {}", m.id, m.title, m.author);
}
let m = banished_banishedinfo::Mod::with_id(34);
let newest = client.versions(&m)?.remove(0);
client.install(&newest, "WinData".as_ref(), |_, _| {})?;

Un-Banished 0.4.0-99617f9 is free software under the MIT or Apache-2.0 licence. It is not affiliated with or endorsed by Shining Rock Software.