python - 如何使用 Ebay 的 findItemsByProduct API 的 python 绑定通过 UPC 搜索产品?
问题描述
我正在尝试使用eBay 的 Product Find Items by Product ID通过 UPC 查找产品,特别是使用Python bindings。
我正在努力:
api = Connection(
appid='my id', config_file=None)
response = api.execute('findItemsByProduct', {
'productId': 820103794923,
'itemFilter': [
{'name': 'MinQuantity', 'value': 1},
但我得到:
{'ack': 'Failure', 'errorMessage': {'error': {'errorId': '4', 'domain': 'Marketplace', 'severity': 'Error', 'category': 'Request', 'message': 'Product ID is required.', 'subdomain': 'Search'}}, 'version': '1.13.0', 'timestamp': datetime.datetime(2020, 3, 24, 21, 46, 52)}
正确的论点是什么?
解决方案
api = Connection(config_file=yaml_path)
response = api.execute('findItemsByProduct',
'<productId type="ReferenceID">820103794923</productId><itemFilter><name>MinQuantity</name><value>1</value></itemFilter>')
response.reply
{'ack': 'Success', 'version': '1.13.0', 'timestamp': datetime.datetime(2020, 3, 26, 10, 13, 10), 'searchResult': {'_count': ' 0'},'paginationOutput':{'pageNumber':'0','entriesPerPage':'100','totalPages':'0','totalEntries':'0'},'itemSearchURL':' https:// /www.ebay.com/sch/?_samilow=1&_LH_MIL=1&_ddo=1&_ipg=100&_pgn=1&_productid=820103794923 '}
推荐阅读
- database - 如何为一个dolphindb数据节点配置多个硬盘
- javascript - getDerivedStateFromProps,改变props影响下的状态改变
- excel - 比较两张纸以匹配值并将匹配的一张粘贴到第三张
- c# - 如何修复asp net mvc中图片的链接
- python - 我无法单击出现超时异常的复选框
- java - React 本机应用程序未从 Espresso-Intent 接收图像
- c# - 在 PageFilter 中为 ViewData 赋值时出错
- android - 在 CompositeException 中抛出捕获的异常结果
- javascript - json-server db.json 中带有“/”的路径
- java - java SimpleDateFormat.parse a UTC time to Asia/Hong_Kong Time