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

# Commercial lending

> Collateral assessment and site selection with federal-source provenance.

A regional bank's commercial real-estate desk underwrites a \$4.2 M
warehouse loan on a coastal industrial parcel in Houston. The collateral
review needs to confirm the site is buildable, not subject to undisclosed
floodplain restrictions, and has working access to power and rail
infrastructure. The bank's auditors will sample the file in 18 months and
expect each data point to be re-verifiable.

## The query

Address geocodes to `lat=29.7604, lng=-95.3698` (downtown Houston). Run
the `site_selection` preset:

```bash theme={null}
curl -s https://api.mireye.com/v1/fetch \
  -H "Authorization: Bearer $MIREYE_API_TOKEN" \
  -H 'content-type: application/json' \
  -d '{
    "lat": 29.7604,
    "lng": -95.3698,
    "preset": "site_selection"
  }' | jq
```

## The response

```jsonc theme={null}
{
  "lat": 29.7604,
  "lng": -95.3698,
  "fetched_at": "2026-06-12T07:28:18.216670+00:00",
  "fields": {
    "elevation": {
      "value": 14.376572609,
      "unit": "meters",
      "source": "USGS_EPQS",
      "source_url": "https://epqs.nationalmap.gov/v1/json?x=-95.3698&y=29.7604&wkid=4326&units=Meters",
      "confidence": "high",
      "fetched_at": "2026-06-12T07:28:08.209880+00:00",
      "dataset_vintage": "3DEP dynamic service",
      "ttl_seconds": 31536000,
      "notes": null
    },
    "slope_degrees": {
      "value": 0.7228949666023254,
      "unit": "degrees",
      "source": "USGS_3DEP_COG",
      "source_url": "https://www.usgs.gov/3d-elevation-program",
      "confidence": "medium",
      "fetched_at": "2026-06-12T07:28:07.908468+00:00",
      "dataset_vintage": null,
      "ttl_seconds": 31536000,
      "notes": null
    },
    "lcms_class": {
      "value": "Barren or Impervious",
      "unit": null,
      "source": "USFS_LCMS",
      "source_url": "https://developers.google.com/earth-engine/datasets/catalog/USFS_GTAC_LCMS_v2024-10",
      "confidence": "high",
      "fetched_at": "2026-06-12T07:28:08.284669+00:00",
      "dataset_vintage": "2025-11",
      "ttl_seconds": 2592000,
      "notes": null
    },
    "within_floodplain_polygon": {
      "value": false,
      "unit": null,
      "source": "FEMA_NFHL",
      "source_url": "https://hazards.fema.gov/arcgis/rest/services/public/NFHL/MapServer/28/query?f=json&geometry=-95.3698%2C29.7604&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIntersects&outFields=FLD_ZONE%2CZONE_SUBTY%2CSFHA_TF%2CFLD_AR_ID%2CDFIRM_ID%2CSOURCE_CIT&returnGeometry=false&resultRecordCount=5",
      "confidence": "high",
      "fetched_at": "2026-06-12T07:28:08.222254+00:00",
      "dataset_vintage": "48201C_STUDY1",
      "ttl_seconds": 86400,
      "notes": "FEMA NFHL Flood Hazard Zones intersect, but not an SFHA: Zone X; AREA OF MINIMAL FLOOD HAZARD; SFHA_TF=F; FLD_AR_ID=48201C_9742; SOURCE_CIT=48201C_STUDY1."
    },
    "nearest_major_road_distance_m": {
      "value": 53.541597796999014,
      "unit": "meters",
      "source": "OVERTURE_TRANSPORTATION",
      "source_url": "https://overturemaps.org/documentation/transportation/",
      "confidence": "high",
      "fetched_at": "2026-06-12T07:28:18.213915+00:00",
      "dataset_vintage": "2026-05-20.0",
      "ttl_seconds": 2592000,
      "notes": null
    },
    "nearest_transmission_line_distance_m": {
      "value": 77.48067736145369,
      "unit": "meters",
      "source": "EIA_POWER",
      "source_url": "https://atlas.eia.gov/",
      "confidence": "high",
      "fetched_at": "2026-06-12T07:28:08.282546+00:00",
      "dataset_vintage": null,
      "ttl_seconds": 86400,
      "notes": null
    },
    "nearest_transmission_line_voltage_kv": {
      "value": 138.0,
      "unit": "kilovolts",
      "source": "EIA_POWER",
      "source_url": "https://atlas.eia.gov/",
      "confidence": "high",
      "fetched_at": "2026-06-12T07:28:08.282561+00:00",
      "dataset_vintage": null,
      "ttl_seconds": 86400,
      "notes": null
    },
    "nearest_transmission_line_voltage_class": {
      "value": "100-161",
      "unit": null,
      "source": "EIA_POWER",
      "source_url": "https://atlas.eia.gov/",
      "confidence": "high",
      "fetched_at": "2026-06-12T07:28:08.282587+00:00",
      "dataset_vintage": null,
      "ttl_seconds": 86400,
      "notes": null
    },
    "intersects_conservation_easement": {
      "value": false,
      "unit": null,
      "source": "PAD_US",
      "source_url": "https://www.sciencebase.gov/catalog/item/652ef930d34edd15305a9b03",
      "confidence": "high",
      "fetched_at": "2026-06-12T07:28:08.022457+00:00",
      "dataset_vintage": null,
      "ttl_seconds": 2592000,
      "notes": null
    },
    "parcel_id": {
      "value": null,
      "unit": null,
      "source": "REGRID",
      "source_url": "https://app.regrid.com/api/v2/parcels/point",
      "confidence": "unknown",
      "fetched_at": "2026-06-12T07:28:18.216409+00:00",
      "dataset_vintage": null,
      "ttl_seconds": 86400,
      "notes": "No Regrid parcel at the point or within the bounded radius. Parent path 'parcel.parcel_id' resolved to None."
    }
    /* …12 more site_selection fields (wetland detail, max-voltage-in-radius,
       critical habitat, parcel geometry) — 22 returned in total */
  },
  "partial_failures": [
    {
      "field": "intersects_protected_area",
      "source": "USGS_PADUS",
      "error": "FileNotFoundError: data/padus_fee.gpkg missing. Run: mireye-earth bootstrap --refresh-stale",
      "retryable": false
    },
    {
      "field": "protected_area_gap_status",
      "source": "USGS_PADUS",
      "error": "FileNotFoundError: data/padus_fee.gpkg missing. Run: mireye-earth bootstrap --refresh-stale",
      "retryable": false
    }
  ]
}
```

