# Lookup

> Documentation index: [llms.txt](https://westkite.com/docs/llms.txt). Every page is also at its URL plus `.md`.

Returns what is true at one place for each type you name: the zoning district and flood zone that cover it, the features of a map such as walkability, and the nearest feature of each infrastructure type. $0.001 per type that found something; a type that finds nothing is free.

```endpoint
GET /v1/lookup
```

## Parameters

Send exactly one place: `property_id`, `apn` with `county`, `address`, or `lat` and `lng`.

| Name | Type | Description |
|---|---|---|
| `property_id` | string | A property ID, `property:<uuid>`. |
| `apn` | string | A parcel number, with `county`. |
| `county` | string | The APN's county: a five-digit FIPS code or a name with its state, such as `Travis County, TX`. |
| `address` | string | A street address as free text. |
| `lat`, `lng` | number | A point in the United States, in decimal degrees. |
| `types` | string | Required. Comma-separated types and topics, such as `flood_zones,substations,walkability` or `power`. See [types](#types) and [topics](#topics). |
| `max_cost_usd` | number | Refuse the call if it could cost more. |

An address or APN that matches more than one parcel answers [`invalid_request`](https://westkite.com/docs/api/errors.md#invalid_request) with the matching parcels in `candidates`. Send one of their property IDs.

## Request

```curl
curl --get "https://api.westkite.com/v1/lookup" \
  -H "Authorization: Bearer $WESTKITE_API_KEY" \
  --data-urlencode "property_id=property:08cdd01c-64d6-8ed2-b7b8-8158ccadf8a0" \
  --data-urlencode "types=flood_zones,zoning_districts,substations,walkability,karst"
```

```typescript
const params = new URLSearchParams({
  property_id: "property:08cdd01c-64d6-8ed2-b7b8-8158ccadf8a0",
  types: "flood_zones,zoning_districts,substations,walkability,karst",
});
const res = await fetch(`https://api.westkite.com/v1/lookup?${params}`, {
  headers: { Authorization: `Bearer ${process.env.WESTKITE_API_KEY}` },
});
const { data, missing } = await res.json();
```

```python
import os, requests

res = requests.get(
    "https://api.westkite.com/v1/lookup",
    params={
        "property_id": "property:08cdd01c-64d6-8ed2-b7b8-8158ccadf8a0",
        "types": "flood_zones,zoning_districts,substations,walkability,karst",
    },
    headers={"Authorization": f"Bearer {os.environ['WESTKITE_API_KEY']}"},
)
body = res.json()
```

## Response

```json 200
{
  "data": {
    "resolved": {
      "property_id": "property:08cdd01c-64d6-8ed2-b7b8-8158ccadf8a0",
      "address": "550 MADISON AVENUE",
      "point": { "lat": 40.761467, "lng": -73.97351 },
      "exact": true
    },
    "results": {
      "flood_zones": {
        "kind": "screening",
        "findings": [
          { "id": "flood", "group": "Flood", "name": "Minimal flood risk", "value": "Zone X", "tone": "good", "source_id": "fema-flood" }
        ]
      },
      "zoning_districts": {
        "kind": "map",
        "district": {
          "code": "C5-3",
          "class": "commercial",
          "class_label": "Commercial",
          "jurisdiction": "New York",
          "source": { "id": "ZON-NY-004", "publisher": "NYC Dept of City Planning", "vintage": "2026-10-23" }
        },
        "note": "The district is read from the city or county's published zoning map at this point…"
      },
      "substations": {
        "kind": "infrastructure",
        "nearest": {
          "name": "IRT Substation #42",
          "detail": "New York City Transit Authority · Rail traction",
          "distance_m": 451,
          "distance_miles": 0.28,
          "direction": "E",
          "source": { "id": "osm-substations", "publisher": "OpenStreetMap contributors via Overture Maps" }
        }
      },
      "walkability": {
        "kind": "map",
        "radius_m": 0,
        "count": 1,
        "features": [
          { "distance_m": 0, "block_group": "360610102001", "walkability_index": 15.333333, "band": "Most walkable" }
        ],
        "source": { "id": "epa-walkability", "publisher": "EPA", "vintage": "Smart Location Database v3, 2019 block groups" }
      },
      "karst": {
        "kind": "map",
        "radius_m": 0,
        "count": 0,
        "features": [],
        "source": { "id": "usgs-karst", "publisher": "USGS", "vintage": "2014" }
      }
    },
    "types": ["flood_zones", "zoning_districts", "substations", "walkability", "karst"]
  },
  "missing": [{ "field": "karst.features", "reason": "not_found", "note": "None covers this point." }],
  "billing": { "operation_id": "op_c1d6…", "operation": "lookup", "charged_usd": 0.004, "balance_usd": 9.95 },
  "request_id": "req_c1d6…"
}
```

Some fields are shortened. Four types found something, so the call cost $0.004; `karst` found nothing and cost nothing.

| Field | Meaning |
|---|---|
| `resolved` | The place the results describe: `property_id` when a property matched, its `address`, the `point` read, and `exact`, `false` when an address matched only approximately. |
| `results` | One entry per type, keyed by type. A topic you asked for expands to its types here. |
| `results.<type>.kind` | `screening`, `map` or `infrastructure`. See [types](#types). |
| `findings` | Screening types: what the site screen found for this type at the place, each with a `name`, a `value`, a `tone` (`good`, `neutral` or `bad`) and its `source_id`. |
| `features` | Map types: the features that cover the point, each with the map's own fields, plus `count` and `radius_m`. Imagery-only maps, such as `night_lights`, have no values to read and come back in `missing` as `not_published`. |
| `district` | `zoning_districts`: the district's local `code` and `name`, a broad `class`, the `jurisdiction` and the map it came from. |
| `nearest` | Infrastructure types: the nearest feature, with `distance_m`, `distance_miles` and `direction`. For more than one, use [find](https://westkite.com/docs/api/find.md#map-and-infrastructure-types) with `near`. |
| `source` | The publisher and dataset the result came from. |
| `types` | Every type the call read, after topics expand. |
| `missing` | Each type that found nothing or could not be read, with its reason. These are free. |

## Types

Lookup answers every type that is not a record. [Records](https://westkite.com/docs/api/find.md#types-and-fields), such as properties, sales and permits, are listed with find. The [catalog](https://westkite.com/docs/api/catalog.md) has each type's fields and source.

| Kind | What lookup returns | Types |
|---|---|---|
| Infrastructure | The nearest feature | `substations`, `transmission_lines`, `power_plants`, `electric_utilities`, `power_capacity`, `interconnection_queues`, `gas_pipelines`, `gas_utilities`, `water_systems`, `sewer_service`, `wastewater_plants`, `local_roads`, `highways`, `interstates`, `highway_ramps`, `truck_routes`, `rail_lines`, `rail_sidings`, `rail_crossings`, `intermodal_terminals`, `airports`, `ports`, `obstructions`, `elevation`, `brands` |
| Map | What covers the point, or its value there | `dams`, `lomr`, `loma`, `drought`, `hail`, `hail_swaths`, `disaster_declarations`, `flood_claims`, `nonattainment`, `air_monitors`, `energy_community`, `foreign_trade_zones`, `ftz_sites`, `critical_habitat`, `airspace`, `uas_grid`, `karst`, `radon`, `airport_noise`, `dot_projects`, `planned_transit`, `pipeline_miles`, `walkability`, `climate`, `business_formation`, `power_outages`, `cables_telegeography`, `cables_noaa`, `shale_plays`, `water_stress`, `broadband_fiber`, `mobile_5g`, `seismic`, `landslide`, `tree_canopy`, `cropland`, `greenness`, `night_lights`, `solar_resource`, `noise`, `noise_aviation`, `noise_road`, `noise_rail`, `utility_rates`, `zoning_districts` |
| Screening | What covers the point, as the site report reads it | `flood_zones`, `opportunity_zones`, `nmtc_tracts`, `lihtc_tracts`, `hubzones`, `enterprise_zones`, `wetlands`, `protected_land`, `soils`, `slope`, `wildfire`, `natural_hazard_risk`, `sea_level_rise`, `contaminated_sites` |

What each map type shows, with pictures, is on [Map layers](https://westkite.com/docs/api/layers.md). Screening types are read only at a point, with lookup or in the [site report](https://westkite.com/docs/api/reports.md#site-report).

## Topics

A topic in `types` expands to its types, and each type answered is charged.

| Topic | Expands to |
|---|---|
| `power`, `transport`, `utilities` | The infrastructure types of that domain |
| `infrastructure` | All three: power, transport and utilities |
| `hazards`, `environmental`, `incentives`, `buildability`, `location` | The types the [site report](https://westkite.com/docs/api/reports.md#site-report) reads for that topic |

`GET /v1/catalog?topic=power` lists a topic's types.

## Zoning districts

`zoning_districts` is the district on West Kite's national zoning map at the point, read from the city or county's published zoning map.

| Field | Meaning |
|---|---|
| `code` | The zone code as the city or county publishes it, such as `M1-2` or `I-1` |
| `name` | The district's local name or description, when the map gives one |
| `class` | A broad class read from the local name and code: `residential`, `multifamily`, `commercial`, `office`, `mixed`, `industrial`, `agricultural`, `open`, `public`, `planned` or `other` |
| `jurisdiction` | The city, town, township or county whose zoning this is |
| `source` | The published zoning map the district comes from, with its publisher, link and vintage |

The zoning map holds over 5,000 cities and counties. In a city, the city's own map is used; in unincorporated land, the county's. Where no map covers the place, `missing` lists `zoning_districts.district` as `not_covered`, and the type costs nothing. A property's zoning code from the assessor roll is in the [property record's](https://westkite.com/docs/api/properties.md#zoning) `zoning` part.

## Missing and unknown

- **None found.** A type that finds nothing at the place is in `missing` as `not_found` and costs nothing.
- **Partial coverage.** A type that covers less than the country answers `not_covered` outside its coverage, because none there may mean no data.
- **Unknown is not none.** When a publisher doesn't answer, `missing` says `temporarily_unavailable`. Ask again shortly.

## Errors

| Code | When |
|---|---|
| [`invalid_request`](https://westkite.com/docs/api/errors.md#invalid_request) | No place or more than one, an unknown type or topic, no `types`, a point outside the United States, or an address or APN that matches several parcels (the message lists `candidates`). |
| [`not_found`](https://westkite.com/docs/api/errors.md#not_found) | No published property has that ID. |
| [`max_cost_too_low`](https://westkite.com/docs/api/errors.md#max_cost_too_low) | Every type answering would cost more than your `max_cost_usd`. |
| [`insufficient_balance`](https://westkite.com/docs/api/errors.md#insufficient_balance) | Your balance can't cover the types asked for. |
