Skip to content

MatthewThompson/arnak

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build crates.io Docs License: MIT Unsafe

NOTE: This library is currently in prerelease, not all endpoints have been added and breaking changes could happen often before 1.0.0.

Arnak

Rust library for BoardGameGeek XML API bindings.

It should be noted that the underlying API can return information from RpgGeek and VideoGameGeek but these are purposely hidden for consistency, and to avoid confusion. For example, the collection endpoint only returns board games in the user's collection, and not RPG or video games that the same user has on the respective site collections.

Example

This example uses Tokio, so it would also be needed as a dependency:

[dependencies]
arnak = { version = "0.5.0" }
tokio = { version = "1" }
use arnak::BoardGameGeekApi;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let api = BoardGameGeekApi::new();
    let collection = api.collection().get_owned("bluebearbgg").await;
    match collection {
        Ok(collection) => println!("bluebearbgg owns {} games.", collection.items.len()),
        Err(e) => println!("Error: {e}"),
    }

    Ok(())
}

Endpoints

Collection

For a given user, return their collection of board games. This does not just mean games owned by the user, but also ones on their wishlist, previously owned, etc...

Game Family

Request a family or number of families by their IDs. A game family is a group of games and expansions that fall under a certain group or name. For example Catan and Carcassone both have game families containing all of their respective expansions and related games.

Search

Search for a game, returning everything that matches the search. Also includes a search_exact function that will only return exact name matches.

Hot list

Returns the top 10 currently trending games.

Known issues

  • In the fields that return HTML, such as descriptions, HTML escape sequences are used. However UTF-8 code points are used, which means for example for ü has been encoded as &#195;&#188; but this decodes to ü. Sorry Hans im Gluück!

Formatting

Some rustfmt options used are nightly only. So to format run cargo +nightly fmt

About

Rust library for the BoardGameGeek XML API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages