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

# Mireye API reference

> API reference for the Mireye plugin in Corsair: every `mireye.api.*` operation with its input and output types, taken from the plugin's Zod schemas.

> [!NOTE]
>
> **New to Corsair?** See [API access](https://docs.corsair.dev/concepts/api.md), [authentication](https://docs.corsair.dev/concepts/auth.md), and [error handling](https://docs.corsair.dev/concepts/error-handling).

## Account

### get

`account.get`

Get the account the API key belongs to.

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.account.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `user` | `object \| null` | No | — |

> [accordion] user full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

### listRequests

`account.listRequests`

List the API calls of the last 30 days, free and paid, newest first.

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.account.listRequests({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | Rows per page, 1-100 (default 25). |
| `cursor` | `string` | No | next\_cursor from the previous page. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `requests` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null` | No | — |

> [accordion] requests full type
>
> ```ts theme={null}
> {
> }[] | null
> ```

***

## Agent

### ask

`agent.ask`

Give Mireye Agent a search, research or analysis task in plain language. The Agent is free, but it runs paid Search, Enrich and Proximity calls on the balance with no cap unless maxCostUsd is set. A slow answer comes back with status running: poll agent.getTurn.

**Risk:** `destructive`

```ts theme={null}
await corsair.mireye.api.agent.ask({ message: 'Vacant parcels over 20 acres in Travis County, TX, and their owners', maxCostUsd: '1.00' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `message` | `string` | Yes | The task in plain language. |
| `conversationId` | `string` | No | An earlier conversation\_id, to ask a follow-up. |
| `maxCostUsd` | `string` | No | Spending cap for this question, such as "2.00" (at most "25.00"). Without it there is no cap. If the plan costs more, nothing runs and the turn is awaiting\_confirmation. |
| `targetResultId` | `string` | No | The earlier table a follow-up is about, such as "t1.s1". |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string \| null` | No | — |
| `turn_id` | `string \| null` | No | — |
| `status` | `string \| null` | No | complete, running, awaiting\_confirmation, needs\_funds, balance\_empty, failed or cancelled. |
| `answer` | `string \| null` | No | — |
| `results` | `object[] \| null` | No | — |
| `cost_usd` | `string \| null` | No | — |
| `confirmation` | `object \| null` | No | — |
| `funds` | `object \| null` | No | — |
| `error` | `JsonValue` | No | — |
| `report` | `object \| null` | No | — |
| `time_limited` | `boolean \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
> }[] | null
> ```

> [accordion] confirmation full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] funds full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] report full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

### cancelTurn

`agent.cancelTurn`

Cancel an Agent turn that is awaiting confirmation or running.

**Risk:** `write`

```ts theme={null}
await corsair.mireye.api.agent.cancelTurn({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversationId` | `string` | Yes | conversation\_id from agent.ask. |
| `turnId` | `string` | Yes | turn\_id from agent.ask. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string \| null` | No | — |
| `turn_id` | `string \| null` | No | — |
| `status` | `string \| null` | No | complete, running, awaiting\_confirmation, needs\_funds, balance\_empty, failed or cancelled. |
| `answer` | `string \| null` | No | — |
| `results` | `object[] \| null` | No | — |
| `cost_usd` | `string \| null` | No | — |
| `confirmation` | `object \| null` | No | — |
| `funds` | `object \| null` | No | — |
| `error` | `JsonValue` | No | — |
| `report` | `object \| null` | No | — |
| `time_limited` | `boolean \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
> }[] | null
> ```

> [accordion] confirmation full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] funds full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] report full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

### confirmTurn

`agent.confirmTurn`

Approve an Agent turn that is awaiting\_confirmation, optionally with a higher maxCostUsd. Its paid calls run and are charged.

**Risk:** `destructive`

```ts theme={null}
await corsair.mireye.api.agent.confirmTurn({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversationId` | `string` | Yes | conversation\_id from agent.ask. |
| `turnId` | `string` | Yes | turn\_id from agent.ask. |
| `maxCostUsd` | `string` | No | A higher cap, such as the quote\_usd from the confirmation. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string \| null` | No | — |
| `turn_id` | `string \| null` | No | — |
| `status` | `string \| null` | No | complete, running, awaiting\_confirmation, needs\_funds, balance\_empty, failed or cancelled. |
| `answer` | `string \| null` | No | — |
| `results` | `object[] \| null` | No | — |
| `cost_usd` | `string \| null` | No | — |
| `confirmation` | `object \| null` | No | — |
| `funds` | `object \| null` | No | — |
| `error` | `JsonValue` | No | — |
| `report` | `object \| null` | No | — |
| `time_limited` | `boolean \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
> }[] | null
> ```

> [accordion] confirmation full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] funds full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] report full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

### getResultRows

`agent.getResultRows`

Read one page of rows from an Agent result table (free).

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.agent.getResultRows({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversationId` | `string` | Yes | conversation\_id from agent.ask. |
| `resultId` | `string` | Yes | A results\[].id from the answer, such as "t1.s1". |
| `offset` | `number` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `columns` | `object[] \| null` | No | — |
| `rows` | `object[] \| null` | No | — |
| `offset` | `number \| null` | No | — |
| `limit` | `number \| null` | No | — |
| `row_count` | `number \| null` | No | — |

> [accordion] columns full type
>
> ```ts theme={null}
> {
> }[] | null
> ```

> [accordion] rows full type
>
> ```ts theme={null}
> {
> }[] | null
> ```

***

### getTurn

`agent.getTurn`

Read an Agent turn until its status is no longer running (waits up to 25 seconds per call).

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.agent.getTurn({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversationId` | `string` | Yes | conversation\_id from agent.ask. |
| `turnId` | `string` | Yes | turn\_id from agent.ask. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string \| null` | No | — |
| `turn_id` | `string \| null` | No | — |
| `status` | `string \| null` | No | complete, running, awaiting\_confirmation, needs\_funds, balance\_empty, failed or cancelled. |
| `answer` | `string \| null` | No | — |
| `results` | `object[] \| null` | No | — |
| `cost_usd` | `string \| null` | No | — |
| `confirmation` | `object \| null` | No | — |
| `funds` | `object \| null` | No | — |
| `error` | `JsonValue` | No | — |
| `report` | `object \| null` | No | — |
| `time_limited` | `boolean \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
> }[] | null
> ```

> [accordion] confirmation full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] funds full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] report full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

### resumeTurn

`agent.resumeTurn`

Resume an Agent turn that stopped with needs\_funds after the balance was topped up. Finished work is not charged again.

**Risk:** `destructive`

```ts theme={null}
await corsair.mireye.api.agent.resumeTurn({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversationId` | `string` | Yes | conversation\_id from agent.ask. |
| `turnId` | `string` | Yes | turn\_id from agent.ask. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string \| null` | No | — |
| `turn_id` | `string \| null` | No | — |
| `status` | `string \| null` | No | complete, running, awaiting\_confirmation, needs\_funds, balance\_empty, failed or cancelled. |
| `answer` | `string \| null` | No | — |
| `results` | `object[] \| null` | No | — |
| `cost_usd` | `string \| null` | No | — |
| `confirmation` | `object \| null` | No | — |
| `funds` | `object \| null` | No | — |
| `error` | `JsonValue` | No | — |
| `report` | `object \| null` | No | — |
| `time_limited` | `boolean \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
> }[] | null
> ```

> [accordion] confirmation full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] funds full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] report full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

## Billing

### get

`billing.get`

Get the plan and billing state of the account.

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.billing.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `plan` | `object \| null` | No | — |

> [accordion] plan full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

## Field Requests

### create

`fieldRequests.create`

Ask Mireye for a data point it does not have yet, in plain language (free). If the catalog already answers it, the value comes back now; otherwise Mireye builds it and notifies callback.email or callback.webhook\_url.

**Risk:** `destructive`

```ts theme={null}
await corsair.mireye.api.fieldRequests.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `body` | `object` | Yes | — |

> [accordion] body full type
>
> ```ts theme={null}
> {
>   description: string,
>   example_locations: {
>     address?: string | null,
>     lat?: number | null,
>     lng?: number | null,
>     polygon?: {
>     } | null,
>     claimed_value?: string | null,
>     note?: string | null
>   }[],
>   use_case?: string | null,
>   decision_threshold?: string | null,
>   area_of_interest?: {
>     level?: city | county | state | region | national | null,
>     names?: string[]
>   } | null,
>   expected_volume?: {
>     locations?: number | null,
>     geography?: string | null,
>     cadence?: one_off | recurring | null
>   } | null,
>   freshness?: {
>     max_staleness?: string | null,
>     changes_how_often?: string | null
>   } | null,
>   constraints?: {
>     must_not_be?: string[],
>     already_have?: string[],
>     acceptable_substitutes?: string[]
>   } | null,
>   known_sources?: {
>     suggested?: {
>       name?: string | null,
>       url?: string | null,
>       note?: string | null,
>       why?: string | null
>     }[],
>     excluded?: {
>       name?: string | null,
>       url?: string | null,
>       note?: string | null,
>       why?: string | null
>     }[]
>   } | null,
>   deadline?: string | null,
>   output_preference?: {
>     value_kind?: boolean | category | number | distance | geometry | null,
>     units?: string | null,
>     buckets_ok?: boolean | null
>   } | null,
>   requested_fields?: {
>     ask: string
>   }[],
>   idempotency_key?: string | null,
>   callback?: {
>     webhook_url?: string | null,
>     email?: string | null
>   } | null,
>   context_blob?: string | null
> }
> ```

**Output:** *empty object*

***

### get

`fieldRequests.get`

Poll a field request: status, queue position, ETA and the resume call once the field is live.

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.fieldRequests.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `requestId` | `string` | Yes | — |

**Output:** *empty object*

***

## Fields

### list

`fields.list`

List the Fetch fields and presets, with sources and units (free, no key needed).

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.fields.list({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `version` | `string \| null` | No | — |
| `contract` | `string \| null` | No | — |
| `us_envelope` | `Record<string, number>` | Yes | — |
| `fields` | `object[]` | Yes | — |
| `presets` | `Record<string, string[]>` | Yes | — |
| `billing` | `object` | Yes | — |

> [accordion] fields full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   layer?: string | null,
>   type?: string | null,
>   unit?: string | null,
>   description?: string | null,
>   interpretation_hints?: string | null,
>   null_meaning?: string | null,
>   nullable?: boolean | null,
>   source?: string | null,
>   source_url?: string | null,
>   ttl_seconds?: number | null,
>   presets: string[],
>   billing: {
>     currency?: string | null,
>     price_usd?: string | null,
>     unit?: string | null
>   },
>   derivation?: Record<string, JsonValue> | null,
>   label?: string | null,
>   priority?: number | null,
>   source_short_name?: string | null
> }[]
> ```

> [accordion] billing full type
>
> ```ts theme={null}
> {
>   currency?: string | null,
>   price_usd?: string | null,
>   unit?: string | null
> }
> ```

***

### listEnrich

`fields.listEnrich`

List every Enrich field ID and preset, with types, units, hints and price.

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.fields.listEnrich({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `version` | `string \| null` | No | — |
| `pricing` | `object` | Yes | — |
| `presets` | `object[]` | Yes | — |
| `fields` | `object[]` | Yes | — |

> [accordion] pricing full type
>
> ```ts theme={null}
> {
>   currency?: string | null,
>   unit?: string | null,
>   price_usd?: string | null,
>   plan_prices_usd: Record<string, string>,
>   charged_when?: string | null
> }
> ```

> [accordion] presets full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   description?: string | null,
>   fields: string[]
> }[]
> ```

> [accordion] fields full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   type?: string | null,
>   unit?: string | null,
>   description?: string | null,
>   interpretation_hints?: string | null,
>   null_meaning?: string | null,
>   nullable?: boolean | null,
>   source?: string | null,
>   label?: string | null,
>   priority?: number | null,
>   source_short_name?: string | null,
>   presets: string[]
> }[]
> ```

***

### listSearch

`fields.listSearch`

List every Search filter and output field, with its filter operators, hints and price.

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.fields.listSearch({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `version` | `string \| null` | No | — |
| `pricing` | `object` | Yes | — |
| `fields` | `object[]` | Yes | — |

> [accordion] pricing full type
>
> ```ts theme={null}
> {
>   currency?: string | null,
>   unit?: string | null,
>   price_usd?: string | null,
>   plan_prices_usd: Record<string, string>,
>   charged_when?: string | null
> }
> ```

> [accordion] fields full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   type?: string | null,
>   unit?: string | null,
>   description?: string | null,
>   interpretation_hints?: string | null,
>   null_meaning?: string | null,
>   nullable?: boolean | null,
>   source?: string | null,
>   label?: string | null,
>   priority?: number | null,
>   source_short_name?: string | null,
>   filter_ops: string[],
>   returnable?: boolean | null
> }[]
> ```

***

## Locations

### enrich

`locations.enrich`

Match one US address or coordinate to a parcel and return the fields you choose (owner, zoning, valuation and more). Charged per matched parcel from the Mireye balance (\$0.02 on Free); max\_cost\_usd caps it. Check parcel\_match.status first.

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.locations.enrich({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `body` | `object` | Yes | — |
| `idempotencyKey` | `string \| null` | No | — |

> [accordion] body full type
>
> ```ts theme={null}
> {
>   lat?: number | null,
>   lng?: number | null,
>   address?: string | null,
>   max_cost_usd?: string | null,
>   fields?: string[] | null,
>   preset?: (parcel | zoning | buildings | valuation | legal | power | access | water | terrain | environment | climate | hazards | market | constraints)[] | null,
>   permits?: {
>   } | null,
>   permits_limit?: number | null
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `lat` | `number \| null` | No | — |
| `lng` | `number \| null` | No | — |
| `billing` | `object \| null` | No | — |
| `resolved_location` | `object` | Yes | — |
| `geocode` | `object \| null` | No | — |
| `analysis_point` | `object \| null` | No | — |
| `parcel_match` | `object` | Yes | — |
| `fields` | `object` | Yes | — |
| `permit_fields_unavailable` | `object[] \| null` | No | — |
| `permits` | `object \| null` | No | — |

> [accordion] billing full type
>
> ```ts theme={null}
> {
>   operation_id?: string | null,
>   currency?: string | null,
>   charged_usd?: string | null,
>   pricing_version?: string | null,
>   replayed?: boolean | null
> } | null
> ```

> [accordion] resolved\_location full type
>
> ```ts theme={null}
> {
>   lat?: number | null,
>   lng?: number | null,
>   source?: string | null
> }
> ```

> [accordion] geocode full type
>
> ```ts theme={null}
> {
>   accuracy?: number | null,
>   accuracy_type?: string | null,
>   match_type?: string | null,
>   normalized_address?: string | null,
>   provider?: string | null,
>   source?: string | null,
>   parcel_grade?: boolean | null,
>   precision_note?: string | null
> } | null
> ```

> [accordion] analysis\_point full type
>
> ```ts theme={null}
> {
>   lat?: number | null,
>   lng?: number | null,
>   method?: string | null,
>   source?: string | null
> } | null
> ```

> [accordion] parcel\_match full type
>
> ```ts theme={null}
> {
>   status?: string | null,
>   parcel?: {
>     parcelnumb?: string | null,
>     address?: string | null,
>     source?: string | null,
>     match_type?: string | null,
>     match_distance_m?: number | null
>   } | null,
>   candidates?: {
>     parcelnumb?: string | null,
>     address?: string | null,
>     source?: string | null,
>     match_type?: string | null,
>     match_distance_m?: number | null
>   }[],
>   reason?: string | null
> }
> ```

> [accordion] fields full type
>
> ```ts theme={null}
> Record<string, {
>   value: JsonValue,
>   source?: string | null,
>   confidence?: string | null,
>   interpretation_hints?: string | null,
>   unit?: string | null,
>   flags?: string[] | null
> }>
> ```

> [accordion] permit\_fields\_unavailable full type
>
> ```ts theme={null}
> {
> }[] | null
> ```

> [accordion] permits full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

### fetch

`locations.fetch`

Fetch free public, source-cited fields (flood, fire, terrain, power, broadband…) for a US address or coordinate. Check partial\_failures and each field status.

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.locations.fetch({
	lat: 37.6342,
	lng: -122.4216,
	fields: ['nfhl_flood_zone'],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `address` | `string \| null` | No | — |
| `lat` | `number \| null` | No | — |
| `lng` | `number \| null` | No | — |
| `fields` | `string[] \| null` | No | Field names from fields.list. Mireye enforces its own limit. |
| `preset` | `string \| null` | No | Get preset names from fields.list. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `lat` | `number` | Yes | — |
| `lng` | `number` | Yes | — |
| `fields` | `object` | Yes | — |
| `partial_failures` | `JsonValue[]` | Yes | — |
| `geocode` | `object \| null` | No | — |
| `resolved_location` | `object \| null` | No | — |

> [accordion] fields full type
>
> ```ts theme={null}
> Record<string, {
>   value: JsonValue,
>   source?: string | null,
>   source_url?: string | null,
>   fetched_at?: string | null,
>   status?: string
> }>
> ```

> [accordion] geocode full type
>
> ```ts theme={null}
> {
>   accuracy?: number | null,
>   accuracy_type?: string | null,
>   match_type?: string | null,
>   normalized_address?: string | null,
>   provider?: string | null,
>   source?: string | null,
>   parcel_grade?: boolean,
>   precision_note?: string | null
> } | null
> ```

> [accordion] resolved\_location full type
>
> ```ts theme={null}
> {
>   lat: number,
>   lng: number,
>   source: address | coordinate
> } | null
> ```

***

### fetchBatch

`locations.fetchBatch`

Fetch the same free public fields for up to 25 locations in one request. Check each result for ok and partial\_failures.

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.locations.fetchBatch({
	body: {
		locations: [{ lat: 29.3, lng: -94.8 }],
		fields: ['elevation'],
	},
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `body` | `object` | Yes | — |
| `idempotencyKey` | `string \| null` | No | — |

> [accordion] body full type
>
> ```ts theme={null}
> {
>   fields?: string[] | null,
>   preset?: terrain | flood_risk | wildfire_underwrite | land_cover | site_selection | building_lookup | points_of_interest | utilities | boundaries | solar_siting | wind_siting | storage_siting | data_center_siting | grid_interconnect | natural_hazard | null,
>   locations: {
>     lat?: number | null,
>     lng?: number | null,
>     address?: string | null
>   }[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `fetched_at` | `string \| null` | No | — |
| `results` | `object[]` | Yes | — |
| `replayed` | `boolean` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> (
>   {
>     lat: number,
>     lng: number,
>     fields: Record<string, {
>       value: JsonValue,
>       source?: string | null,
>       source_url?: string | null,
>       fetched_at?: string | null,
>       status?: string
>     }>,
>     partial_failures: JsonValue[],
>     geocode?: {
>       accuracy?: number | null,
>       accuracy_type?: string | null,
>       match_type?: string | null,
>       normalized_address?: string | null,
>       provider?: string | null,
>       source?: string | null,
>       parcel_grade?: boolean,
>       precision_note?: string | null
>     } | null,
>     resolved_location?: {
>       lat: number,
>       lng: number,
>       source: address | coordinate
>     } | null,
>     index?: number | null,
>     ok: true
>   } | {
>     index?: number | null,
>     ok: false,
>     error: JsonValue
>   }
> )[]
> ```

***

### geocode

`locations.geocode`

Resolve a US street address to a coordinate, with its match accuracy (free). A coordinate is not parcel identity: use locations.enrich for that.

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.locations.geocode({ address: '1 Market St, San Francisco, CA' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `address` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `accuracy` | `number \| null` | No | — |
| `accuracy_type` | `string \| null` | No | — |
| `match_type` | `string \| null` | No | — |
| `normalized_address` | `string \| null` | No | — |
| `provider` | `string \| null` | No | — |
| `source` | `string \| null` | No | — |
| `parcel_grade` | `boolean` | No | — |
| `precision_note` | `string \| null` | No | — |
| `lat` | `number` | Yes | — |
| `lng` | `number` | Yes | — |

***

### proximity

`locations.proximity`

Distance, nearest, screen and labor-shed calculations. Straight-line work and labor estimates are free; driving work is charged from the Mireye balance ($0.004 per calculation, $0.02 per nearest result on Free); max\_cost\_usd caps it.

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.locations.proximity({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `body` | `object` | Yes | — |
| `idempotencyKey` | `string` | No | Stable key for this paid request; a retry with the same key is not charged again. |

> [accordion] body full type
>
> ```ts theme={null}
> {
>   op: distance,
>   origins: string[],
>   destinations: string[],
>   mode?: driving | straightline,
>   units?: miles | km,
>   max_cost_usd?: string | null
> } | {
>   op: nearest,
>   origin: string,
>   set: string,
>   n?: number,
>   filters?: Record<string, number | string | string[]> | null,
>   mode?: driving | straightline,
>   max_cost_usd?: string | null,
>   radius_m?: number | null,
>   return?: candidates | count
> } | {
>   op: screen,
>   origins: string[],
>   anchors: string[],
>   max_minutes: number,
>   min_minutes?: number | null,
>   max_cost_usd?: string | null
> } | {
>   op: labor_shed,
>   origin: string,
>   minutes: number,
>   max_cost_usd?: string | null,
>   estimate?: boolean,
>   include?: demographics[]
> }
> ```

**Output:** `JsonValue`

***

## Meta

### plans

`meta.plans`

Mireye's public price list and allowance rules, to see what a call costs before making it.

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.meta.plans({});
```

**Input:** *empty object*

**Output:** *empty object*

***

## Operations

### get

`operations.get`

Read a paid operation by the operation\_id from a billing receipt or an error, to recover a lost response without paying twice.

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.operations.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `operationId` | `string` | Yes | — |

**Output:** *empty object*

***

## Parcels

### search

`parcels.search`

Find parcels in one state that match all filters, with the output fields you choose. One charge per page from the Mireye balance (\$0.20 on Free), even for an empty page; follow next\_cursor for more.

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.parcels.search({
	body: {
		filters: [{ field: 'state2', op: 'eq', value: 'TX' }],
		limit: 10,
		max_cost_usd: '0.20',
	},
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `body` | `object` | Yes | — |
| `idempotencyKey` | `string \| null` | No | — |

> [accordion] body full type
>
> ```ts theme={null}
> {
>   max_cost_usd?: string | null,
>   filters: {
>     field: string,
>     op: eq | ne | lt | lte | gt | gte | in | between | intersects | within | match,
>     value: JsonValue
>   }[],
>   limit?: number,
>   cursor?: string | null,
>   fields?: string[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `billing` | `object \| null` | No | — |
| `matches` | `object[]` | Yes | — |
| `next_cursor` | `string \| null` | No | — |
| `remarks` | `object[]` | Yes | — |
| `request_id` | `string \| null` | No | — |

> [accordion] billing full type
>
> ```ts theme={null}
> {
>   operation_id?: string | null,
>   currency?: string | null,
>   charged_usd?: string | null,
>   pricing_version?: string | null,
>   replayed?: boolean | null
> } | null
> ```

> [accordion] matches full type
>
> ```ts theme={null}
> {
>   parcelnumb?: string | null,
>   address?: string | null,
>   state2?: string | null,
>   county?: string | null,
>   scity?: string | null,
>   szip5?: string | null,
>   source?: string | null,
>   pvd_gisacre?: number | null,
>   analysis_point: {
>     lat?: number | null,
>     lng?: number | null,
>     method?: string | null
>   },
>   fields: Record<string, JsonValue>
> }[]
> ```

> [accordion] remarks full type
>
> ```ts theme={null}
> {
>   code?: string | null,
>   message?: string | null,
>   path?: string,
>   hint?: string,
>   candidates?: number,
>   matches?: number
> }[]
> ```

***

## Permits

### byParcel

`permits.byParcel`

One row per parcel with permits in a county or a list of parcel ids, with counts, latest date and tags. Each row returned is charged as one permit row (\$0.012 on Free); limit 0 counts for free.

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.permits.byParcel({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `body` | `object` | Yes | — |
| `idempotencyKey` | `string \| null` | No | — |

> [accordion] body full type
>
> ```ts theme={null}
> {
>   where: {
>     county?: string | null,
>     state?: string | null,
>     county_fips?: string | null,
>     parcels?: string[] | null
>   },
>   filters?: {
>     date_field?: filed | issued | finaled | earliest,
>     date_from?: string | null,
>     date_to?: string | null,
>     status?: string[] | null,
>     category?: string[] | null,
>     work_tags?: string[] | null,
>     tags_match?: any | all,
>     include_reissued?: boolean,
>     min_date_precision?: day | month | year | null
>   },
>   with?: {
>     work_tags?: string[] | null,
>     category?: string[] | null,
>     since?: string | null
>   } | null,
>   sort?: permit_count_desc | latest_date_desc,
>   limit?: number,
>   cursor?: string | null,
>   max_cost_usd?: string | number | null
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `rows` | `object[] \| null` | No | One row per parcel. |
| `total_parcels` | `number \| null` | No | — |
| `coverage` | `string \| null` | No | — |
| `note` | `string \| null` | No | — |
| `next_cursor` | `string \| null` | No | — |
| `billing` | `object \| null` | No | — |

> [accordion] rows full type
>
> ```ts theme={null}
> {
>   parcel_id?: string | null,
>   permit_address?: string | null,
>   permit_count?: number | null,
>   latest_date?: string | null,
>   open_permits?: number | null,
>   tags?: Record<string, {
>     count?: number | null,
>     latest_date?: string | null
>   }> | null,
>   coverage?: string | null
> }[] | null
> ```

> [accordion] billing full type
>
> ```ts theme={null}
> {
>   operation_id?: string | null,
>   currency?: string | null,
>   charged_usd?: string | null,
>   pricing_version?: string | null,
>   replayed?: boolean | null
> } | null
> ```

***

### coverage

`permits.coverage`

List which permit offices in one state are collected and how complete each is (free).

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.permits.coverage({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `state` | `string` | Yes | — |
| `countyFips` | `string \| null` | No | — |
| `authorityId` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |

**Output:** `JsonValue`

***

### lookup

`permits.lookup`

Look up building permits by id. Charged per permit found from the Mireye balance (\$0.012 on Free).

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.permits.lookup({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string \| null` | No | — |
| `id` | `string[]` | Yes | — |
| `maxCostUsd` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `permits` | `object[] \| null` | No | — |
| `total` | `number \| null` | No | — |
| `next_cursor` | `string \| null` | No | — |
| `coverage` | `JsonValue` | No | — |
| `note` | `string \| null` | No | — |
| `billing` | `object \| null` | No | — |

> [accordion] permits full type
>
> ```ts theme={null}
> {
> }[] | null
> ```

> [accordion] billing full type
>
> ```ts theme={null}
> {
>   operation_id?: string | null,
>   currency?: string | null,
>   charged_usd?: string | null,
>   pricing_version?: string | null,
>   replayed?: boolean | null
> } | null
> ```

***

### search

`permits.search`

Search US building permits by place and filters. Charged per permit returned (\$0.012 on Free); limit 0 counts for free.

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.permits.search({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `body` | `object` | Yes | — |
| `idempotencyKey` | `string \| null` | No | — |

> [accordion] body full type
>
> ```ts theme={null}
> {
>   where: {
>     county?: string | null,
>     authority_id?: string | null,
>     state?: string | null,
>     city?: string | null,
>     county_fips?: string | null,
>     lat?: number | null,
>     lng?: number | null,
>     radius_m?: number | null,
>     geojson?: {
>     } | null,
>     parcel?: {
>       address?: string | null,
>       lat?: number | null,
>       lng?: number | null,
>       parcel_id?: string | null
>     } | null,
>     zip?: string | null,
>     parcels?: {
>       address?: string | null,
>       lat?: number | null,
>       lng?: number | null,
>       parcel_id?: string | null
>     }[] | null
>   },
>   filters?: {
>     date_field?: filed | issued | finaled | earliest,
>     date_from?: string | null,
>     date_to?: string | null,
>     earliest_from?: string | null,
>     latest_to?: string | null,
>     issued_since?: string | null,
>     updated_since?: string | null,
>     status?: string[] | null,
>     category?: string[] | null,
>     use_class?: string[] | null,
>     work_tags?: string[] | null,
>     detail_tags?: string[] | null,
>     tags_match?: any | all,
>     valuation_min_usd?: number | null,
>     valuation_max_usd?: number | null,
>     exclude_flagged_valuation?: boolean,
>     contractor?: string | null,
>     contractor_id?: string | null,
>     include_undated?: boolean,
>     include_reissued?: boolean,
>     min_date_precision?: day | month | year | null
>   },
>   sort?: date_desc | date_asc | valuation_desc | distance,
>   limit?: number,
>   cursor?: string | null,
>   max_cost_usd?: string | number | null,
>   limit_per_parcel?: number | null
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `permits` | `object[] \| null` | No | — |
| `total` | `number \| null` | No | — |
| `next_cursor` | `string \| null` | No | — |
| `coverage` | `JsonValue` | No | — |
| `note` | `string \| null` | No | — |
| `billing` | `object \| null` | No | — |

> [accordion] permits full type
>
> ```ts theme={null}
> {
> }[] | null
> ```

> [accordion] billing full type
>
> ```ts theme={null}
> {
>   operation_id?: string | null,
>   currency?: string | null,
>   charged_usd?: string | null,
>   pricing_version?: string | null,
>   replayed?: boolean | null
> } | null
> ```

***

### stats

`permits.stats`

Count permits in one area grouped by month, work tag, category or office, with valuation and time-to-issue measures. Each group returned is charged as one permit row (\$0.012 on Free); limit 0 counts for free. Set max\_cost\_usd to cap it.

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.permits.stats({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `body` | `object` | Yes | — |
| `idempotencyKey` | `string \| null` | No | — |

> [accordion] body full type
>
> ```ts theme={null}
> {
>   where: {
>     county?: string | null,
>     authority_id?: string | null,
>     state?: string | null,
>     city?: string | null,
>     county_fips?: string | null,
>     lat?: number | null,
>     lng?: number | null,
>     radius_m?: number | null,
>     geojson?: {
>     } | null,
>     parcel?: {
>       address?: string | null,
>       lat?: number | null,
>       lng?: number | null,
>       parcel_id?: string | null
>     } | null,
>     zip?: string | null
>   },
>   filters?: {
>     date_field?: filed | issued | finaled | earliest,
>     date_from?: string | null,
>     date_to?: string | null,
>     earliest_from?: string | null,
>     latest_to?: string | null,
>     issued_since?: string | null,
>     updated_since?: string | null,
>     status?: string[] | null,
>     category?: string[] | null,
>     use_class?: string[] | null,
>     work_tags?: string[] | null,
>     detail_tags?: string[] | null,
>     tags_match?: any | all,
>     valuation_min_usd?: number | null,
>     valuation_max_usd?: number | null,
>     exclude_flagged_valuation?: boolean,
>     contractor?: string | null,
>     contractor_id?: string | null,
>     include_undated?: boolean,
>     include_reissued?: boolean,
>     min_date_precision?: day | month | year | null
>   },
>   group_by: string,
>   measures?: string[],
>   limit?: number,
>   max_cost_usd?: string | number | null
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `groups` | `object[] \| null` | No | — |
| `billing` | `object \| null` | No | — |

> [accordion] groups full type
>
> ```ts theme={null}
> {
> }[] | null
> ```

> [accordion] billing full type
>
> ```ts theme={null}
> {
>   operation_id?: string | null,
>   currency?: string | null,
>   charged_usd?: string | null,
>   pricing_version?: string | null,
>   replayed?: boolean | null
> } | null
> ```

***

### vocabulary

`permits.vocabulary`

List the values every permit filter accepts (free).

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.permits.vocabulary({});
```

**Input:** *empty object*

**Output:** `JsonValue`

***

## Runs

### downloadArtifact

`runs.downloadArtifact`

Download a finished run as CSV text or a GeoJSON FeatureCollection (free).

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.runs.downloadArtifact({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `runId` | `string` | Yes | — |
| `format` | `csv \| geojson` | Yes | csv: one row per location. geojson: a FeatureCollection with one Point per location. |

**Output:** `string \| JsonValue`

***

### get

`runs.get`

Poll a run: status, progress and, once done, the result. Runs expire after 30 days.

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.runs.get({ runId: 'run_example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `runId` | `string` | Yes | — |

**Output:** `JsonValue`

***

### submit

`runs.submit`

Submit a fetch\_batch job and get a run\_id at once; poll it with runs.get. Fetch is free.

**Risk:** `write`

```ts theme={null}
await corsair.mireye.api.runs.submit({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `body` | `object` | Yes | — |

> [accordion] body full type
>
> ```ts theme={null}
> {
>   kind: fetch_batch,
>   request: {
>     fields?: string[] | null,
>     preset?: terrain | flood_risk | wildfire_underwrite | land_cover | site_selection | building_lookup | points_of_interest | utilities | boundaries | solar_siting | wind_siting | storage_siting | data_center_siting | grid_interconnect | natural_hazard | null,
>     locations: {
>       lat?: number | null,
>       lng?: number | null,
>       address?: string | null
>     }[]
>   }
> }
> ```

**Output:** `JsonValue`

***

## Wallet

### get

`wallet.get`

Get the Mireye balance: plan, available and reserved dollars.

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.wallet.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `active_plan` | `string \| null` | No | — |
| `available_usd` | `string \| null` | No | — |
| `reserved_usd` | `string \| null` | No | — |

***

### getControls

`wallet.getControls`

Get the spending controls: paused, monthly limit and what this period has used.

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.wallet.getControls({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `paused` | `boolean \| null` | No | — |
| `monthly_limit_usd` | `string \| null` | No | — |
| `consumed_usd` | `string \| null` | No | — |

***

### listOperations

`wallet.listOperations`

List paid operations with what each charged, newest first.

**Risk:** `read`

```ts theme={null}
await corsair.mireye.api.wallet.listOperations({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | Rows per page, 1-100 (default 25). |
| `cursor` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `operations` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null` | No | — |
| `pending_usd` | `string \| null` | No | — |

> [accordion] operations full type
>
> ```ts theme={null}
> {
> }[] | null
> ```

***


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