Expand description
About
A high performance interface for the Roblox API.
This library is designed to be high-performance capable, meaning
that a Client is designed to work with proxies, as well as make
multiple requests in parallel. All API calls are made through a Client.
Extensive documentation is used throughout this crate. All public methods in this crate are documented and have at least one corresponding example.
Covered Endpoints
- Catalog API
- Item Details -
Client::item_details
- Item Details -
- Economy API
- Robux Balance -
Client::robux - Resellers -
Client::resellers - User Sales -
Client::user_sales - Put Limited On Sale -
Client::put_limited_on_sale - Take Limited Off Sale -
Client::take_limited_off_sale
- Robux Balance -
- Users API
- User Details -
Client::user_id,Client::username, andClient::display_name(all of them use the same endpoint internally and cache the results) - User Search -
Client::user_search
- User Details -
- Presence API
- Register Presence -
Client::register_presence
- Register Presence -
- Trades API
- Trades List -
Client::trades
- Trades List -
Quick Start Examples
Example 1
This code snippet allows you to get your current robux, id, username, and display name.
// Replace this value with your own roblosecurity token.
const ROBLOSECURITY: &str = "your-roblosecurity-token";
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = roboat::ClientBuilder::new().roblosecurity(ROBLOSECURITY.to_string()).build();
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(())
}Example 2
This code snippet allows you to view the lowest price of a limited item by fetching a list of reseller listings.
// Replace this value with your own roblosecurity token.
const ROBLOSECURITY: &str = "your-roblosecurity-token";
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = roboat::ClientBuilder::new().roblosecurity(ROBLOSECURITY.to_string()).build();
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 the details of an item.
use roboat::catalog::avatar_catalog::{ItemArgs, ItemType};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = roboat::ClientBuilder::new().build();
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(())
}Re-exports
pub use reqwest;
Modules
- A module for endpoints prefixed with https://catalog.roblox.com/*.
- A module for endpoints prefixed with https://economy.roblox.com/*.
- A module for endpoints prefixed with https://trades.roblox.com/*.
- A module for endpoints prefixed with https://users.roblox.com/*.
Structs
- A client used for making requests to the Roblox API.
- A builder used for constructing a
Client. Constructed usingClientBuilder::new.
Enums
- The maximum amount of instances to return from an endpoint.
- The universal error used in this crate.