question

InactiveAutoUser avatar image
0 Likes"
InactiveAutoUser asked

Using downloadFile with GetCategorySpecifics to get all recomendations is only returning 25 per

I am trying to download all the recommendations for all categorie.  I am following the suggestions on the documentation page here: http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/GetCategorySpe...

 

I am able to use GetCategorySpecifics with CategorySpecificsFileInfo set to true.  downloadFile appears to work as well, and I have a reference that contians the mapping of all categories to the recomendations.

 

However, the problem is that the recommendations themselves are limited at 25 values per name.

 

There is some documentation in the call which explains:

 

MaxValuesPerName int Optional Maximum number of values to retrieve per item specific. The best practice for using this field depends on your use case. For example, if you want all possible values (such as all brands and sizes in a clothing category), then specify a very large number. (This is recommended in most cases.) If you only want the most popular value (like the most popular color), then specify a small number.
Min: 1. Max: 2147483647. Default: 25 (does not affect values with relationship validation rules).

 

(Also there is a MaxName parameter that apparently defaults to 10)

Setting MaxValuesPerName to any value results in the API error:

 

No <Category Id> exists or <Category Id> is specified as an empty tag in the request.

 

 

So it looks like I can't set MaxValuesPerName to any value without setting a category ID.  Ok fair enough, however I need to download all the recommendations  for all categories and if the downloadFile method does not automatically adjust these values (MaxValuesPerName, and MaxNames), then how can I get all the values?

 

The only work around is ugly - parse the resulting file from downloadFile, and re-request GetCategorySpecifics for the category IDs who have 10 names or 25 values.

 

So how can I get all the values?

 

 

 

To test this you can do the following:

 

<?xml version="1.0" encoding="utf-8"?>
<GetCategorySpecificsRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>...</RequesterCredentials>
</GetCategorySpecificsRequest>

 

Look at category 79720 (Men's Sunglasses), and notice the brand list only goes to 25 possible brands.  Where is Oakley? Ray Band?

 

To fix you can do:

 

<?xml version="1.0" encoding="utf-8"?>
<GetCategorySpecificsRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>...</RequesterCredentials>

<categoryID>79720</categoryID>

<MaxValuesPerName>500</MaxValuesPerName>
</GetCategorySpecificsRequest>

 

Now we see all the brands.

 

However, if we want to get all categories instead of just Sunglasses, and remove the categoryID node:

 

<?xml version="1.0" encoding="utf-8"?>
<GetCategorySpecificsRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>...</RequesterCredentials>

<MaxValuesPerName>500</MaxValuesPerName>
</GetCategorySpecificsRequest>

 

We get the error message.

 

Since I can't change parameters in downloadFile, I don't know how to fix this.

 

getcategoryspecificsdownloadfilemaxvaluespername
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

· Write an Answer

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.