# Look up a parcel by address

> Turn a U.S. street address into an assessor parcel number, county acreage, and parcel floodplain overlap when the sources support them.

Source: https://docs.invariant-ai.com/lookup-parcel-by-address

To find an assessor parcel number (APN) from a U.S. street address, resolve the address to a coordinate with [Geocode](https://docs.invariant-ai.com/api/geocode), then use [Enrich](https://docs.invariant-ai.com/api/enrich) to find the parcel containing that point. Read `parcel_match.parcel.apn` after confirming the match. Keep the parcel source and jurisdiction with the number, since counties assign and format APNs locally.

## Check the address match

Send the house number, street, city, state, and ZIP. Compare `normalized_address` with the property you intend to check, especially if the matched street direction or ZIP changed. A `rooftop` result uses a published address point or a centroid of matching address points. Check `match_type` to see which. A `range_interpolation` result estimates the location along a street. Use a verified coordinate or county parcel record when that estimate could fall on the wrong parcel.

## Run the lookup

Use Python 3 and set `INVARIANT_API_KEY` to a [key from the docs](https://docs.invariant-ai.com/get-api-key). Save the code as `lookup-parcel.py`. The example takes an address as its argument and asks you to compare the geocoded address before reading the parcel record.

```python
import json
import os
import sys
from urllib.request import Request, urlopen

def post(path, payload, timeout):
    request = Request(
        "https://api.invariant-ai.com" + path,
        data=json.dumps(payload).encode("utf-8"),
        headers={
            "X-API-Key": os.environ["INVARIANT_API_KEY"],
            "Content-Type": "application/json",
        },
        method="POST",
    )
    with urlopen(request, timeout=timeout) as response:
        return json.load(response)

if len(sys.argv) != 2:
    raise SystemExit('Usage: python3 lookup-parcel.py "full street address"')

geocode = post("/v1/geocode", {"address": sys.argv[1]}, timeout=20)
if geocode["accuracy_type"] != "rooftop":
    raise SystemExit("Verify the address point before looking up a parcel.")
print("Matched address:", geocode["normalized_address"])
print("Address source:", geocode["source"], f"({geocode['match_type']})")
if input("Is this the property you intended? [y/N] ").strip().lower() != "y":
    raise SystemExit("Check the address and rerun the lookup.")

result = post(
    "/v1/enrich",
    {
        "lat": geocode["lat"],
        "lng": geocode["lng"],
        "fields": ["gisacre", "parcel_flood_sfha_fraction"],
    },
    timeout=60,
)
match = result["parcel_match"]
print(json.dumps({
    "parcel_match": match,
    "fields": result["fields"],
    "field_omissions": result["field_omissions"],
}, indent=2))
if match["status"] != "matched":
    raise SystemExit("No confirmed parcel match. Review the status and reason above.")
```

Try the workflow with the address of the San Francisco Main Library.

```bash
python3 lookup-parcel.py "100 Larkin St, San Francisco, CA 94102"
```

## Read the result

| Response | How to use it |
| --- | --- |
| `parcel_match.parcel.apn` | Assessor parcel number as published. Preserve formatting and leading zeros. Use the county record when a filing, deed or legal description needs to be checked. |
| `parcel_match.parcel.parcel_id` | The parcel source's identifier. Use it with the source to join repeated responses. |
| `fields.gisacre` | County acreage as reported, which may differ from the area computed from the mapped boundary. |
| `fields.parcel_flood_sfha_fraction` | The share of the parcel inside FEMA's mapped Special Flood Hazard Area, from 0 to 1. For example, `0.25` means 25% of the parcel. Use the building footprint separately for a building-level question. |
| `field_omissions` | Why a field is missing, including source coverage, access and failed calculations. A missing flood value stays missing. |

A `no_match` response means the lookup found no containing parcel. Nearby candidates help you review the address or geometry. An `unavailable` response means the parcel source was unavailable or restricted. For condos or properties spanning several lots, confirm all relevant APNs in the local assessor's records. A point lookup returns the parcel containing the point and does not establish title or resolve the entire property assembly.

Save the address source, match information, and the returned fields with their `source_url`, `fetched_at`, and `dataset_vintage`. Coverage varies by source and [by the key's access](https://docs.invariant-ai.com/pricing). For fields measured at the coordinate, use [Fetch](https://docs.invariant-ai.com/api/fetch).

## Next

- [Find all parcels intersecting a search polygon, then enrich each matched site](https://docs.invariant-ai.com/find-parcels-intersecting-a-polygon).
- [Browse parcel enrichment fields and presets](https://docs.invariant-ai.com/api/enrich-fields).
- [Trace an old parcel number through a split or merger](https://docs.invariant-ai.com/trace-parcel-boundary-history).
- [Verify a named building before using footprint and assessor attributes](https://docs.invariant-ai.com/verify-building-by-address).
- [Check the FEMA flood zone at an address and on its parcel](https://docs.invariant-ai.com/check-flood-zone-by-address).
- [Screen the same site for utilities, wetlands, and terrain](https://docs.invariant-ai.com/screen-a-site).
- [See how two San Francisco addresses matched to city hazard maps](https://invariant-ai.com/blog/earthquake-risk-by-address-for-underwriting).
