# runPropertyComparables

Comparable sales for a property (its id from a property read), as the property page's Comps tab: each comp's facts, distance and price per square foot, and the medians with the subject's implied value. Optional criteria narrow it (every bound is required when sent). Spends nothing.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "runPropertyComparables", "variables": {...} }`
- Scope: `WRITE`
- Type: mutation
- Idempotency: honors `Idempotency-Key` (24 h)
- Rate-limited: no

## Variables

- `propertyId`: `ID!` (required)
- `criteria`: `PropertyComparablesCriteriaInput`
  - `maxDistanceMiles`: `Float!` (required)
  - `maxSaleAgeMonths`: `Int!` (required)
  - `livingAreaMin`: `Int!` (required)
  - `livingAreaMax`: `Int!` (required)
  - `yearBuiltMin`: `Int!` (required)
  - `yearBuiltMax`: `Int!` (required)
  - `bedroomsMin`: `Int!` (required)
  - `bedroomsMax`: `Int!` (required)
  - `bathroomsMin`: `Float!` (required)
  - `bathroomsMax`: `Float!` (required)
  - `propertyTypes`: `[String!]!` (required)
  - `includeActiveListings`: `Boolean`
  - `ownerType`: `String`

## Response (data, an example)

```json
{
  "propertyMutation": {
    "runPropertyComparables": {
      "comparables": [
        {
          "propertyId": "<ID>",
          "address": {
            "line1": "…",
            "city": "…",
            "state": "…",
            "zip": "…"
          },
          "beds": 0,
          "baths": 0,
          "livingSquareFeet": 0,
          "yearBuilt": 0,
          "lastSoldDate": "2026-01-01T00:00:00.000Z",
          "lastSoldPrice": "…",
          "isOnMarketComp": true,
          "listPrice": 0,
          "distanceMiles": 0,
          "pricePerSquareFoot": 0
        }
      ],
      "analytics": {
        "compCount": 0,
        "medianLastSoldPrice": 0,
        "medianPricePerSquareFoot": 0,
        "medianDistanceMiles": 0,
        "subjectImpliedValueFromMedianPricePerSquareFoot": 0
      },
      "generatedAt": "2026-01-01T00:00:00.000Z"
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "operationId": "runPropertyComparables",
    "variables": {
      "propertyId": "<propertyId>"
    }
  }'
```
