Retrieve general categories by mcat path
Retrieves all or part of the Trade Me category tree.
URL: | https://api.trademe.co.nz/v1/Categories.{file_format} |
---|---|
HTTP Method: | GET |
Requires Authentication? | No |
Permission Required: | Public |
Supported Formats: | XML, JSON |
Rate Limited? | No |
URL parameters
file_format | Enumeration (required) | The format of the response. | ||||
---|---|---|---|---|---|---|
|
Query String parameters
depth | Integer (optional) |
The depth of the category tree to return. 0 = a single category. 1 = the specified category plus any subcategories. The default is to return all subcategories. |
---|---|---|
mcat_path | String (optional) |
The string path of the category. If this parameter is empty, it returns a fictional category named "Root" with all the top categories included as subcategories. |
region | Integer (optional) |
The ID of the region used to filter listing counts. Only applicable if with_counts is true. |
with_counts | Boolean (optional) |
Indicates whether to include the number of listings in each category. Defaults to false. |
Returns
<Category>
A category tree.
Name | String or null | Name | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Number | String or null | Number | |||||||||||||||||||||
Path | String or null | Path | |||||||||||||||||||||
Subcategories | Collection of <Category> or null | Subcategories | |||||||||||||||||||||
(This type has already been defined) | |||||||||||||||||||||||
Count | Integer | Count | |||||||||||||||||||||
IsRestricted | Boolean | IsRestricted | |||||||||||||||||||||
HasLegalNotice | Boolean | HasLegalNotice | |||||||||||||||||||||
HasClassifieds | Boolean | HasClassifieds | |||||||||||||||||||||
AreaOfBusiness | Enumeration | AreaOfBusiness | |||||||||||||||||||||
|
|||||||||||||||||||||||
CanHaveSecondCategory | Boolean | CanHaveSecondCategory | |||||||||||||||||||||
CanBeSecondCategory | Boolean | CanBeSecondCategory | |||||||||||||||||||||
IsLeaf | Boolean | IsLeaf |
Examples
https://api.trademe.co.nz/v1/Categories.xml - Retrieves all categories.
https://api.trademe.co.nz/v1/Categories.xml?mcat_path=/Trade-Me-Motors - Returns all Trade Me Motors subcategories.
https://api.trademe.co.nz/v1/Categories.xml?mcat_path=/Trade-Me-Motors/Motorbikes/Motorbikes - Returns all Motorbike subcategories.