# Amazon SPAPI Rust SDK
[](https://crates.io/crates/amazon-spapi)
[](https://docs.rs/amazon-spapi)
[](LICENSE)
A Rust client library for Amazon Selling Partner API (SP-API), providing complete API coverage and type-safe interfaces.
## Features
- **Complete API Coverage**: Auto-generated API models from OpenAPI specifications covering nearly all Amazon SP-API endpoints
- **Integrated Client**: High-level client wrapper with convenient methods for common API operations
## Quick Start
### 1. Environment Setup
First, set up your Amazon SP-API credentials as environment variables:
```bash
export SPAPI_CLIENT_ID="your_client_id"
export SPAPI_CLIENT_SECRET="your_client_secret"
export SPAPI_REFRESH_TOKEN="your_refresh_token"
export SPAPI_REGION="us-east-1"
export SPAPI_SANDBOX="false" # or "true" for sandbox environment
```
### 2. Basic Usage
```rust
use amazon_spapi::client::{SpapiClient, SpapiConfig};
use anyhow::Result;
#[tokio::main]
async fn main() -> Result<()> {
// Create client from environment variables
let client = SpapiClient::new(SpapiConfig::from_env()?)?;
// Get FBA inventory summaries
let inventory = client
.get_inventory_summaries(
"Marketplace",
amazon_spapi::marketplace_ids::US,
vec![amazon_spapi::marketplace_ids::US.to_string()],
Some(false),
None,
None,
None,
None,
)
.await?;
println!("Inventory summaries: {:?}", inventory);
Ok(())
}
```
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Related Links
- [Amazon SP-API Official Documentation](https://developer-docs.amazon.com/sp-api/)
---
**Note**: This is an unofficial Amazon SP-API Rust client library. Please ensure compliance with Amazon's terms of service and API limitations.