# A listing's price history

Source: https://help.ruuster.com/idx/listings-history

> Get a listing's price and status history, newest first, with sales shown only where the MLS allows sold data.

```http
GET https://idx.ruuster.com/v1/listings/{listingId}/history
```

publishable or secret key · 1 unit · cached 900 s

The events of one listing's life on the market, newest first: when it was listed, each price change,
each status change, a sale, and a return to the market after it had left. Build a "Price history"
table on your listing page from it.

## What to know

- Each event has its `date`, the `event` (`listed`, `price_change`, `status_change`, `sold` or
  `back_on_market`), the `price` and `status` after it, and the `previousPrice` and `previousStatus`
  before it.
- A status the MLS doesn't let us show (withdrawn, expired, canceled) is never named. When the
  listing comes back, you see `back_on_market` with the last shown price beside it.
- A sale shows only on MLSs that show sold data, and only inside that MLS's sold window. Elsewhere a
  past sale is left out and its price never appears.
- At most 100 events; `truncated` is true when older ones were left out.
- The same rules as the listing itself: a listing outside your MLSs answers 404, one that left the
  market answers 410.

## Path parameters

| Name | Type | Description |
|---|---|---|
| `listingId` | uuid | The listing's id (a uuid), as `id` on every listing the API returns. An MLS number is not an id: find it with /v1/suggest groups=listing. |

## Query parameters

This call takes no query parameters.

## Response

The answer is `{ ok: true, data, meta }`. These are the fields of `data`; `meta` carries `brokerageId`, `freshness.asOf`, `mls` (each board's display rules) and `canonical`.

| Field | Type | Description |
|---|---|---|
| `listingId` | string | The listing's id. |
| `events` | array of object | Newest first, at most 100. A status the MLS doesn't let us show (withdrawn, expired) is never named. |
| `events[].date` | string | When it happened: the status change's own time when the MLS sent one, else the update's. |
| `events[].event` | string (enum) | listed: first shown for sale; back_on_market: shown again after leaving the market; sold: only where the MLS shows sold data, inside its sold window. One of `listed`, `price_change`, `status_change`, `sold`, `back_on_market`. |
| `events[].price` | number or null | The price after the event (the sold price on sold); null when the MLS sent none. |
| `events[].status` | string (enum) | The status after the event. One of `active`, `coming_soon`, `pending`, `under_contract`, `closed`. |
| `events[].previousPrice` | number or null | The last shown price before the event; null on listed. |
| `events[].previousStatus` | string (enum) or null | The last shown status before the event; null on listed. One of `active`, `coming_soon`, `pending`, `under_contract`, `closed`. |
| `truncated` | boolean | true when older events were left out. |

## Errors

These are the error codes this endpoint can answer. Every error has the same body; [Errors](https://help.ruuster.com/idx/reference-errors) explains each code and what to show.

`invalid_parameter`, `secret_key_in_url`, `invalid_credentials`, `missing_credentials`, `payment_required`, `access_revoked`, `brokerage_not_enabled`, `origin_not_allowed`, `origin_required`, `secret_key_in_browser`, `mls_not_in_scope`, `not_found`, `listing_removed`, `daily_quota_exceeded`, `rate_limited`, `internal_error`, `api_paused`, `source_unavailable`

## Example request

cURL:

```bash
curl -s "https://idx.ruuster.com/v1/listings/aaaaaaaa-0000-4000-8000-000000000001/history" \
  -H "Authorization: Bearer $IDX_SECRET_KEY"
```

TypeScript:

```typescript
import { createClient } from "@ruuster/idx";

const idx = createClient({ secretKey: process.env.IDX_SECRET_KEY });

const r = await idx.history("aaaaaaaa-0000-4000-8000-000000000001");
if (!r.ok) throw new Error(`${r.error.code}: ${r.error.message}`);
console.log(r.data);
```

Python:

```python
import os

import requests

res = requests.get(
    "https://idx.ruuster.com/v1/listings/aaaaaaaa-0000-4000-8000-000000000001/history",
    headers={"Authorization": "Bearer " + os.environ["IDX_SECRET_KEY"]},
    timeout=30,
)
body = res.json()
if not body["ok"]:
    raise RuntimeError(body["error"]["code"] + ": " + body["error"]["message"])
print(body["data"])
```

PHP:

```php
<?php

$ch = curl_init('https://idx.ruuster.com/v1/listings/aaaaaaaa-0000-4000-8000-000000000001/history');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('IDX_SECRET_KEY')],
    CURLOPT_TIMEOUT => 30,
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!$body['ok']) {
    throw new RuntimeException($body['error']['code'] . ': ' . $body['error']['message']);
}
print_r($body['data']);
```

## Example response

```json
{
  "ok": true,
  "data": {
    "listingId": "aaaaaaaa-0000-4000-8000-000000000001",
    "events": [
      {
        "date": "2026-10-21T12:05:00.000Z",
        "event": "price_change",
        "price": 625000,
        "status": "active",
        "previousPrice": 660000,
        "previousStatus": "active"
      },
      {
        "date": "2026-10-01T12:00:00.000Z",
        "event": "listed",
        "price": 660000,
        "status": "active",
        "previousPrice": null,
        "previousStatus": null
      }
    ],
    "truncated": false
  },
  "meta": {
    "brokerageId": "bbbbbbbb-0000-4000-8000-000000000001",
    "freshness": {
      "asOf": "2026-10-22T15:00:00.000Z"
    },
    "mls": [
      {
        "mlsId": "11111111-1111-4111-8111-111111111111",
        "mlsName": "Fixture MLS",
        "displayType": "IDX",
        "disclaimer": {
          "text": "Fixture MLS data is deemed reliable but not guaranteed. CLIENTOK-disclaimer",
          "html": null
        },
        "logo": {
          "url": "https://ruuster-public.s3.amazonaws.com/mls-logo/fixture.png",
          "width": 80,
          "height": 40,
          "alt": "Fixture MLS logo"
        },
        "attributionTemplate": null,
        "required": [
          {
            "element": "listing_office",
            "placement": "card"
          },
          {
            "element": "disclaimer",
            "placement": "page"
          }
        ],
        "notices": [
          {
            "kind": "dmca",
            "text": "To report content that you believe infringes your copyright, write to the MLS's designated copyright agent.",
            "html": null
          }
        ],
        "draft": true
      }
    ],
    "canonical": null,
    "audience": "display"
  }
}
```
