CSFloat Async API Client (Unofficial)
An unofficial, asynchronous Rust library for interacting with the CSFloat API. This library provides full support for programmatic access to listings, buy orders, user data, exchange rates, and more. All prices returned by the server are in cents.
Key Features
- Asynchronous design: Built on
tokioandreqwestfor non-blocking I/O. - Type-safe: Fully typed models using Rust's type system and
serde. - Fetch listings: Retrieve detailed listings with filters (price in cents, float, rarity, etc.).
- Buy orders: Get and manage buy orders for specific items.
- User information: Access your own profile, trades, and stall data.
- Listing management: Create, delete, and modify listings and buy orders.
- Proxy support: Optional SOCKS4/5 and HTTP(S) proxy support.
- Error handling: Clear error types with descriptive messages.
- Builder pattern: Ergonomic API for complex queries.
Installation
Add this to your Cargo.toml:
[]
= "0.1"
= { = "1.0", = ["full"] }
Quick Start
use ;
async
Examples
Create a Buy Order
use ;
async
Get User Profile
use Client;
async
Advanced Listing Search
use ;
async
Using Proxy
use Client;
async
Buy an Item
use Client;
async
Pagination
use Client;
async
Core Methods
Market Data
get_exchange_rates()– Retrieve current exchange rates.get_all_listings()– List items with optional filters (returns builder).get_specific_listing(listing_id)– Get detailed info for a specific listing.get_similar(listing_id)– Get similar listings.get_sales(market_hash_name, paint_index)– Get sales history.
Buy Orders
get_buy_orders(listing_id, limit)– Retrieve buy orders for a listing.get_my_buy_orders(page, limit)– List your own buy orders.create_buy_order(request)– Place a buy order.delete_buy_order(id)– Cancel an existing buy order.
User Data
get_me()– Fetch authenticated user profile.get_stall(user_id, limit)– Get a user's stall (listed items).get_inventory()– Get your inventory.get_watchlist(limit)– Get your watchlist.get_transactions(page, limit)– Get transaction history.get_trade_history(role, limit, page)– Get trade history.
Listing Management
create_listing(request)– Create a new listing.delete_listing(listing_id)– Delete a listing.update_listing_price(listing_id, price)– Update listing price.make_offer(listing_id, price)– Make an offer on a listing.buy_now(total_price, listing_id)– Instantly buy a listing.
Error Handling
The client uses a custom Result type and provides detailed error information:
use ;
async
Proxy Support
Support for HTTP, HTTPS, SOCKS4, and SOCKS5 proxies:
// HTTP proxy
let client = with_proxy?;
// SOCKS5 proxy with auth
let client = with_proxy?;
Contributing
Contributions are welcome! Feel free to submit a Pull Request.
License
This project is licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or Apache 2.0)
- MIT License (LICENSE-MIT or MIT)
at your option.
Disclaimer
This is an unofficial library and is not affiliated with or endorsed by CSFloat. Use at your own risk and ensure compliance with CSFloat's Terms of Service.