The /feeds/categories-tree endpoints retrieve all categories you have access through KelkooGroup network along with some details about them.
The structure can be a list or a tree.
There are two main use cases for retrieving the categories:
-
you want to display more information about the categories related to offers from Offer search
-
you are using Offer feeds and you need to know the list of available categories.
The id field is the identifier of a category in KelkooGroup systems and can be used with other resources. For instance, this identifier must be used when retrieving an offers feed to filter by a category.
Data freshness
The categories do not change much. You can retrieve this resource once a day, it's enough.
Endpoints
/feeds/categories-tree: retrieve the categories as a tree.
See Request builder
Authentication
See JWT details
Compressed data
Please note that you should ask for compressed data, otherwise you will receive an error 406 Not Acceptable.
Most HTTP client libraries offer a setting to transparently activate compression when configuring the client. See below in the HTTP Headers section how to do it manually.
Query parameters
|
Name |
Type |
Domain |
Default |
Description |
Example |
|---|---|---|---|---|---|
|
|
string |
|
|
Country filter |
|
|
|
string |
{'json','xml','csv'} |
'json' |
Output format. Can be specified in the headers. 'csv' is not available as a tree for obvious reasons. |
|
HTTP headers
|
Name |
Type |
Domain |
Default |
Description |
Example |
|---|---|---|---|---|---|
|
|
string |
{'gzip'} |
|
You have to request compressed data. This is the way to do it. |
|
|
|
string |
{'application/json', 'application/xml', 'text/csv'} |
|
Output format. Can be specified in the parameters. The http parameters wins. |
|
Response
The response can be either
-
in
json, inxml
To handle properly this stream, please follow the streaming guide.
In JSON, a category tree is represented as follows
JSON format
-
When I call KelkooGroup API with a valid JWT on https://api.kelkoogroup.net/publisher/shopping/v2/feeds/category-tree?country=fr
-
Then I get a response with status 200
-
And I get a response with filename categories-fr.json
-
And I get following json body response
{
"id": 601,
"format": "Tree",
"category": {
"id": 601,
"name": "Home Page",
"ancestorIds": [
601
],
"offensive": false,
"categories": [
{
"id": 128701,
"name": "Alimentation, boissons et tabac",
"ancestorIds": [
128701,
601
],
"offensive": false,
"categories": [
{
"id": 100567413,
"name": "Alimentation bébé",
"ancestorIds": [
100567413,
128701,
601
],
"offensive": false,
"categories": []
}
]
},
{
"id": 172601,
"name": "Auto et Moto",
"ancestorIds": [
172601,
601
],
"offensive": false,
"categories": [
{
"id": 173001,
"name": "Auto",
"ancestorIds": [
173001,
172601,
601
],
"offensive": false,
"categories": [
{
"id": 7313,
"name": "Accessoires Auto",
"ancestorIds": [
7313,
173001,
172601,
601
],
"offensive": false,
"categories": []
},
{
"id": 100278823,
"name": "GPS",
"ancestorIds": [
100278823,
173001,
172601,
601
],
"offensive": true,
"categories": []
}
]
}
]
},
{
"id": 100000,
"name": "RandomCat",
"ancestorIds": [
601
],
"offensive": false,
"categories": []
}
]
}
}
XML format
-
When I call KelkooGroup API with a valid JWT on https://api.kelkoogroup.net/publisher/shopping/v2/feeds/category-tree?country=fr&format=xml
-
Then I get a response with status 200
-
And I get a response with filename categories-fr.xml
-
And I get a response containing the following xml content
<category_tree xmlns="urn:kelkoo" id="601" format="Tree">
<category id="601" name="Home Page">
<category id="128701" name="Alimentation, boissons et tabac">
<category id="100567413" name="Alimentation bébé"/>
</category>
<category id="172601" name="Auto et Moto">
<category id="173001" name="Auto">
<category id="7313" name="Accessoires Auto"/>
<category id="100278823" name="GPS"/>
</category>
</category>
<category id="100000" name="RandomCat"/>
</category>
</category_tree>