
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
The Selling Partner API Python SDK enables you to easily connect to and work with Amazon SP-API.
The Selling Partner API SDK for Python enables you to easily connect your Python application to Amazon's REST-based Selling Partner API.
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. 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. If you are already registered successfully, you can find instructions on how to view your credentials in Viewing your Application Information and Credentials.
To run the SDK you need Python version 3.9 or higher.
pip install amzn-sp-api
Add the following line to the requirements.txt
file if needed:
amzn-sp-api >= "1.0.0"
In order to call one of the APIs included in the Selling Partner API, you need to:
clientId
, clientSecret
and refreshToken
).
You can also configure the region and the authorization scope at this level.For example, refer to the following sample code for connecting to Sellers API.
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
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 - this is the preferred channel to interact with our team Articulate your feature request or upvote existing ones on our Issues page
FAQs
The Selling Partner API Python SDK enables you to easily connect to and work with Amazon SP-API.
We found that amzn-sp-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.