Python and JavaScript client libraries for SDKs now available for Selling Partner API
In early 2024 Amazon released official Python and JavaScript client libraries named amazon-sp-api-sdk that wrap the Selling Partner API. The packages (pip install amazon-sp-api-sdk, npm install amazon-sp-api-sdk) provide built‑in LWA token refresh, AWS Signature V4 signing, typed models, automatic pagination and granular exception classes.
Overview
Amazon has introduced official client libraries for Python and JavaScript that wrap the Selling Partner API (SP‑API) SDKs. Launched in early 2024, these packages let developers invoke SP‑API operations using native language objects instead of hand‑crafting HTTP calls. Sellers and solution providers should start using them now to speed up integration, cut down on coding errors, and gain immediate access to the full suite of SP‑API features.
Key Points
- Cross‑language coverage — Amazon now publishes ready‑to‑install packages for both Python (pip) and JavaScript/Node.js (npm), each exposing classes for every SP‑API endpoint, from Orders to Catalog.
- Built‑in authentication — The libraries handle LWA token refresh and AWS Signature V4 signing internally; developers only need to provide the LWA client credentials and the IAM role ARN.
- Typed request/response models — All payloads are represented as language‑specific objects, so JSON serialization and deserialization happen automatically, reducing manual mapping bugs.
- Automatic pagination — List‑type operations return iterators that fetch subsequent pages behind the scenes, eliminating the need to manage
NextTokenorpageSizeparameters. - Granular error classes — HTTP error codes are mapped to distinct exception types such as
ThrottlingExceptionorInvalidTokenException, enabling precise retry and fallback logic. - Semantic versioning — Each library follows a major.minor.patch scheme; updates are released in lockstep with SP‑API version changes, preserving backward compatibility for existing code.
How the New SDK Libraries Work
-
Install the package —
- Python: Run
pip install amazon-sp-api-sdkto add theamazon_sp_apimodule to the virtual environment. - JavaScript: Execute
npm install amazon-sp-api-sdkto pull the package into a Node.js project. : A developer building a daily price‑adjustment script runs the pip command and instantly gains access to the class without writing any HTTP boilerplate.
- Python: Run
Analysis & Recommendations
Why This Matters
Using the SDK cuts integration code from dozens of lines to a few, eliminating manual signing and pagination bugs. Built‑in ThrottlingException handling lets price‑adjustment jobs reduce daily failures from dozens to near zero, accelerating market launches.
Key Takeaways
- The SDKs were launched in early 2024 and are available via pip (amazon-sp-api-sdk) and npm (amazon-sp-api-sdk).
- Authentication is handled automatically: developers only supply LWA client ID, secret, refresh token and IAM role ARN.
- List‑type operations return iterators that fetch all pages, removing the need to manage NextToken manually.
Recommended Actions
- →Install the Python SDK: run `pip install amazon-sp-api-sdk` in your virtual environment.
- →Configure credentials in a JSON file or environment variables (e.g., set AWS_ROLE_ARN) and instantiate the needed service client in your code.
Comments
Join the discussion
Log in or create an account to share your thoughts on this update.
No comments yet. Be the first to share your thoughts!