Website logo

Retrieve motorbike types

This is a convenience method that returns all subcategories from the Motorbikes category.

Names of these subcategories represent applicable values for the ‘type’ parameter in Motorbike search.

URL: https://api.trademe.co.nz/v1/categories/motorbikes.{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.
xml Serialize responses into XML.
json Serialize responses into JSON.

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.

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 containing all motor bike types.

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
NotSpecified 0 NotSpecified
All 0 All
Marketplace 1 Marketplace
Property 2 Property
Motors 3 Motors
Jobs 4 Jobs
Services 5 Services
CanHaveSecondCategory Boolean CanHaveSecondCategory
CanBeSecondCategory Boolean CanBeSecondCategory
IsLeaf Boolean IsLeaf

Example XML Response (switch to JSON)

<Category xmlns="http://api.trademe.co.nz/v1">
  <Name>ABC</Name>
  <Number>ABC</Number>
  <Path>ABC</Path>
  <Subcategories>
    <Category />
    <Category />
  </Subcategories>
  <Count>123</Count>
  <IsRestricted>false</IsRestricted>
  <HasLegalNotice>false</HasLegalNotice>
  <HasClassifieds>false</HasClassifieds>
  <AreaOfBusiness>NotSpecified</AreaOfBusiness>
  <CanHaveSecondCategory>false</CanHaveSecondCategory>
  <CanBeSecondCategory>false</CanBeSecondCategory>
  <IsLeaf>false</IsLeaf>
</Category>

Example JSON Response (switch to XML)

{
  "Name": "ABC",
  "Number": "ABC",
  "Path": "ABC",
  "Subcategories": [
    {
    },
    {
    }
  ],
  "Count": 123,
  "IsRestricted": false,
  "HasLegalNotice": false,
  "HasClassifieds": false,
  "AreaOfBusiness": 0,
  "CanHaveSecondCategory": false,
  "CanBeSecondCategory": false,
  "IsLeaf": false
}