Amazon SP-API 集成可以通过以下步骤进行:
import boto3
def get_product_listing():
selling_partner_id = 'SELLING_PARTNER_ID'
marketplace_id = 'MARKETPLACE_ID'
credentials = boto3.Session().get_credentials()
access_key = credentials.access_key
secret_key = credentials.secret_key
session_token = credentials.token
client = boto3.client('products',
aws_access_key_id=access_key,
aws_secret_access_key=secret_key,
aws_session_token=session_token,
region_name='us-east-1')
response = client.search_products(MarketplaceIds=[marketplace_id],
Query='iPhone',
IncludedDataTypes=['productSummary'])
return response
在上面的代码中,我们使用 Python 中的 boto3 SDK 来访问 Amazon SP-API。使用前,请确保安装了此 SDK。然后,将必要的参数(此处为 SP 卖家 ID 和市场 ID)传递给 search_products
方法,以获取产品列表。
上一篇:AmazonSP-APIgetOrderRolesmaynotbeassumedbyrootaccounts
下一篇:AmazonSP-APIPythonSellingApiForbiddenException:Accesstorequestedresourceisdenied