## What the credit memo says

The relationship manager files a one-page collateral summary:

> **Site characteristics (Mireye Earth, fetched 2026-06-12T07:28Z)**
>
> * Elevation 14.4 m (USGS EPQS / 3DEP) — above the local storm-surge
>   plane.
> * Slope 0.7° (USGS 3DEP COG) — buildable as-is, no grading required.
> * Land cover "Barren or Impervious" (USFS LCMS) — already hardscaped
>   urban ground; no greenfield conversion.
> * **Not in a FEMA Special Flood Hazard Area** (FEMA NFHL). NOTE: this
>   is the NFHL SFHA polygon check, not a regulated flood-zone
>   determination — the bank's flood-insurance determination still needs
>   a certified determination product.
> * Nearest major road 54 m (Overture Transportation).
> * Nearest transmission line 77 m at 138 kV, class 100–161 kV
>   (EIA Energy Atlas) — service feasible without trunk extension.
> * No conservation easement intersection (PAD-US).
> * Parcel record: none at this point on the Regrid free tier
>   (`parcel_id: null`, confidence `unknown`) — parcel geometry deferred
>   to the title package.
> * Protected-area status **unavailable this fetch** — surfaced in
>   `partial_failures`, recorded as a data gap rather than assumed
>   clear.

The auditor in 2027 can click any `source_url`, plug the lat/lng into
the agency's own viewer (e.g. [https://atlas.eia.gov/](https://atlas.eia.gov/)), and see the
transmission line that was 77 m away on the underwrite date.

## The honesty pattern matters here

It already did its job in the response above: the two protected-area
fields arrived in `partial_failures` with `retryable: false` instead of
silently reading as clear. The memo records the gap and the desk decides
whether to re-pull later or resolve it another way.

The `retryable` flag drives the runbook. A transient upstream failure
(e.g. an EIA Atlas timeout) comes back `retryable: true` — the
underwriting system retries with backoff. A `retryable: false` failure
means the source has no data at this coordinate or is missing an
upstream asset; retrying won't help, so the gap goes in the memo:
"protected-area status unavailable at underwrite time; deferred." Either
way, the bank never makes a credit decision on a value that silently
substituted a stale or approximate number.

## Protected-land encumbrances: a worked rejection

Same desk, different parcel. The borrower offers `lat=37.8651,
lng=-119.5383` (a parcel in the Sierra Nevada) as collateral for a
\$1.8 M loan. The borrower's broker swears the land is clear of
restrictions. The desk pulls the encumbrance fields:

```bash theme={null}
curl -s https://api.mireye.com/v1/fetch \
  -H "Authorization: Bearer $MIREYE_API_TOKEN" \
  -H 'content-type: application/json' \
  -d '{"lat": 37.8651, "lng": -119.5383, "fields": ["intersects_conservation_easement", "easement_holder", "intersects_critical_habitat", "critical_habitat_status"]}' | jq
```

```json theme={null}
{
  "fields": {
    "intersects_conservation_easement": {
      "value": false,
      "source": "PAD_US",
      "confidence": "high"
    },
    "easement_holder": {
      "value": null,
      "source": "PAD_US",
      "confidence": "high"
    },
    "intersects_critical_habitat": {
      "value": true,
      "source": "USFWS_CRITHAB",
      "confidence": "high"
    },
    "critical_habitat_status": {
      "value": "Final",
      "source": "USFWS_CRITHAB",
      "confidence": "high"
    }
  }
}
```

No conservation easement — the broker was right about that — but the
parcel intersects **final designated USFWS critical habitat**. That is a
federal Endangered Species Act overlay: Section 7 consultation applies
to any federally permitted work, which changes the development story the
loan was priced on. The loan goes back for renegotiation or pricing
adjustment. (When a parcel does intersect a PAD-US easement,
`intersects_conservation_easement` flips true and `easement_holder`
names the holding organization for the title follow-up.)

## Why this works for lending

* **Per-source citations** survive auditor sampling. No vendor lookup
  required years later.
* **`partial_failures` honesty** prevents silent substitutions that
  would otherwise contaminate the underwriting record.
* **Federal-only sources** sidestep contractual issues with proprietary
  data on long-tenor loans where the data license might expire before
  the loan does.
* **`ttl_seconds`** hints to the bank's data warehouse how often each
  source is worth re-fetching — Census/Overture boundaries once a year,
  EIA daily.

## What it does NOT do

* **Not a certified flood-zone determination.**
  `within_floodplain_polygon` checks the FEMA National Flood Hazard
  Layer SFHA polygons directly, but a regulated flood-insurance
  determination (SFHDF) must come from a certified determination
  vendor.
* **Not an appraisal.** Building values, comparable sales, and cap
  rates live elsewhere.
* **Not a title search.** Conservation easements are surfaced via
  PAD-US; private easements, liens, and access agreements require a
  title search.
