Website logo

Price groups to make a histogram

Retrieve price grouping data representing the price distribution of listings retrieved from a given search query. Intended to be rendered as a histogram.

URL: https://api.trademe.co.nz/v1/Search/PriceHistogram.{file_format}
HTTP Method: GET
Requires Authentication? Yes
Permission Required: None
Supported Formats: XML, JSON
Rate Limited? Yes

URL parameters

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

Returns

<PriceHistogramBucketResponse>

Price buckets making up a histogram

Success Boolean

Indicates whether the operation was successful.

BucketCount Integer

Number of price buckets

PriceInterval Number or null

Interval / length of each price bucket

PriceOutlierBoundary Number or null

Prices over this value are considered to be outliers

PriceMin Number or null

The lowest price included in the histogram

PriceMax Number or null

The highest price included in the histogram

ListingCountClippedLimitSuggestion Number or null

In order to render the histogram data effectively, clients may want to clip the listing counts of buckets to this amount. This is effective when one bucket is much larger than others.

PriceGroupBuckets Collection of <PriceRangeGroupBucket>

The price buckets which make up the histogram

PriceFrom Number PriceFrom
PriceTo Number or null PriceTo
ListingCount Long Integer ListingCount
IsExtendedRange Boolean or null IsExtendedRange

Example XML Response (switch to JSON)

<PriceHistogramBucketResponse xmlns="http://api.trademe.co.nz/v1">
  <Success>false</Success>
  <BucketCount>123</BucketCount>
  <PriceInterval>123.0</PriceInterval>
  <PriceOutlierBoundary>123.0</PriceOutlierBoundary>
  <PriceMin>123.0</PriceMin>
  <PriceMax>123.0</PriceMax>
  <ListingCountClippedLimitSuggestion>123.0</ListingCountClippedLimitSuggestion>
  <PriceGroupBuckets>
    <PriceRangeGroupBucket>
      <PriceFrom>123.0</PriceFrom>
      <PriceTo>123.0</PriceTo>
      <ListingCount>123</ListingCount>
      <IsExtendedRange>false</IsExtendedRange>
    </PriceRangeGroupBucket>
    <PriceRangeGroupBucket>
      <PriceFrom>123.0</PriceFrom>
      <PriceTo>123.0</PriceTo>
      <ListingCount>123</ListingCount>
      <IsExtendedRange>false</IsExtendedRange>
    </PriceRangeGroupBucket>
  </PriceGroupBuckets>
</PriceHistogramBucketResponse>

Example JSON Response (switch to XML)

{
  "Success": false,
  "BucketCount": 123,
  "PriceInterval": 123.0,
  "PriceOutlierBoundary": 123.0,
  "PriceMin": 123.0,
  "PriceMax": 123.0,
  "ListingCountClippedLimitSuggestion": 123.0,
  "PriceGroupBuckets": [
    {
      "PriceFrom": 123.0,
      "PriceTo": 123.0,
      "ListingCount": 123,
      "IsExtendedRange": false
    },
    {
      "PriceFrom": 123.0,
      "PriceTo": 123.0,
      "ListingCount": 123,
      "IsExtendedRange": false
    }
  ]
}