【问题标题】:eBay Finding API - findCompletedItems - How to Return a Specific Aspect in OutputeBay Finding API - findCompletedItems - 如何在输出中返回特定方面
【发布时间】:2013-03-26 02:03:36
【问题描述】:

我正在使用findCompletedItems 来查找与特定类别(男鞋)中的特定关键字集匹配的所有商品,并且我很容易使用 @987654322 指定我只想要特定鞋号的所有商品@:

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

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

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

【问题讨论】:

  • 我不确定我是否理解你想要做什么,但是我正在阅读本页中的 eBay 的 api 文档 http://developer.ebay.com/devzone/finding/Concepts/FindingAPIGuide 所以我认为你可以使用逻辑运算符 AND 包括所有尺寸在同一个过滤器中获得更完整的响应,然后使用所有返回的数据以您想要的编程语言显示。

标签: ebay-api


【解决方案1】:

你不能。

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

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

编辑

根据调用特定的输出字段表 SearchResult.item.attribute:“有条件地返回该字段。有关条件说明,请参阅字段文档。”

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

在响应 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 相矛盾,它指出:

使用一个或多个 ItemAttribute 字段的调用:

findCompletedItems、findItemsAdvanced、findItemsByCategory、findItemsByKeywords、findItemsByProduct、findItemsIneBayStores

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

【讨论】:

  • 您可能正在做某事,但我不确定。根据 SearchResult.item.attribute 的调用特定输出字段表:“该字段是有条件返回的。请参阅字段文档以了解条件。” 所以即使你是正确的,我可以通过让搜索返回每个项目的 SearchResult.item.attribute 值来获取鞋码,但我仍然不确定如何在我的请求中询问该信息。对此有什么想法吗?感谢您的帮助。
  • 我很感激,但该信息根本不在响应中。例如,此商品:ebay.com/itm/… 您会在商品详细信息下看到它清楚地列出了“美国鞋码(男式):14”,但默认响应 XML 没有该信息。有关示例响应,请参见此处:hdipreview.com/misc/ebay_api_response.jpg
  • 请记住,据我所知,这并不重要,但我使用的是 findCompletedItems,而不是 findItemsAdvanced。
  • 同样适用于 findItemsAdvanced...没有属性:hdipreview.com/misc/finditemsadvanced.jpg
  • 这是我唯一可以开始工作的事情:“看起来你必须使用 GetSingleItem 和 IncludeSelector=ItemSpecifics 来获取通过 findCompletedItems 找到的项目” - 至少这是获取信息的某种方式我正在寻找。非常感谢您的帮助 - 谢谢。
猜你喜欢
  • 1970-01-01
  • 2013-07-03
  • 1970-01-01
  • 2013-12-26
  • 2011-10-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多