# Sample public record history

Source: https://help.ruuster.com/idx/sandbox-public-records-history

> Every recorded sale and mortgage of one sample home, newest first, with each mortgage's status, with a sandbox secret key.

```http
GET https://idx.ruuster.com/v1/sandbox/public-records/{recordId}/history
```

secret key only · 1 unit · never cached

A sample home's recorded deeds and mortgages, newest first. Each mortgage says whether it is still
open, was released, or was paid off by a later sale or refinance, so you can show a sales history
or estimate what a seller still owes. It answers sandbox secret keys (`idx_sk_test_…`).

## What to know

- Take the record id from the lookup's `record.recordId` (`sbxrec_` and 16 hex characters). An id
  the sample data doesn't have answers 404 `not_found`.
- Every sale of a sample listing that closed is a recorded transfer here, at its close date and
  price, so the history and the sold listings agree.
- `status` is an estimate, as on the live API: a recorded release closes a loan, and so does a later
  sale of the home or a later refinance that paid it off.
- `include=owner` adds the buyers' and sellers' names on each transfer and the borrowers on each
  mortgage. The names are fictional.
- `meta.notice` carries the public-records notice. Show it wherever you show the history.

## Going live

When your account is live and has the Public Records add-on, call
[Public record history](https://help.ruuster.com/idx/public-records-history) with your secret key,
using the record id its lookup returned. It needs a `purpose`, and the `data` has the same fields.
A sandbox key answers that endpoint too, so you can build against it now.

## Where it is used

- [Sample public records lookup](https://help.ruuster.com/idx/sandbox-public-records-lookup): find
  the record id.
- [Sandbox and sample data](https://help.ruuster.com/idx/guide-sandbox).

## Path parameters

| Name | Type | Description |
|---|---|---|
| `recordId` | string | A sample public record's id (sbxrec_…), from /v1/sandbox/public-records/lookup. |

## Query parameters

| Name | Type | Description |
|---|---|---|
| `include` | enum | owner adds buyer, seller and borrower names (fictional in the sample data). Values: `owner`. |

## 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 |
|---|---|---|
| `recordId` | string | The record id (sbxrec_ and 16 hex characters). Pass it to the history endpoint. |
| `asOf` | string or null | The day the record was last updated (YYYY-MM-DD). |
| `transfers` | array of object | Every recorded transfer, newest first. |
| `transfers[].recordingDate` | string or null | The day the deed was recorded (YYYY-MM-DD). |
| `transfers[].contractDate` | string or null | The contract day (YYYY-MM-DD). |
| `transfers[].documentType` | string or null | The deed type. |
| `transfers[].price` | number or null | The sale price in dollars, or null for a transfer without one. |
| `transfers[].pricePerSqft` | number or null | The price per square foot, or null. |
| `transfers[].cashPurchase` | boolean or null | Whether the buyer paid cash. |
| `transfers[].intraFamily` | boolean or null | Whether it was a transfer within a family. |
| `transfers[].distressed` | boolean or null | Whether it was a distressed sale. |
| `transfers[].reo` | string or null | The bank-owned status, or null. |
| `transfers[].titleCompany` | string or null | The title company, or null. |
| `transfers[].documentNumber` | string or null | The recorder's document number, or null. |
| `transfers[].buyers` | object | The buyers (include=owner only). |
| `transfers[].buyers.names` | array of string | The buyers' names. |
| `transfers[].buyers.vesting` | string or null | How the buyers hold title, or null. |
| `transfers[].buyers.mailingAddress` | object or null | Where the party's mail goes, or null when the county doesn't record it. |
| `transfers[].buyers.mailingAddress.line1` | string or null | The street line. |
| `transfers[].buyers.mailingAddress.city` | string or null | The city. |
| `transfers[].buyers.mailingAddress.state` | string or null | The state code. |
| `transfers[].buyers.mailingAddress.postalCode` | string or null | The ZIP code. |
| `transfers[].sellers` | object | The sellers (include=owner only). |
| `transfers[].sellers.names` | array of string | The sellers' names. |
| `transfers[].sellers.mailingAddress` | object or null | Where the party's mail goes, or null when the county doesn't record it. |
| `transfers[].sellers.mailingAddress.line1` | string or null | The street line. |
| `transfers[].sellers.mailingAddress.city` | string or null | The city. |
| `transfers[].sellers.mailingAddress.state` | string or null | The state code. |
| `transfers[].sellers.mailingAddress.postalCode` | string or null | The ZIP code. |
| `mortgages` | array of object | Every recorded mortgage, newest first. |
| `mortgages[].recordingDate` | string or null | The day the loan was recorded (YYYY-MM-DD). |
| `mortgages[].amount` | number or null | The amount borrowed. |
| `mortgages[].purpose` | string or null | The loan purpose, for example Purchase or Refinance. |
| `mortgages[].type` | string or null | The loan type, for example Conventional, FHA or VA. |
| `mortgages[].rate` | number or null | The interest rate in percent, or null. |
| `mortgages[].termMonths` | integer or null | The term in months, or null. |
| `mortgages[].dueDate` | string or null | The maturity day (YYYY-MM-DD). |
| `mortgages[].heloc` | boolean | Whether it is a home equity line. |
| `mortgages[].purchaseMoney` | boolean or null | Whether the loan paid for the purchase. |
| `mortgages[].lender` | string or null | The lender. |
| `mortgages[].lenderType` | string or null | The lender type, or null. |
| `mortgages[].titleCompany` | string or null | The title company, or null. |
| `mortgages[].documentNumber` | string or null | The recorder's document number, or null. |
| `mortgages[].status` | string (enum) | open; released (a release was recorded); or paid_off (a later sale or refinance paid it off). An estimate. One of `open`, `released`, `paid_off`. |
| `mortgages[].closedBy` | string (enum) or null | What closed it, or null while open. One of `release`, `sale`, `refinance`. |
| `mortgages[].closedOn` | string or null | The day it closed, or null while open (YYYY-MM-DD). |
| `mortgages[].borrowers` | array of string | The borrowers' names (include=owner only). |

## 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`, `secret_key_in_browser`, `secret_key_required`, `sold_not_permitted`, `daily_quota_exceeded`, `rate_limited`, `internal_error`, `api_paused`, `source_unavailable`

## Example request

cURL:

```bash
curl -s "https://idx.ruuster.com/v1/sandbox/public-records/sbxrec_30981263a28d6cfb/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.request("/sandbox/public-records/sbxrec_30981263a28d6cfb/history");
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/sandbox/public-records/sbxrec_30981263a28d6cfb/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/sandbox/public-records/sbxrec_30981263a28d6cfb/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": {
    "recordId": "sbxrec_30981263a28d6cfb",
    "asOf": "2026-11-05",
    "transfers": [
      {
        "recordingDate": "2024-05-02",
        "contractDate": "2024-02-28",
        "documentType": "Warranty Deed",
        "price": 1045500,
        "pricePerSqft": 404,
        "cashPurchase": false,
        "intraFamily": false,
        "distressed": false,
        "reo": null,
        "titleCompany": null,
        "documentNumber": null
      },
      {
        "recordingDate": "2022-06-09",
        "contractDate": "2022-04-17",
        "documentType": "Warranty Deed",
        "price": 981500,
        "pricePerSqft": 379,
        "cashPurchase": false,
        "intraFamily": false,
        "distressed": false,
        "reo": null,
        "titleCompany": null,
        "documentNumber": null
      },
      {
        "recordingDate": "2016-12-04",
        "contractDate": null,
        "documentType": "Warranty Deed",
        "price": 825500,
        "pricePerSqft": 319,
        "cashPurchase": false,
        "intraFamily": false,
        "distressed": false,
        "reo": null,
        "titleCompany": null,
        "documentNumber": null
      },
      {
        "recordingDate": "2006-12-24",
        "contractDate": null,
        "documentType": "Warranty Deed",
        "price": 539000,
        "pricePerSqft": 208,
        "cashPurchase": true,
        "intraFamily": false,
        "distressed": false,
        "reo": null,
        "titleCompany": null,
        "documentNumber": null
      }
    ],
    "mortgages": [
      {
        "recordingDate": "2024-05-02",
        "amount": 988700,
        "purpose": "Purchase",
        "type": "FHA",
        "rate": 6.423,
        "termMonths": 180,
        "dueDate": "2039-05-02",
        "heloc": false,
        "purchaseMoney": true,
        "lender": "Sample Community Bank",
        "lenderType": null,
        "titleCompany": null,
        "documentNumber": null,
        "status": "open",
        "closedBy": null,
        "closedOn": null
      },
      {
        "recordingDate": "2022-06-09",
        "amount": 716600,
        "purpose": "Purchase",
        "type": "Conventional",
        "rate": 5.614,
        "termMonths": 180,
        "dueDate": "2037-06-09",
        "heloc": false,
        "purchaseMoney": true,
        "lender": "Sample Savings Bank",
        "lenderType": null,
        "titleCompany": null,
        "documentNumber": null,
        "status": "released",
        "closedBy": "release",
        "closedOn": "2024-06-12"
      },
      {
        "recordingDate": "2021-12-11",
        "amount": 767300,
        "purpose": "Refinance 1st",
        "type": "Conventional",
        "rate": 3.164,
        "termMonths": 180,
        "dueDate": "2036-12-11",
        "heloc": false,
        "purchaseMoney": false,
        "lender": "Sample Community Bank",
        "lenderType": null,
        "titleCompany": null,
        "documentNumber": null,
        "status": "released",
        "closedBy": "release",
        "closedOn": "2022-07-14"
      },
      {
        "recordingDate": "2016-12-04",
        "amount": 687500,
        "purpose": "Purchase",
        "type": "Conventional",
        "rate": 3.463,
        "termMonths": 360,
        "dueDate": "2046-12-04",
        "heloc": false,
        "purchaseMoney": true,
        "lender": "Sample Home Lending",
        "lenderType": null,
        "titleCompany": null,
        "documentNumber": null,
        "status": "released",
        "closedBy": "release",
        "closedOn": "2022-01-01"
      }
    ]
  },
  "meta": {
    "brokerageId": "5a3b1e00-0000-4000-8000-0000000acc01",
    "freshness": {
      "asOf": "2026-11-06T15:00:00.000Z"
    },
    "mls": [],
    "canonical": null,
    "notice": "From county public records, which run about two months behind recording. Not a title, vesting or encumbrance report; mortgage status is estimated from recorded releases, later sales and refinances. Owner details may not be used to contact anyone who has asked not to be solicited. These are sample records for development: the homes, owners, sales and loans are fictional.",
    "sandbox": true
  }
}
```
