Crates.io Documentation dependency status

roboat

An API wrapper for Roblox.com.

This library is designed to be high-performance capable, meaning that it supports proxies and is capable of making requests in parallel.

Covered Endpoints

Quick Start Examples

Example 1

This code snippet allows you to get the details of an item.

```rust use roboat::catalog::avatar_catalog::{ItemArgs, ItemType};

[tokio::main]

async fn main() -> Result<(), Box> { let client = roboat::Client::new();

let item = ItemArgs {
    item_type: ItemType::Asset,
    id: 1365767,
};

let details = &client.item_details(vec![item]).await?[0];

let name = &details.name;
let description = &details.description;
let creator_name = &details.creator_name;
let price = details.price.unwrap_or(0);

println!("Name: {}", name);
println!("Description: {}", description);
println!("Creator Name: {}", creator_name);
println!("Price: {}", price);

Ok(())

} ```

Example 2

This code snippet allows you view the lowest price of a limited item by fetching a list of reseller listings.

```rust // Replace value this with your own roblosecurity token. const ROBLOSECURITY: &str = "your-roblosecurity-token";

[tokio::main]

async fn main() -> Result<(), Box> { let client = roboat::Client::withroblosecurity(ROBLOSECURITY.tostring());

let item_id = 1365767;
let limit = roboat::Limit::Ten;
let cursor = None;

let (resellers, _) = client.resellers(item_id, limit, cursor).await?;

println!("Lowest Price for Valkyrie Helm: {}", resellers[0].price);  

Ok(())

} ```

Example 3

This code snippet allows you to get your current robux, id, username, and display name.

```rust // Replace value this with your own roblosecurity token. const ROBLOSECURITY: &str = "your-roblosecurity-token";

[tokio::main]

async fn main() -> Result<(), Box> { let client = roboat::Client::withroblosecurity(ROBLOSECURITY.tostring());

let robux = client.robux().await?;
let user_id = client.user_id().await?;
let username = client.username().await?;
let display_name = client.display_name().await?;    

println!("Robux: {}", robux);
println!("User ID: {}", user_id);
println!("Username: {}", username);
println!("Display Name: {}", display_name);

Ok(())

} ```

Related Crates

This crate is a sister crate of roli, an API wrapper for Rolimons.com.

Contributing

Pull requests and issues are welcome!

Please refer to CONVENTIONS.md for information on conventions used in this crate.

Additional resources used to help make this crate are available in RESOURCES.md.

License

MIT License