## Python SDK for Selling Partner API
[](https://pypi.org/project/amzn-sp-api/)
[](https://www.youtube.com/watch?v=IEWTnO2L620&pp=0gcJCbEJAYcqIYzv)
*Click on the image to watch the video.*
The Selling Partner API SDK for Python enables you to easily connect your Python application to Amazon's REST-based Selling Partner API.
* [Learn more about Selling Partner API](https://developer.amazonservices.com/)
* [Selling Partner API Documentation](https://developer-docs.amazon.com/sp-api/)
### Getting started
#### Credentials
Before you can use the SDK, you need to be registered as a Selling Partner API developer. If you haven't done that yet, please follow the instructions in the [SP-API Registration Overview](https://developer-docs.amazon.com/sp-api/docs/sp-api-registration-overview).
You also need to register your application to get valid credentials to call SP-API. If you haven't done that yet, please follow the instructions in [Registering your Application](https://developer-docs.amazon.com/sp-api/docs/registering-your-application).
If you are already registered successfully, you can find instructions on how to view your credentials in [Viewing your Application Information and Credentials](https://developer-docs.amazon.com/sp-api/docs/viewing-your-application-information-and-credentials).
#### Minimum requirements
To run the SDK you need Python version 3.9 or higher.
#### Install the SDK
1. Find the latest version number [here](https://github.com/amzn/selling-partner-api-sdk/releases).
2. Add the dependency to your project
##### Using pip:
```bash
pip install amzn-sp-api
```
##### Add to your project requirements.txt
Add the following line to the `requirements.txt` file if needed:
```
amzn-sp-api >= "1.0.0"
```
### Use the SDK
In order to call one of the APIs included in the Selling Partner API, you need to:
1. Configure credentials (Note: Use your individual credentials for `clientId`, `clientSecret` and `refreshToken`).
You can also configure the region and the authorization scope at this level.
2. Initialize the SPAPI Client using the configuration created in the previous step
3. Create an instance for a specific API using the API client created
4. Call an API operation
For example, refer to the following sample code for connecting to Sellers API.
```python
from spapi import SellersApi, SPAPIConfig, SPAPIClient, ApiException
from spapi.models.sellers_v1 import GetMarketplaceParticipationsResponse
if __name__ == "__main__":
# Credentials configuration
config = SPAPIConfig(
client_id="",
client_secret="",
refresh_token="",
region="NA",
scope = None
)
# Create the API Client with configuration
client = SPAPIClient(config)
sellers_api = SellersApi(client.api_client)
response = None
try:
response = sellers_api.get_marketplace_participations()
except ApiException as e:
print(f"API Exception occurred: {str(e)}")
if response is not None:
print("Sellers API Response:")
get_marketplace_participations_response = GetMarketplaceParticipationsResponse(response.payload)
for marketplaceParticipation in get_marketplace_participations_response.payload:
print(marketplaceParticipation.marketplace.id)
```
Note: Code can be found under python/sample-app folder
### Giving Feedback
We need your help in making this SDK great. Please participate in the community and contribute to this effort by submitting issues, participating in discussion forums and submitting pull requests through the following channels:
Submit [issues](https://github.com/amzn/selling-partner-api-sdk/issues/new/choose) - this is the preferred channel to interact with our team
Articulate your feature request or upvote existing ones on our [Issues][sdk-issues] page
[sdk-issues]: https://github.com/amzn/selling-partner-api-sdk/issues
Raw data
{
"_id": null,
"home_page": null,
"name": "amzn-sp-api",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "spapi, spapi sdk, sp-api sdk, selling partner api sdk, amazon-spapi, amazon selling partner api",
"author": "Amazon",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/60/e6/2531016f484caaa3925f0c8325319a00ffd6fd864b8e150f383e25f5515b/amzn_sp_api-1.3.1.tar.gz",
"platform": null,
"description": "## Python SDK for Selling Partner API\n[](https://pypi.org/project/amzn-sp-api/)\n\n[](https://www.youtube.com/watch?v=IEWTnO2L620&pp=0gcJCbEJAYcqIYzv)\n\n*Click on the image to watch the video.*\n\nThe Selling Partner API SDK for Python enables you to easily connect your Python application to Amazon's REST-based Selling Partner API.\n\n* [Learn more about Selling Partner API](https://developer.amazonservices.com/)\n* [Selling Partner API Documentation](https://developer-docs.amazon.com/sp-api/)\n\n### Getting started\n\n#### Credentials\n\nBefore you can use the SDK, you need to be registered as a Selling Partner API developer. If you haven't done that yet, please follow the instructions in the [SP-API Registration Overview](https://developer-docs.amazon.com/sp-api/docs/sp-api-registration-overview).\nYou also need to register your application to get valid credentials to call SP-API. If you haven't done that yet, please follow the instructions in [Registering your Application](https://developer-docs.amazon.com/sp-api/docs/registering-your-application).\nIf you are already registered successfully, you can find instructions on how to view your credentials in [Viewing your Application Information and Credentials](https://developer-docs.amazon.com/sp-api/docs/viewing-your-application-information-and-credentials).\n\n#### Minimum requirements\n\nTo run the SDK you need Python version 3.9 or higher.\n\n#### Install the SDK\n\n1. Find the latest version number [here](https://github.com/amzn/selling-partner-api-sdk/releases).\n2. Add the dependency to your project\n\n\n##### Using pip:\n```bash\npip install amzn-sp-api\n```\n\n##### Add to your project requirements.txt\nAdd the following line to the `requirements.txt` file if needed:\n```\namzn-sp-api >= \"1.0.0\"\n```\n\n### Use the SDK\n\nIn order to call one of the APIs included in the Selling Partner API, you need to:\n1. Configure credentials (Note: Use your individual credentials for `clientId`, `clientSecret` and `refreshToken`). \n You can also configure the region and the authorization scope at this level.\n2. Initialize the SPAPI Client using the configuration created in the previous step \n3. Create an instance for a specific API using the API client created\n4. Call an API operation\n\nFor example, refer to the following sample code for connecting to Sellers API.\n\n```python\nfrom spapi import SellersApi, SPAPIConfig, SPAPIClient, ApiException\nfrom spapi.models.sellers_v1 import GetMarketplaceParticipationsResponse\n\nif __name__ == \"__main__\":\n\n # Credentials configuration\n config = SPAPIConfig(\n client_id=\"\",\n client_secret=\"\",\n refresh_token=\"\",\n region=\"NA\",\n scope = None\n )\n\n # Create the API Client with configuration\n client = SPAPIClient(config)\n sellers_api = SellersApi(client.api_client)\n\n response = None\n try:\n response = sellers_api.get_marketplace_participations()\n except ApiException as e:\n print(f\"API Exception occurred: {str(e)}\")\n\n if response is not None:\n print(\"Sellers API Response:\")\n get_marketplace_participations_response = GetMarketplaceParticipationsResponse(response.payload)\n for marketplaceParticipation in get_marketplace_participations_response.payload:\n print(marketplaceParticipation.marketplace.id)\n```\n\nNote: Code can be found under python/sample-app folder\n\n### Giving Feedback\n\nWe need your help in making this SDK great. Please participate in the community and contribute to this effort by submitting issues, participating in discussion forums and submitting pull requests through the following channels:\n\nSubmit [issues](https://github.com/amzn/selling-partner-api-sdk/issues/new/choose) - this is the preferred channel to interact with our team\nArticulate your feature request or upvote existing ones on our [Issues][sdk-issues] page\n\n[sdk-issues]: https://github.com/amzn/selling-partner-api-sdk/issues\n\n",
"bugtrack_url": null,
"license": null,
"summary": "The Selling Partner API Python SDK enables you to easily connect to and work with Amazon SP-API.",
"version": "1.3.1",
"project_urls": {
"Documentation": "https://developer-docs.amazon.com/sp-api/docs/sp-api-sdks",
"Homepage": "https://developer-docs.amazon.com/sp-api/",
"Issues": "https://github.com/amzn/selling-partner-api-sdk/issues",
"Repository": "https://github.com/amzn/selling-partner-api-sdk"
},
"split_keywords": [
"spapi",
" spapi sdk",
" sp-api sdk",
" selling partner api sdk",
" amazon-spapi",
" amazon selling partner api"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "8f33f83431f2dd68fb0281cdf1f241088160a0b18a106eb496b7372e1adbe132",
"md5": "bea616a6a22927829003fb51b9cda9c7",
"sha256": "f8e3b8da1e80b30af2e476393b9b6421da783d6f03279f08885287bfefb14561"
},
"downloads": -1,
"filename": "amzn_sp_api-1.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "bea616a6a22927829003fb51b9cda9c7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 2829204,
"upload_time": "2025-07-10T11:20:43",
"upload_time_iso_8601": "2025-07-10T11:20:43.494588Z",
"url": "https://files.pythonhosted.org/packages/8f/33/f83431f2dd68fb0281cdf1f241088160a0b18a106eb496b7372e1adbe132/amzn_sp_api-1.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "60e62531016f484caaa3925f0c8325319a00ffd6fd864b8e150f383e25f5515b",
"md5": "2ad3fa6c96c1a0d5593442ba8b4ff229",
"sha256": "8ece63ec59fd9eb626ab8580b00ba2edc84d3808a69c4a1c456ce5b691ffe580"
},
"downloads": -1,
"filename": "amzn_sp_api-1.3.1.tar.gz",
"has_sig": false,
"md5_digest": "2ad3fa6c96c1a0d5593442ba8b4ff229",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 838686,
"upload_time": "2025-07-10T11:20:44",
"upload_time_iso_8601": "2025-07-10T11:20:44.897594Z",
"url": "https://files.pythonhosted.org/packages/60/e6/2531016f484caaa3925f0c8325319a00ffd6fd864b8e150f383e25f5515b/amzn_sp_api-1.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-10 11:20:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "amzn",
"github_project": "selling-partner-api-sdk",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "amzn-sp-api"
}