调用eBay Merchandising SDK的getTopSellingProducts接口报错求助
eBay Merchandising API getTopSellingProducts 接口404问题
我运行以下代码可正常获取响应:
from ebaysdk.merchandising import Connection as Merchandising try: api = Merchandising(appid="YOUR_APPID", config_file=None) response = api.execute('getMostWatchedItems', {'maxResults': 10}) print(response.dict()) print(response.reply) except ConnectionError as e: print(e) print(e.response.dict())
但将接口调用改为getTopSellingProducts后:
response = api.execute('getTopSellingProducts', {'maxResults': 10})
出现错误:
ebaysdk.exception.ConnectionError: 'getTopSellingProducts: Not Found'
我已确认密钥配置正确,且SDK文档显示该接口应被支持。作为API新手,我试过ChatGPT但未解决问题。
5月26日更新:
我尝试直接调用API,以下代码能正常响应:
url = "https://svcs.ebay.com/MerchandisingService?OPERATION-NAME=getMostWatchedItems&REST-PAYLOAD" headers = { 'SERVICE-NAME':'MerchandisingService', "SERVICE-VERSION": "1.1.0", "CONSUMER-ID": "<my APP ID>", "RESPONSE-DATA-FORMAT":"XML", "maxResults": "3"}
但将OPERATION-NAME替换为getTopSellingProducts后返回404。对比eBay官方提供的两个接口示例格式几乎一致,无法定位问题,请求帮助。
内容的提问来源于stack exchange,提问作者JohnRees77
相关产品推荐
相关产品推荐

