| Crates.io | warframe_market |
| lib.rs | warframe_market |
| version | 1.0.0 |
| created_at | 2025-09-06 19:42:41.235556+00 |
| updated_at | 2025-09-19 09:17:52.636322+00 |
| description | An async api wrapper for the warframe.market api |
| homepage | |
| repository | https://github.com/TylerHendricks/warframe_market |
| max_upload_size | |
| id | 1827400 |
| size | 89,496 |
This library is a wrapper for the Warframe Market API.
This library gets the response from the WFM API and deserializes it into the corresponding Rust type. The Reqwest library is used to get the response from the WFM API, then Serde is used to deserialize the json into rust.
The intention of this library is to match the official WFM API v2 Data Models to Rust types.
Most of the struct fields are wrapped in an Option, as the WFM API responses are generic for many types of possible Warframe items. For instance, a mod can have a max rank, but a weapon has no use for this field.
No underlying rate limiter exists in this library. The WFM API states: "3 requests per second."
use warframe_market::MarketClient;
let client = MarketClient::new();
// Get all items. Returns `ItemShort`s with fewer fields than `Item`s.
let items = client.get_items().await.unwrap();
assert_eq!(items.len(), 3613);
assert_eq!(items[0].slug, "secura_dual_cestra".to_string());
// Get an individual item. Returns `Item` which can have more fields than `ItemShort`.
let item = client.get_item("secura_dual_cestra").await.unwrap();
assert_eq!(item.req_mastery_rank.unwrap(), 10);
assert_eq!(item.trading_tax.unwrap(), 2000);
// Now accepts None instead of an empty HashMap.
let archon = client.get_orders_item_top("archon_intensify", None).await.unwrap();
assert_eq!(archon.get("buy").unwrap()[0].order.rank, Some(10));
let query = HashMap::new();
query.insert("rank".to_string(), "1".to_string());
let queried_archon = client.get_orders_item_top("archon_intensify", Some(&query)).await.unwrap();
assert_eq!(queried_archon.get("buy").unwrap()[0].order.rank, Some(1));
// Now supports some calls to post endpoints (refer to changelog):
// Sign in.
let user = client.sign_in(<username>, <password>, "my_device_id").await.unwrap(); // Fill in your information
// Post a new order.
let post_order = PostOrder {
item_id: "653833d6123a401b2563081d".to_string(),
r#type: Type::Sell,
platinum: 100,
quantity: 1,
..Default::default()
};
let post_order = client.post_order(&post_order).await.unwrap();
The sign out function is producing unexpected behavior. It returns an Ok status, but the token remains valid for use. Still, the MarketClient replaces the auth token with None, preventing further usage of the token that was expected to be terminated.