> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hasdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Fields to Track

A monitor's `fields` say what a check compares. Each one is a path into the API response. A check keeps only those fields, in the shape of the response, and reports a change when they differ from the previous check.

```json theme={null}
{
  "fields": [
    { "path": "product.price.currentPrice" },
    { "path": "product.isAvailable" }
  ]
}
```

Without `fields`, the whole response is compared, less its `requestMetadata`. For Web Scraping that is the page as markdown, or the data your `aiExtractRules` extracted; it takes no fields.

A field that is missing from the response is kept as `null`, so a field appearing or disappearing is a change too.

## Lists

Many responses carry lists: Zillow's `properties`, Amazon's `product.variants`, a SERP's `organicResults`. A list is tracked with `list`, which says how its items are read:

```json theme={null}
{ "path": "properties", "list": { "keys": ["id"], "fields": [] } }
```

* `keys`: the item fields that tell items apart. With keys, a check reports items that were **added**, **removed**, and **changed** (an item with the same key whose tracked fields differ). Order never matters.
* `fields`: the item fields to compare. Empty, the whole item is kept, but only the keys are hashed: a listing whose price moved is not a change, only a listing that appeared or disappeared is.

| `fields` entry | What a check reports |
| - | - |
| `{ "path": "properties", "list": { "keys": ["id"], "fields": [] } }` | A listing appeared or disappeared; each item is kept whole. |
| `{ "path": "properties", "list": { "keys": ["id"], "fields": ["price", "status"] } }` | The same, plus `price` or `status` changing on a listing that stayed. |
| `{ "path": "localResults.places", "list": { "keys": ["title", "address"], "fields": ["rating"] } }` | Composite key: a place is the same place when both match. |
| `{ "path": "product.images", "list": { "keys": [], "fields": [] } }` | No key: items are compared by content, as a multiset. Added and removed only; strings and numbers count as items. |
| `{ "path": "properties" }` | No `list`: the whole array is one value; any difference inside it is a change. |

Two entries for one list merge into one rule: `properties[id].price` and `properties[id].status` as separate entries become `fields: ["price", "status"]`. An entry with `fields: []` absorbs the others. Two different keys for one list, or a path tracked both with and without `list`, are refused with `400`.

> [!NOTE]
>
> In the dashboard the same rules are written as lines: `properties[id].price`, `product.images[]`, `localResults.places[title,address].rating`.

## What a Snapshot Looks Like

With `{ "path": "properties", "list": { "keys": ["id"], "fields": ["price"] } }` and `{ "path": "searchInformation.totalResults" }`, a Zillow check keeps:

```json theme={null}
{
  "properties": [
    { "id": "2061234567", "price": 489000 },
    { "id": "2067654321", "price": 575000 }
  ],
  "searchInformation": { "totalResults": 2 }
}
```

`GET /monitors/{id}/resources/{resourceId}/snapshot` returns the latest one.

## What a Diff Looks Like

A changed result carries `diff`:

```json theme={null}
{
  "kind": "fields",
  "changes": [
    { "path": "searchInformation.totalResults", "before": 2, "after": 3 }
  ],
  "lists": [
    {
      "path": "properties",
      "keys": ["id"],
      "added": [{ "id": "2070000001", "price": 450000 }],
      "removed": [],
      "changed": [
        { "key": "2061234567", "changes": [{ "path": "price", "before": 489000, "after": 479000 }] }
      ]
    }
  ]
}
```

`changes` lists value changes by path; `lists` has one entry per tracked list that gained, lost or changed items. A result also carries `patch`, a unified diff of the snapshot text, for display.

Without fields the diff is `{ "kind": "object", "changes": [ … ] }`, or `{ "kind": "text", "changes": [{ "type": "added" | "removed", "value": "…" }] }` for a page as markdown.

## Suggested and Default Fields

`GET /monitors/endpoints` returns, for each endpoint, `fields.suggested` (paths worth tracking) and `fields.default` (what the dashboard picks for a new monitor). The API applies no defaults: a monitor created without `fields` compares the whole response.

```json theme={null}
{
  "id": "amazon_product",
  "fields": {
    "suggested": [
      { "path": "product.price.currentPrice" },
      { "path": "product.isAvailable" },
      { "path": "product.variants", "list": { "keys": ["asin"], "fields": [] } }
    ],
    "default": [
      { "path": "product.price.currentPrice" },
      { "path": "product.isAvailable" },
      { "path": "product.stockWarning" }
    ]
  }
}
```

## Changing Fields

`PUT /monitors/{id}` with new `fields` rebuilds the baseline from the last response the API gave for each resource: no request is made and no credits are spent. History stays; the next check compares against the new baseline.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.