首页 > 解决方案 > 如何在 ebaysdk 上导入产品 API?

问题描述

我正在尝试使用 UPC 查找产品的信息(描述、标题、图像、方面以及基本上所有内容)。我通过使用 eBay 的交易 API (GetItem) 和 productID 设法做到了这一点。但是,当我尝试使用 UPC 进行操作时,我遇到了问题。网上没有太多说明。我找到了getProductDetails应该回答我的问题的函数:

这是我的代码:

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子模块时,我看不到任何适合的子模块。

有人知道这件事吗?

标签: pythonebay-api

解决方案


推荐阅读