# Reports

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

Returns a report about one place. The site report screens it for environmental, hazard, incentive, buildability and location issues, with a tone per topic. The demographics report gives population, income, jobs, housing and home lending for a ring around it or for a named area. Each report is $0.05.

```endpoint
GET /v1/reports/site
GET /v1/reports/demographics
```

## Parameters

Both reports take exactly one place: `property_id`, `apn` with `county`, `address`, or `lat` and `lng`. The demographics report also takes `in` for a named area instead.

| 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. |
| `radius_mi` | number | Demographics only: the ring's radius in miles. Or send `radius_m` in meters. |
| `in` | string | Demographics only: a named area, such as `Travis County, TX`, or an area `id` from an earlier answer, instead of a place and a ring. |
| `max_cost_usd` | number | Refuse the call if it costs 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`.

## Site report

A screen of one parcel, measured over its outline where one is published, from federal and state public sources. $0.05 per report.

```curl
curl --get "https://api.westkite.com/v1/reports/site" \
  -H "Authorization: Bearer $WESTKITE_API_KEY" \
  --data-urlencode "property_id=property:08cdd01c-64d6-8ed2-b7b8-8158ccadf8a0"
```

```typescript
const params = new URLSearchParams({ property_id: "property:08cdd01c-64d6-8ed2-b7b8-8158ccadf8a0" });
const res = await fetch(`https://api.westkite.com/v1/reports/site?${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/reports/site",
    params={"property_id": "property:08cdd01c-64d6-8ed2-b7b8-8158ccadf8a0"},
    headers={"Authorization": f"Bearer {os.environ['WESTKITE_API_KEY']}"},
)
body = res.json()
```

```json 200
{
  "data": {
    "resolved": {
      "property_id": "property:08cdd01c-64d6-8ed2-b7b8-8158ccadf8a0",
      "address": "550 Madison Ave, New York, NY 10022",
      "point": { "lat": 40.7614, "lng": -73.9734 },
      "exact": true
    },
    "screened_parcel": true,
    "hazards": {
      "answer": "Outside the 100-year floodplain",
      "tone": "good",
      "note": null,
      "findings": [{ "group": "Flood", "name": "FEMA flood zone", "value": "Zone X", "detail": null, "tone": "good", "sourceId": "fema-flood" }]
    },
    "environmental": { "answer": "…", "tone": "watch", "findings": [] },
    "incentives": { "answer": "…", "tone": "neutral", "findings": [] },
    "buildability": { "answer": "…", "tone": "good", "findings": [] },
    "location": { "answer": "…", "tone": "good", "findings": [] },
    "sources": [{ "id": "fema-flood", "label": "National Flood Hazard Layer", "publisher": "FEMA" }],
    "note": "A screen, not a Phase I: it reads federal and state public layers (state cleanup lists are not covered)."
  },
  "missing": [],
  "billing": { "operation_id": "op_91c2…", "operation": "site_report", "charged_usd": 0.05, "balance_usd": 9.87 },
  "request_id": "req_91c2…"
}
```

The example is illustrative and trimmed. Each topic has an `answer`, a `tone` (`good`, `neutral`, `watch` or `bad`) and its `findings`, each naming the source it came from.

| Topic | What it reads |
|---|---|
| `environmental` | Superfund, brownfields, leaking underground tanks, hazardous waste and chemical releases, within ASTM Phase I search distances; air quality nonattainment areas (EPA Green Book); and transportation noise |
| `hazards` | FEMA flood zone, the National Risk Index, wildfire hazard, sea level rise, the nearest high or significant hazard dams within 5 mi, a FEMA map revision (LOMR) in effect at the site, map amendments (LOMA) on or beside it, and the USGS seismic design category (ASCE 7-22, site class D); also drought, hail reports and radar-estimated maximum hail size, and the county's flood insurance claims and disaster declarations (this product uses OpenFEMA data but is not endorsed by FEMA) |
| `incentives` | Opportunity Zones from 2018 and 2027, New Markets Tax Credit tracts, LIHTC qualified tracts and difficult development areas, HUBZones, state enterprise zones, IRA energy communities, the nearest foreign trade zone and zone sites within 3 mi (placed by street address, so the position is approximate) |
| `buildability` | Soils, wetlands, protected land, critical habitat, karst, radon zone and slope; rail lines, gas pipelines and the county's pipeline miles; airport noise contours where published; controlled airspace over the site and the FAA drone ceiling; and jurisdiction: whether the site is on tribal land (a reservation, trust land, Hawaiian Home Land or joint-use area), and the nearest military installation within 2 miles, flagging a base on Treasury's list for CFIUS review of foreign real estate purchases |
| `location` | What the area around the site is like: walkability, tree canopy, climate normals and snow days, solar resource, shale plays, water stress, undersea cable landings, electric tariffs, fiber reported in the area, modelled 5G coverage, the county's power outages and new business applications, and state DOT projects and planned transit where published |

| Field | Meaning |
|---|---|
| `resolved` | The place screened: `property_id`, `address`, `point` and `exact`. |
| `screened_parcel` | `true` when the screen measured the parcel outline, `false` when it used a point. |
| `<topic>.answer`, `<topic>.tone` | The topic's result in one line, and how it reads for development. |
| `<topic>.findings` | What the result rests on: `group`, `name`, `value`, `tone` and `sourceId`. |
| `sources` | Every source the findings name. |

Each finding's type can be read on its own at a point with [lookup](https://westkite.com/docs/api/lookup.md), and map types can be drawn with [find](https://westkite.com/docs/api/find.md#map-and-infrastructure-types). The zoning district is the `zoning_districts` type of lookup, and published FAR and buildable area are in the property record's [zoning part](https://westkite.com/docs/api/properties.md#zoning).

A source that didn't answer comes back in `missing` as `temporarily_unavailable`: its results are unknown, not clear. Ask again shortly. A screen that answers nothing at all costs nothing. This is a screen, not a Phase I environmental site assessment. It reads federal and state public layers; state cleanup lists aren't covered.

## Demographics report

Population, households, income, jobs, housing and home lending for a ring around a place or for a named area, from the Census Bureau and other federal statistics. $0.05 per report.

```curl
curl --get "https://api.westkite.com/v1/reports/demographics" \
  -H "Authorization: Bearer $WESTKITE_API_KEY" \
  --data-urlencode "property_id=property:08cdd01c-64d6-8ed2-b7b8-8158ccadf8a0" \
  --data-urlencode "radius_mi=1"
```

```typescript
const params = new URLSearchParams({ property_id: "property:08cdd01c-64d6-8ed2-b7b8-8158ccadf8a0", radius_mi: "1" });
const res = await fetch(`https://api.westkite.com/v1/reports/demographics?${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/reports/demographics",
    params={"property_id": "property:08cdd01c-64d6-8ed2-b7b8-8158ccadf8a0", "radius_mi": 1},
    headers={"Authorization": f"Bearer {os.environ['WESTKITE_API_KEY']}"},
)
body = res.json()
```

For a named area instead of a ring, send `in`:

```text
GET /v1/reports/demographics?in=Travis County, TX
```

```json 200
{
  "data": {
    "resolved": {
      "property_id": "property:08cdd01c-64d6-8ed2-b7b8-8158ccadf8a0",
      "address": "550 Madison Ave, New York, NY 10022",
      "point": { "lat": 40.7614, "lng": -73.9734 },
      "exact": true
    },
    "area": { "id": "custom", "kind": "custom", "label": "Within 1 mile of 550 Madison Ave", "blockGroups": 118 },
    "radius_mi": 1,
    "acs": {
      "scope": { "kind": "area", "label": "Within 1 mile of 550 Madison Ave" },
      "latest": { "year": 2024, "population": 152300, "households": 88400, "medianHouseholdIncome": 141200, "medianGrossRent": 2890 }
    },
    "sources": [{ "id": "census-acs5", "label": "American Community Survey 5-year estimates", "publisher": "U.S. Census Bureau" }],
    "note": "Census ACS 5-year estimates, BLS jobs and wages, LODES workplace jobs and HMDA home-purchase loans, each with its own scope (the area, or the counties that stand in for it) and year. A missing section is unknown, not zero."
  },
  "missing": [],
  "billing": { "operation_id": "op_c3e0…", "operation": "demographics_report", "charged_usd": 0.05, "balance_usd": 9.82 },
  "request_id": "req_c3e0…"
}
```

The figures are illustrative, trimmed to a few fields. Each section names its `scope` and year. County-only sources describe a city, ZIP code or ring through the counties that stand in for it. A section that couldn't be filled is in `missing`, and an answer with no sections at all costs nothing.

| Section | Contains |
|---|---|
| `area` | The ring or area described: its `id`, `kind` and `label`. An area's `id` goes back in `in`. |
| `acs` | American Community Survey 5-year estimates: population, households, income, age, rent, home values, tenure and commuting, with a ten-year trend |
| `jobs`, `labor` | BLS jobs, industries and wages (QCEW), and unemployment (LAUS) |
| `workplace` | Jobs at workplaces in the area (LEHD LODES) |
| `homeBuying` | Home-purchase mortgages by year (HMDA) |
| `rents` | HUD Fair Market Rents by bedroom count, studio to four bedrooms. A ZIP code takes its Small Area FMR; a ring takes the Small Area FMR of the ZIP code at its centre; other areas take their county's, labelled as county context |
| `permits`, `homePrices`, `population`, `mortgage` | Census building permits, the FHFA house price index, population change and the 30-year mortgage rate |

## Errors

| Code | When |
|---|---|
| [`invalid_request`](https://westkite.com/docs/api/errors.md#invalid_request) | No place or more than one, both a place and `in`, an area name that doesn't resolve, 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) | You sent a `max_cost_usd` below $0.05. |
| [`insufficient_balance`](https://westkite.com/docs/api/errors.md#insufficient_balance) | Your balance can't cover $0.05. |
| [`service_unavailable`](https://westkite.com/docs/api/errors.md#service_unavailable) | A report's sources can't be read right now. Retry shortly. |
