Website logo

Gets the counts for listing statistics from homes

Retrieves homes.co.nz statistics (views, email enquiries and click to calls) for one of an office's residential property listings, for a date range you supply.

Authentication: requires the MyTradeMeRead permission. This is an office-level call: officeMemberId must be an office account, the caller must act for that office (be the office, or a member with a confirmed connection to it), and the listing must be owned by that office. Listings that belong to an individual agent's own account are not accessible through this call. Errors: HTTP 400 "Invalid Member ID." when officeMemberId is not a positive integer. HTTP 404 when the member ("The member {id} was not found.") or the listing ("Listing cannot be found") does not exist. HTTP 403 "Member is not a property agent" when officeMemberId is not an office account. HTTP 403 when the caller is not permitted to act for the office. HTTP 400 "Listing ID is not valid" when listingId cannot be read as a listing ID. HTTP 403 "Listing is not a property listing" when the listing is not in a property category. HTTP 400 "Member {id} does not have authority to access for Listing {id}" when the listing is not owned by the office. HTTP 400 "homes.co.nz statistics are not available for this category" when the listing's category is not shown on homes.co.nz. HTTP 400 "Required query params were not provided" or "Required query params are not valid" when from_date or to_date is missing, is not in yyyy-MM-dd format, or from_date is after to_date.

URL: https://api.trademe.co.nz/v1/Property/Office/{officeMemberId}/HomesListingStatistics/{listingId}.{file_format}
HTTP Method: GET
Requires Authentication? Yes
Permission Required: MyTradeMeRead: Read your membership & listing data.
Supported Formats: XML, JSON
Rate Limited? Yes

URL parameters

officeMemberId String (required)

The Trade Me member ID of the office (agency) account that owns the listing. Must be an integer and must belong to an office account.

listingId String (required)

The Trade Me listing ID of a property listing owned by the office.

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

Query String parameters

from_date String (optional)

Required. Start of the date range, formatted yyyy-MM-dd (a New Zealand date).

to_date String (optional)

Required. End of the date range, formatted yyyy-MM-dd (a New Zealand date). Must not be before from_date.

Returns

<HomesListingStats>

A HomesListingStats containing the homes.co.nz listing ID, totals across all records returned by homes.co.nz (these may cover only the requested date range), counts within the date range, and the view count for each day.

ListingId Integer

The Trade Me listing ID.

HomesListingId String or null

The ID of the same listing on homes.co.nz.

TotalEmailEnquiryCount Integer

The total number of email enquiries across all records returned by homes.co.nz for the listing (the requested from_date and to_date are also sent to homes.co.nz, so the total may cover only that period rather than the whole life of the listing).

TotalClickToCallCount Integer

The total number of click to call actions across all records returned by homes.co.nz for the listing (the requested from_date and to_date are also sent to homes.co.nz, so the total may cover only that period rather than the whole life of the listing).

TotalViewCount Integer

The total number of views across all records returned by homes.co.nz for the listing (the requested from_date and to_date are also sent to homes.co.nz, so the total may cover only that period rather than the whole life of the listing).

EmailEnquiryCount Integer

The number of email enquiries within the requested from_date to to_date range.

ClickToCallCount Integer

The number of click to call actions within the requested date range.

ViewCount Integer

The number of views within the requested date range.

DailyActivity Collection of <DailyListingActivity> or null

The number of views for each day in the requested range. Only Day and NewViewCount are populated on each item. Empty when there are no daily counts.

Day DateTime

The calendar day these statistics relate to. Serialised in the Microsoft JSON date format. For the agent and office statistics endpoints this is a New Zealand date, for example /Date(1735642800000+1300)/. For the daily view counts in HomesListingStats it is the start of the New Zealand day converted to a UTC instant, so the value is earlier than midnight New Zealand time and may not carry a +1300 offset.

NewViewCount Integer

The number of times the listing was viewed on this day. Omitted from the response when 0.

Example XML Response (switch to JSON)

<HomesListingStats xmlns="http://api.trademe.co.nz/v1">
  <ListingId>123</ListingId>
  <HomesListingId>ABC</HomesListingId>
  <TotalEmailEnquiryCount>123</TotalEmailEnquiryCount>
  <TotalClickToCallCount>123</TotalClickToCallCount>
  <TotalViewCount>123</TotalViewCount>
  <EmailEnquiryCount>123</EmailEnquiryCount>
  <ClickToCallCount>123</ClickToCallCount>
  <ViewCount>123</ViewCount>
  <DailyActivity>
    <DailyListingActivity>
      <Day>2018-01-01T00:00:00Z</Day>
      <NewViewCount>123</NewViewCount>
    </DailyListingActivity>
    <DailyListingActivity>
      <Day>2018-01-01T00:00:00Z</Day>
      <NewViewCount>123</NewViewCount>
    </DailyListingActivity>
  </DailyActivity>
</HomesListingStats>

Example JSON Response (switch to XML)

{
  "ListingId": 123,
  "HomesListingId": "ABC",
  "TotalEmailEnquiryCount": 123,
  "TotalClickToCallCount": 123,
  "TotalViewCount": 123,
  "EmailEnquiryCount": 123,
  "ClickToCallCount": 123,
  "ViewCount": 123,
  "DailyActivity": [
    {
      "Day": "\/Date(1514764800)\/",
      "NewViewCount": 123
    },
    {
      "Day": "\/Date(1514764800)\/",
      "NewViewCount": 123
    }
  ]
}