Registry / ecommerce / amzn-sp-api

amzn-sp-api

JSON →
library1.9.0pypypiunverified

The Selling Partner API Python SDK (v1.9.0) allows you to easily connect to and work with Amazon SP-API. It provides a client for making REST calls to Amazon's Selling Partner API, with built-in authentication and serialization. Development seems intermittent; check GitHub for latest status.

pip install amzn-sp-api
INSTALL
IMPORT
SIG · AMZN-SP-API
A
amzn-sp-api
ecommercepythonv1.9.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SellingPartnerApi
from spapi import SellingPartnerApi
from sp_api.api import SellingPartnerApi

Initialize the client and call the Orders API. Note that the constructor expects certain credentials; refer to official docs for full setup.

import os from sp_api.api import Orders from sp_api.base import SellingPartnerApi # Set up credentials (use environment variables for security) sp_api = SellingPartnerApi( refresh_token=os.environ.get('SP_API_REFRESH_TOKEN', ''), lwa_app_id=os.environ.get('SP_API_LWA_CLIENT_ID', ''), lwa_client_secret=os.environ.get('SP_API_LWA_CLIENT_SECRET', ''), aws_access_key=os.environ.get('SP_API_AWS_ACCESS_KEY', ''), aws_secret_key=os.environ.get('SP_API_AWS_SECRET_KEY', ''), role_arn=os.environ.get('SP_API_ROLE_ARN', ''), ) # Example: get orders from the last 7 days orders = Orders(sp_api) response = orders.get_orders(CreatedAfter='-P7D') print(response.payload)
Debug
Known issues
breakingThe v1.9.0 release changed internal module names from camelCase to snake_case. Existing imports like 'from sp_api.api.orders import Orders' must be updated to 'from sp_api.api import Orders'.
fix
Import from sp_api.api directly: `from sp_api.api import Orders`.
affects: <1.9.0 -> >=1.9.0
gotchaThe package name on PyPI is `amzn-sp-api`, but the importable module is `sp_api`. Users often try `import amzn_sp_api` which fails.
fix
Use `import sp_api` or `from sp_api.api import ...`.
affects: all
deprecatedThe `SellingPartnerApi` class is deprecated in favor of using individual API clients directly? Check official docs as pattern may vary.
fix
Instantiate API classes directly with credentials via `Orders(credentials)`.
affects: >=1.9.0
Upgrade
Version history
1.9.0latest on PyPI · released May 29, 2026
Audit
Dependencies
boto3requiredRequired for AWS Signature V4 signing
Agent activity
55 hits · last 30 days
node
50
Resources
amzn-sp-api — pip install amzn-sp-api · libregistry