ebay-api - eBay 查找 API - findCompletedItems - 如何在输出中返回特定方面

标签 ebay-api

我使用 findCompletedItems 来查找与特定类别(男鞋)中的一组特定关键字相匹配的所有商品,并且我可以轻松指定我只想要特定鞋子的所有商品大小,使用 aspectFilter:

<aspectFilter>
   <aspectName>US Shoe Size (Men's)</aspectName>
   <aspectValueName>11</aspectValueName>
</aspectFilter>

但是,如果我想要关键字的所有结果,并且希望输出包含每个结果的特定方面值(鞋子尺寸),即使它们并不完全相同,我该如何做?

我花了 3 个小时使用 API 测试工具并通过 Google 搜索代码示例,但我不知道如何查询所有默认数据以及我想要的任何其他方面也可以包含在输出中,而无需使用 aspectFilter 多次查询所有不同的大小,这是非常低效的。

最佳答案

你不能。

您只需构建一个指定 outputSelector 的请求即可的type AspectHistogram 。但是,响应将仅包括 aggregated informations关于您的请求所选择的项目的各个方面。您可以在请求中包含所需的输出选择器数量,但方面将始终聚合,因为(根据定义)“aspects are item characteristics shared by items in a given domain ”(读取域 = 搜索结果)。

您正在寻找的可能是 item attributes相反,它应该已经出现在结果中,因为它们是特定于每个项目的。

编辑

According to the Call-specific Output Fields table for SearchResult.item.attribute: "The field is conditionally returned. See the field documentation for clarification of conditions."

这意味着此类属性特定于所找到的项目:每个属性可以出现在一个项目中,但不能出现在另一个项目中。 您无需执行任何特殊操作即可获得它们。您可以在 <SearchResult> 中找到它们。元素,在每个 <item> 内,每个都在 <attribute> 中元素。

在响应 XML 中,您应该找到如下内容:

<?xml version="1.0" encoding="utf-8"?>
<findItemsAdvancedResponse xmlns="http://www.ebay.com/marketplace/search/v1/services">
  <!-- various things here... -->
  <searchResult count="1">
  <item>
    <attribute>
      <name>Size</name>
      <value>XXL</value>
    </attribute>
    <!-- ... more attribute nodes allowed here ... -->
    <!-- ... more item info here ... -->
  </item>
  <!-- ... more items ... -->
  </searchResult>
</findItemsAdvancedResponse>

您可以找到更多示例here您还可以使用 this documentation 更深入地了解 XML 结果内容.

编辑2
这似乎与 documentation 相矛盾,其中指出:

Calls that use one or more fields of ItemAttribute:

findCompletedItems, findItemsAdvanced, findItemsByCategory, findItemsByKeywords, findItemsByProduct, findItemsIneBayStores

顺便说一句,看起来你必须使用 GetSingleItem对于通过 findCompletedItems 找到的项目,使用 IncludeSelector=ItemSpecifics。我会尝试通过将“ItemSpecifics”作为 IncludeSelector 或 OutputSelects 传递来破解 findItemsAdvanced api。我最后的建议是询问customer service 。祝你好运!

关于ebay-api - eBay 查找 API - findCompletedItems - 如何在输出中返回特定方面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15628068/

相关文章:

ebay-api - 易趣 : Trading API vs Shopping API

PHP eBay API GeteBayOfficialTime 调用返回 'Unsupported API call' 错误

perl - eBay API - GerOrders 没有给出任何结果

php - eBay API 添加跟踪号 - 错误号 10007

node.js - 如何使用 Ebay 的刷新 token 获取访问 token ?

oauth - 向 eBay 发出简单的授权请求

php - 添加固定价格项目 : Specify MPN in VariationSpecifics. 名称值列表

ruby-on-rails - ebay BulkDataExchangeRequests API XML - 缺少 UUID

python - 易趣 API 'Invalid auction currency' 错误

javascript - 易趣查找 API : Not getting same number of result via API call as that of manual search using the same filters in ebay site