Website logo

Retrieve listing duration options for a category

Retrieves the default duration and the duration options that are available for listings in a specific category.

Some categories are currently unsupported (including subcategories): 350 (Real Estate), 5000 (Jobs) and 36 (Businesses for sale).

This API is deprecated in favour of the category details API.

URL: https://api.trademe.co.nz/v1/categories/{category}/durations.{file_format}
HTTP Method: GET
Requires Authentication? No
Permission Required: Public
Supported Formats: XML, JSON
Rate Limited? No

URL parameters

category String (required)

The number of the category to retrieve durations for.

file_format Enumeration (required) The format of the response.
xml Serialize responses into XML.
json Serialize responses into JSON.

Returns

<ListingDurations>

Default Enumeration Default
EndDate 0 EndDate
Two 2 Two
Three 3 Three
Four 4 Four
Five 5 Five
Six 6 Six
Seven 7 Seven
Ten 10 Ten
Fourteen 14 Fourteen
TwentyOne 21 TwentyOne
TwentyEight 28 TwentyEight
Thirty 30 Thirty
FortyTwo 42 FortyTwo
FiftySix 56 FiftySix
EightyFour 84 EightyFour
Ninety 90 Ninety
HundredSixtyEight 168 HundredSixtyEight
UntilWithdrawn -1 UntilWithdrawn
Durations Collection of Enumeration or null Allowed
EndDate 0 EndDate
Two 2 Two
Three 3 Three
Four 4 Four
Five 5 Five
Six 6 Six
Seven 7 Seven
Ten 10 Ten
Fourteen 14 Fourteen
TwentyOne 21 TwentyOne
TwentyEight 28 TwentyEight
Thirty 30 Thirty
FortyTwo 42 FortyTwo
FiftySix 56 FiftySix
EightyFour 84 EightyFour
Ninety 90 Ninety
HundredSixtyEight 168 HundredSixtyEight
UntilWithdrawn -1 UntilWithdrawn

Examples

https://api.trademe.co.nz/v1/Categories/1443/Durations.xml - Retrieves the listing duration options for antiques > advertising category. https://api.trademe.co.nz/v1/Categories/0266/Durations.xml - Retrieves the listing duration options for music DVDs.

Example XML Response (switch to JSON)

<ListingDurations xmlns="http://api.trademe.co.nz/v1">
  <Default>EndDate</Default>
  <Durations>
    <Duration>EndDate</Duration>
    <Duration>EndDate</Duration>
  </Durations>
</ListingDurations>

Example JSON Response (switch to XML)

{
  "Default": 0,
  "Durations": [
    0,
    0
  ]
}