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.
§Coverage
- Auth API
- Force Refresh Xcsrf -
Client::force_refresh_xcsrf
- Force Refresh Xcsrf -
- BEDEV2 API
- Fetch Non-Tradable Limited Details -
Client::non_tradable_limited_details
- Fetch Collectible Product ID -
Client::collectible_product_id
- Fetch Collectible Product ID Bulk -
Client::collectible_product_id_bulk
- Fetch Collectible Creator ID -
Client::collectible_creator_id
- Purchase Non-Tradable Limited -
Client::purchase_non_tradable_limited
- Fetch Non-Tradable Limited Details -
- Catalog API
- Fetch Item Details -
Client::item_details
- Fetch Product ID -
Client::product_id
- Fetch Product ID Bulk -
Client::product_id_bulk
- Fetch Collectible Item ID -
Client::collectible_item_id
- Fetch Collectible Item ID Bulk -
Client::collectible_item_id_bulk
- Avatar Catalog Search -
Client::avatar_catalog_search
- Fetch Item Details -
- Chat API
- Fetch Unread Conversation Count -
Client::unread_conversation_count
- Fetch Unread Conversation Count -
- Economy API
- Fetch Robux Balance -
Client::robux
- Fetch Resellers -
Client::resellers
- Fetch User Sales -
Client::user_sales
- Put Limited On Sale -
Client::put_limited_on_sale
- Take Limited Off Sale -
Client::take_limited_off_sale
- Purchase Tradable Limited -
Client::purchase_tradable_limited
- Fetch Robux Balance -
- Group API
- Fetch Group Roles -
Client::group_roles
- Fetch Group Role Members -
Client::group_role_members
- Set Group Member Role -
Client::set_group_member_role
- Fetch Group Roles -
- Presence API
- Register Presence -
Client::register_presence
- Register Presence -
- Private Messages API
- Fetch Messages -
Client::messages
- Fetch Messages -
- Thumbnails API
- Fetch Thumbnail Url Bulk -
Client::thumbnail_url_bulk
- Fetch Thumbnail Url -
Client::thumbnail_url
- Fetch Thumbnail Url Bulk -
- Trades API
- Accept Trade -
Client::accept_trade
- Decline Trade -
Client::decline_trade
- Send Trade -
Client::send_trade
- Fetch Trade Details -
Client::trade_details
- Fetch Trades List -
Client::trades
- Fetch Trade Count -
Client::trade_count
- Accept Trade -
- Users API
- Fetch User ID -
Client::user_id
- Fetch Username -
Client::username
- Fetch Display Name -
Client::display_name
- User Search -
Client::user_search
- Username User Search - [
Client::username_user_search
] - Fetch User Details -
Client::user_details
- Fetch User ID -
- Friends API
- Fetch Count of Pending Friend Requests -
Client::pending_friend_requests
- Fetch Friend Requests -
Client::friend_requests
- Fetch Friends List -
Client::friends_list
- Accept Friend Request -
Client::accept_friend_request
- Decline Friend Request -
Client::decline_friend_request
- Send Friend Request -
Client::send_friend_request
- Unfriend -
Client::unfriend
- Fetch Count of Pending Friend Requests -
- UNDER CONSTRUCTION
- Upload Classic Clothing To Group -
Client::upload_classic_clothing_to_group
- Upload Classic Clothing To Group -
§Quick Start Examples
§Example 1 - Purchase Free UGC Limited
This code snippet allows you to purchase a free ugc limited.
It can be modified to purchase a non-free ugc limited by changing the price.
// Replace this value with your own roblosecurity token.
const ROBLOSECURITY: &str = "your-roblosecurity-token";
// Replace this value with the item id of the item you want to purchase.
const ITEM_ID: u64 = 13119979433;
// Replace this value if you want to purchase a non-free item.
const PRICE: u64 = 0;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = roboat::ClientBuilder::new()
.roblosecurity(ROBLOSECURITY.to_string())
.build();
let collectible_item_id = client.collectible_item_id(ITEM_ID).await?;
let collectible_product_id = client
.collectible_product_id(collectible_item_id.clone())
.await?;
let collectible_creator_id = client
.collectible_creator_id(collectible_item_id.clone())
.await?;
client
.purchase_non_tradable_limited(
collectible_item_id,
collectible_product_id,
collectible_creator_id,
PRICE,
)
.await?;
println!("Purchased item {} for {} robux!", ITEM_ID, PRICE);
Ok(())
}
§Example 2 - Fetch User Info
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 3 - Fetch Price of Tradable Limited
This code snippet allows you to view the lowest price of a tradable 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 4 - Fetch Item Details
This code snippet allows you to get the details of an item.
use roboat::catalog::{Item, ItemType};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = roboat::ClientBuilder::new().build();
let item = Item {
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 bedev2::PurchaseNonTradableLimitedError;
pub use economy::PurchaseTradableLimitedError;
pub use reqwest;
Modules§
- bedev2
- A module for endpoints prefixed with https://apis.roblox.com/*.
- catalog
- A module for endpoints prefixed with https://catalog.roblox.com/*.
- economy
- A module for endpoints prefixed with https://economy.roblox.com/*.
- friends
- A module for endpoints prefixed with https://friends.roblox.com/*.
- groups
- A module for endpoints prefixed with https://groups.roblox.com/*.
- presence
- A module for endpoints prefixed with https://presence.roblox.com/*.
- private_
messages - A module for endpoints prefixed with https://privatemessages.roblox.com/*.
- thumbnails
- A module for endpoints prefixed with https://thumbnails.roblox.com/*.
- trades
- A module for endpoints prefixed with https://trades.roblox.com/*.
- users
- A module for endpoints prefixed with https://users.roblox.com/*.
Structs§
- Challenge
Info - The challenge info returned by Roblox when a challenge is required to complete a request.
This challenge can be either a two step verification code or a captcha. This is specified by the
challenge_type
field. - Client
- A client used for making requests to the Roblox API.
- Client
Builder - A builder used for constructing a
Client
. Constructed usingClientBuilder::new
. - User
- The universal struct for a Roblox user in this crate.
Enums§
- Challenge
Type - The type of the challenge required to complete a request. This can be either a captcha or a two step verification code (can be an authenticator or an email).
- Limit
- The maximum amount of instances to return from an endpoint. Used as a parameter in various methods that call endpoints.
- Roboat
Error - The universal error used in this crate. Encapsulates any sub-errors used in this crate.