amazon-spapi

Crates.ioamazon-spapi
lib.rsamazon-spapi
version2.0.1
created_at2025-08-06 03:54:49.483743+00
updated_at2025-09-05 00:27:58.173566+00
descriptionA Rust client library for Amazon Selling Partner API (SP-API)
homepagehttps://github.com/houxd/amazon-spapi
repositoryhttps://github.com/houxd/amazon-spapi
max_upload_size
id1783359
size6,385,686
houxd (houxd)

documentation

https://docs.rs/amazon-spapi

README

Amazon SPAPI Rust SDK

Crates.io Documentation 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:

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

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 file for details.

Related Links


Note: This is an unofficial Amazon SP-API Rust client library. Please ensure compliance with Amazon's terms of service and API limitations.

Commit count: 25

cargo fmt