是否可以通过 API 以编程方式获取 eBay 类别列表?

2022-01-23 00:00:00 php drupal-7 ebay-api

我的目标是以编程方式获取 eBay 类别列表.

GetCategories 方法似乎只能从 Trading API 获得.如果我理解正确,登录交易 API 需要用户交互:http://developer.ebay.com/DevZone/XML/docs/HowTo/Tokens/GettingTokens.html

是否有另一种以编程方式获取 eBay 类别列表的方法?

我使用的是 Drupal 7,所以是 PHP.

解决方案

您不需要令牌来获取类别.您所需要的只是您的 App-ID

下面带有您的 APP-ID 的链接将返回来自站点的 XML 类别列表:UK (siteid=3)设置 CategoryID=-1 从根级别开始列表,您可以从任何类别开始,只需使用 IncludeSelector=ChildCategories 来获取孩子

http://open.api.ebay.com/Shopping?callname=GetCategoryInfo&appid=YOUR-APP-ID&siteid=3&CategoryID=-1&version=729&IncludeSelector=ChildCategoriesp>

现在只需使用 SimpleXML 或其他任何东西来解析.

My goal is to get a list of eBay categories programmatically.

It appears that the GetCategories method is only available from the Trading API. If I understand correctly, there is user interaction required to log into the Trading API: http://developer.ebay.com/DevZone/XML/docs/HowTo/Tokens/GettingTokens.html

Is there another method to get the eBay categories list programmatically?

I'm using Drupal 7, so PHP.

解决方案

You do not need a token to get the categories. All you need is your App-ID

The link below with your APP-ID will return the XML category listing from site: UK (siteid=3) Setting CategoryID=-1 starts the list at the root level, you can start from any category, just use IncludeSelector=ChildCategories to get children

http://open.api.ebay.com/Shopping?callname=GetCategoryInfo&appid=YOUR-APP-ID&siteid=3&CategoryID=-1&version=729&IncludeSelector=ChildCategories

Now just use SimpleXML or whatever to parse.

相关文章