如何在ebaysdk上导入产品API?

2024-10-05 21:59:38 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图通过使用UPC查找产品的信息(描述、标题、图像、方面和基本上所有内容)。我通过使用eBay的交易API(GetItem)和productID成功地做到了这一点。然而,当我试图用UPC做它时,我遇到了问题。网上没有多少说明。我找到了函数^{},它应该可以回答我的问题:

这是我的密码:

from ebaysdk.trading import Connection
api = Connection(devid=dev_id, certid=cert_id, appid=app_id, token=token_id, globalId="EBAY-US", config_file=None) 
response = api.execute('getProductDetails', {"productDetailsRequest": {"dataset": {"UPC": "#UPCNUMBER"}}})
r = response.dict()
print(r)

但是,当我尝试使用相同的API(交易)时,我遇到了以下错误:

ConnectionError: 'getProductDetails: Class: RequestError, Severity: Error, Code: 2, Unsupported API call. The API call "getProductDetails" is invalid or not supported in this release.'

我试图弄清楚我到底应该用什么API,但网上没有任何信息。从文档中,我可以理解这是一个产品API。但是,在查看不同的ebaysdk.xxx子模块时,我没有看到任何适合的子模块

有人知道这件事吗


Tags: 模块tokenapi信息id标题产品response