Website logo

Retrieve travel localities

Returns a list of districts and suburbs as used by TradeMe travel.

URL: https://api.trademe.co.nz/v1/TravelAreas.{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.

Returns

Collection of <Locality>

A list of all localities.

LocalityId Integer

The ID of the region.

Name String or null

The name of the region.

Districts Collection of <District> or null

The list of districts that belong to this region.

DistrictId Integer

The ID of the district.

Name String or null

The name of the district.

Example XML Response (switch to JSON)

<LocalityCollection xmlns="http://api.trademe.co.nz/v1">
  <Locality>
    <LocalityId>123</LocalityId>
    <Name>ABC</Name>
    <Districts>
      <District>
        <DistrictId>123</DistrictId>
        <Name>ABC</Name>
      </District>
      <District>
        <DistrictId>123</DistrictId>
        <Name>ABC</Name>
      </District>
    </Districts>
  </Locality>
  <Locality>
    <LocalityId>123</LocalityId>
    <Name>ABC</Name>
    <Districts>
      <District>
        <DistrictId>123</DistrictId>
        <Name>ABC</Name>
      </District>
      <District>
        <DistrictId>123</DistrictId>
        <Name>ABC</Name>
      </District>
    </Districts>
  </Locality>
</LocalityCollection>

Example JSON Response (switch to XML)

[
  {
    "LocalityId": 123,
    "Name": "ABC",
    "Districts": [
      {
        "DistrictId": 123,
        "Name": "ABC"
      },
      {
        "DistrictId": 123,
        "Name": "ABC"
      }
    ]
  },
  {
    "LocalityId": 123,
    "Name": "ABC",
    "Districts": [
      {
        "DistrictId": 123,
        "Name": "ABC"
      },
      {
        "DistrictId": 123,
        "Name": "ABC"
      }
    ]
  }
]