python-amazon-sp-api: a Python wrapper for Amazon's Selling Partner API
Python wrapper to access the amazon selling partner API
At a glance
- What is it?
- This library wraps Amazon's Selling Partner API so that orders, reports, feeds and the Data Kiosk can be called from Python with a small object per service. It now also ships an async client package, and new API surfaces are generated from Amazon's own model files rather than hand written.
- Who is it for?
- python-amazon-sp-api fits a Python team that needs to talk to the Selling Partner API without handling SigV4 signing, report polling and feed submission by hand, and that wants the same client shape for the Advertising API. It does not fit a team that wants a guaranteed stable surface, since endpoint clients are generated from Amazon's models and the version line is a long sequence of patch releases.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 1 day ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 24, 2026, and from our analysis. They are not legal advice.
Editorial analysis
One object per Selling Partner API service
The library is described as a wrapper to access Amazon's Selling Partner API with an easy-to-use interface, and the shape is a class per service. The README's usage example imports Orders, Reports, DataKiosk and Feeds from sp_api.api, and the error type SellingApiException from sp_api.base alongside the ReportType enum from sp_api.base.reportTypes. Each service object is constructed and then called, with the response payload read off the result.
from sp_api.api import Orders
from sp_api.api import Reports
from sp_api.base.reportTypes import ReportTypeBecause the client is constructed per call rather than held, the pattern is easy to read but also easy to get wrong under load, since each construction implies credential resolution and transport setup unless the underlying client caches it. The exceptions are caught explicitly in the example, with the SellingApiException printed rather than swallowed, which is the shape you want in a batch job that should stop on the first bad response.
Installation, with optional AWS credential backends
The package is on PyPI and installs with pip.
pip install python-amazon-sp-api
pip install "python-amazon-sp-api[aws]" # if you want to use AWS Secret Manager Authentication.
pip install "python-amazon-sp-api[aws-caching]" # if you want to use the Cached Secrets from AWSThe extras matter because the default install is deliberately thin. The setup file lists httpx, cachetools, confuse and typing-extensions as the required dependencies, and puts boto3 in the aws extra and boto3 with aws-secretsmanager-caching in the aws-caching extra. The aws-caching extra exists because fetching a secret from AWS Secrets Manager on every API call is a lot of latency for a service that is rate limited to begin with, so the client can cache the secret instead. The package requires Python 3.10 or newer, and the repository ships a credentials.yml at the root, which is the confuse configuration file the library reads for keys, region and endpoint settings.
Orders, reports, feeds and restricted data tokens
The four service families in the example cover most of what a marketplace integration needs. Orders().get_orders takes time filters such as CreatedAfter, and the example passes a UTC timestamp computed from the current time minus seven days. Reports().create_report takes a reportType, with the example using ReportType.GET_MERCHANT_LISTINGS_ALL_DATA to request a report. Feeds().submit_feed takes a feed type and a file or bytes IO, with content_type='text/tsv' as an example, and the README notes that feeds can also be submitted following Amazon's own documentation. The PII case has its own path: Orders(restricted_data_token='<token>') is how you get at restricted order data, which Amazon requires a token for. The example also shows a shortcut form of get_orders using LastUpdatedAfter rather than a full filter set.
The Data Kiosk client, which takes a GraphQL query
DataKiosk is the newest-looking piece of the API surface, and it works differently from the rest. Instead of a set of named parameters, it takes a query string in GraphQL form. The README's example creates a query against an analytics sales and traffic schema, with a nested selection of sales and traffic by ASIN, a date range, an aggregateBy of SKU, a list of marketplace identifiers, and a selection of child ASIN, sales, ordered product sales and traffic fields. The query is passed to client.create_query and the result printed. The practical implication is that the wrapper does not abstract this API away, it just handles the request shape, the signing and the response envelope, which is arguably the right call for a query language that is meant to be written by hand.
An async client that mirrors the sync one
The README's new features section lists two things. The first is an httpx-based transport for sync clients, which the README credits with enabling connection pooling and consistent streaming behaviour. The second is an async client package under sp_api.asyncio for non-blocking calls across services. The async usage is the same API with await and an async context manager, and the clients work as async context managers.
import asyncio
from datetime import datetime, timedelta, timezone
from sp_api.asyncio.api import Orders, Reports
from sp_api.base.reportTypes import ReportTypeThe example awaits get_orders with a LastUpdatedAfter filter inside an async with block, then awaits create_report for the merchant listings report, and then shows the shortcut form of calling Reports().create_report directly without the context manager. Having both forms supported is a real convenience, because the shortcut path is what you want in a script and the context manager is what you want in a service where you want the connection released deterministically.
New endpoints are generated from Amazon's own model files
The maintenance story is the part of this project that differs from a hand-written wrapper. The README says you can create a new endpoint file by running make_endpoint with the URL of an Amazon model JSON file, and the example points at the listings restrictions model in Amazon's selling-partner-api-models repository. The result is described as a ready to use client, and the README asks contributors to open a pull request with the new code. The command is a script installed with the package, since the setup file registers make_endpoint/make_endpoint in scripts. The base client itself is factored out into a separate project, rapid_rest_client, and the README describes it as pretty extensible and usable for any other API, which is also how the Advertising API support works: a separate project built on top of this client by another author.
Active release cadence, MIT licensed, and a community support channel
The project is busy. The three most recent releases are v2.1.33, v2.1.32 and v2.1.31, all on 2026-10-17 within about six minutes of each other, and the last push was on 2026-10-19. The repository is not archived. The licence is MIT, and the README carries a disclaimer that the project is not affiliated with Amazon, which is worth noting since the name and the API it wraps are Amazon's. Support runs through GitHub discussions and a Slack workspace, and the documentation is published on Read the Docs. The repository root also carries a SECURITY.md, a CODE_OF_CONDUCT.md, a CHANGELOG.md and a generate_changelog.py script, which suggests the release notes are partly automated from commit messages, and a llms.txt file for machine-readable documentation.
Editorial conclusion
python-amazon-sp-api fits a Python team that needs to talk to the Selling Partner API without handling SigV4 signing, report polling and feed submission by hand, and that wants the same client shape for the Advertising API. It does not fit a team that wants a guaranteed stable surface, since endpoint clients are generated from Amazon's models and the version line is a long sequence of patch releases. Verify first that the service you need has a client in the package, read the credential configuration the library expects, and remember that Amazon rate-limits and throttles responses, so a retry policy still belongs in your code.
Frequently asked questions
How do I install python-amazon-sp-api?
Run pip install python-amazon-sp-api. If you want to use AWS Secret Manager for authentication, install the aws extra with pip install "python-amazon-sp-api[aws]", or the aws-caching extra with pip install "python-amazon-sp-api[aws-caching]" to cache the secrets locally. The package requires Python 3.10 or newer.
How do I request a report with python-amazon-sp-api?
Create a Reports client and call create_report with a report type, for example Reports().create_report(reportType=ReportType.GET_MERCHANT_LISTINGS_ALL_DATA). The report types come from sp_api.base.reportTypes.
Does python-amazon-sp-api support async requests?
Yes. There is an async client package under sp_api.asyncio with Orders and Reports, used with async with and await, and the same methods are available as a shortcut without the context manager. The sync clients use an httpx-based transport with connection pooling.
How do I get restricted or PII order data?
The README shows passing a restricted_data_token to the client, for example Orders(restricted_data_token='<token>').get_orders(...), which is the path Amazon requires for restricted order data.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/saleweaver-python-amazon-sp-api)Was this useful?