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

# Query parcels

## Request format

Pass a `filters` array where each item specifies a `field`, an `op` (operator), and a `value`. All filters are AND'd together.

```json theme={null}
{
  "filters": [
    { "field": "owner", "op": "ilike", "value": "SMITH" },
    { "field": "state", "op": "eq", "value": "CA" }
  ],
  "limit": 20,
  "offset": 0
}
```

Use an array value for `in`, `nin`, and `between`:

```json theme={null}
{
  "filters": [
    { "field": "state", "op": "in", "value": ["CA", "OR", "WA"] },
    { "field": "acres", "op": "between", "value": [500, 10000] }
  ]
}
```

## Queryable fields

### Text search fields: `ilike`, `eq`, `ne`, `in`, `nin`, `isnull`

`ilike` performs a case-insensitive substring match.

| Field                   | Description                                         |
| ----------------------- | --------------------------------------------------- |
| `owner`                 | Owner name                                          |
| `parcel_id`             | County assessor parcel ID (APN)                     |
| `situs`                 | Property address                                    |
| `mail_addr`             | Owner mailing address                               |
| `city`                  | City                                                |
| `land_use`              | Land use classification                             |
| `land_use_code`         | Land use code                                       |
| `legal`                 | Legal description                                   |
| `cdl_majority_category` | USDA crop/land cover type (e.g. `Corn`, `Soybeans`) |

<Warning>
  Queries on `owner`, `parcel_id`, `situs`, or `mail_addr` require a geographic scope. Include a `state_fp`, `state`, or `county_fp` filter.
</Warning>

### Numeric fields: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `between`, `in`, `nin`, `isnull`

| Field                        | Description                                  |
| ---------------------------- | -------------------------------------------- |
| `acres`                      | Parcel area (county-reported)                |
| `acres_calc`                 | Parcel area (calculated from geometry)       |
| `parcel_value`               | Total assessed value (USD)                   |
| `land_value`                 | Land assessed value (USD)                    |
| `improvements_value`         | Improvements assessed value (USD)            |
| `agricultural_value`         | Agricultural assessed value (USD)            |
| `building_value`             | Building assessed value (USD)                |
| `sale_price`                 | Most recent sale price (USD)                 |
| `tax_amount`                 | Annual property tax (USD)                    |
| `elevation`                  | Centroid elevation (meters)                  |
| `adjacent_acreage_sameowner` | Contiguous acreage under same ownership      |
| `cdl_majority_value`         | Numeric CDL category code                    |
| `cdl_majority_percent`       | % of parcel covered by majority CDL category |
| `sq_feet`                    | Parcel area in square feet                   |

### ID and categorical fields: `eq`, `ne`, `in`, `nin`, `isnull`

| Field            | Description                                                   |
| ---------------- | ------------------------------------------------------------- |
| `state_fp`       | State FIPS code (e.g. `"19"` for Iowa)                        |
| `state`          | Two-letter state abbreviation (e.g. `"IA"`)                   |
| `county_fp`      | County FIPS code                                              |
| `county`         | County name                                                   |
| `postal`         | ZIP code                                                      |
| `zoning`         | Zoning code                                                   |
| `owner_type`     | Owner type                                                    |
| `sale_date`      | Sale date string                                              |
| `bpd_uuid`       | BPD UUID; use `in` to batch-fetch records from an area search |
| `bpd_stack_uuid` | Stack UUID for grouped same-location parcels                  |

## Operators

| Operator     | Description                      | Value type                          |
| ------------ | -------------------------------- | ----------------------------------- |
| `eq`         | Equals                           | string or number                    |
| `ne`         | Not equals                       | string or number                    |
| `gt` / `gte` | Greater than (or equal)          | number                              |
| `lt` / `lte` | Less than (or equal)             | number                              |
| `between`    | Inclusive range                  | 2-element array: `[min, max]`       |
| `in`         | In set                           | array of strings or numbers         |
| `nin`        | Not in set                       | array of strings or numbers         |
| `ilike`      | Case-insensitive substring match | string                              |
| `isnull`     | Is null / is not null            | `true` (null) or `false` (not null) |

## Sorting

Pass an optional `order` object with a `field` and `direction`:

```json theme={null}
{
  "filters": [{ "field": "state_fp", "op": "eq", "value": "19" }],
  "order": { "field": "acres", "direction": "desc" }
}
```

## Pagination

Use `limit` (max 100, default 20) and `offset` to page through results.

```json theme={null}
{
  "filters": [
    { "field": "state_fp", "op": "eq", "value": "19" },
    { "field": "acres", "op": "gte", "value": 100 }
  ],
  "limit": 100,
  "offset": 200
}
```

## Building footprints

Set `include_buildings: true` to include ORNL building footprint data for each parcel. When enabled, each parcel in the response will contain a `buildings` array with the physical structures on that parcel.

```json theme={null}
{
  "filters": [{ "field": "state_fp", "op": "eq", "value": "06" }],
  "include_buildings": true
}
```

Each building includes geometry (`geom`), dimensions (`sq_feet`, `sq_meters`, `height`), occupancy classification, and address fields. The `buildings` key is omitted entirely when `include_buildings` is `false` (the default).


## OpenAPI

````yaml api-reference/openapi.json POST /parcels/query
openapi: 3.1.0
info:
  title: BuyParcelData API
  description: Access nationwide parcel data by geographic polygon, point, or address.
  version: 1.0.0
servers:
  - url: https://api.buyparceldata.com
    description: Production
security: []
paths:
  /parcels/query:
    post:
      tags:
        - parcels
      summary: Query Parcels Post
      operationId: query_parcels_post_parcels_query_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ParcelQueryRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ParcelQueryResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ParcelQueryRequest:
      properties:
        filters:
          items:
            $ref: '#/components/schemas/FilterItem'
          type: array
          maxItems: 10
          title: Filters
        order:
          anyOf:
            - $ref: '#/components/schemas/OrderItem'
            - type: 'null'
        limit:
          type: integer
          maximum: 100
          minimum: 1
          title: Limit
          default: 20
        offset:
          type: integer
          maximum: 10000
          minimum: 0
          title: Offset
          default: 0
        include_buildings:
          type: boolean
          title: Include Buildings
          default: false
      type: object
      required:
        - filters
      title: ParcelQueryRequest
    ParcelQueryResponse:
      properties:
        results:
          items:
            $ref: '#/components/schemas/ParcelView'
          type: array
          title: Results
        count:
          type: integer
          title: Count
        limit:
          type: integer
          title: Limit
        offset:
          type: integer
          title: Offset
      type: object
      required:
        - results
        - count
        - limit
        - offset
      title: ParcelQueryResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    FilterItem:
      properties:
        field:
          type: string
          title: Field
        op:
          type: string
          title: Op
        value:
          anyOf:
            - type: string
            - type: integer
            - type: number
            - type: boolean
            - items:
                anyOf:
                  - type: string
                  - type: integer
                  - type: number
              type: array
            - type: 'null'
          title: Value
      type: object
      required:
        - field
        - op
      title: FilterItem
    OrderItem:
      properties:
        field:
          type: string
          title: Field
        direction:
          type: string
          enum:
            - asc
            - desc
          title: Direction
          default: asc
      type: object
      required:
        - field
      title: OrderItem
    ParcelView:
      additionalProperties: true
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````