# Kukun API Quickstart

import { PERMIT_COUNT_RECORD } from "../src/constant-variables";

The Kukun Permits API provides filtered search across
{PERMIT_COUNT_RECORD} canonical U.S. residential and commercial building permits from the last 20 years, across
5,600+ jurisdictions and linked to 135M+ U.S. properties. Records are normalized into the Kukun taxonomy,
enriched with sub-permit activity, and refreshed daily.

Our APIs are designed for teams building products and workflows in:

- Real Estate
- PropTech
- Construction Intelligence
- Home Improvement
- Insurance & Risk
- Lending & Underwriting

---

## Key Features

The API provides access to multiple core resources and services, including:

### Permits

{PERMIT_COUNT_RECORD} U.S. residential and commercial permits, normalized into the Kukun taxonomy and enriched with sub-permit signals. Surfaces approximately 40% more activity than raw municipal feeds — kitchen remodels filed as plumbing or electrical, additions buried inside structural permits, and similar hidden activity.

Features include:

- Filtering by status, label, dates, address, city, state, ZIP, county, jurisdiction, cost
- Keyword search on the permit description, e.g. `/v1/permits/search?zip-code=33565&keyword=water heater` (case-insensitive phrase match; also available on property search and area search)
- Geo-distance search within a radius (`distance`, in miles) of coordinates, a Kukun property, or a full address, e.g. `/v1/permits/search?kukun-id=113982207&distance=1&sort-by=distance`. Each permit includes `location.distance_miles` from that point, and `sort-by=distance` returns the nearest first
- Sorting and pagination
- Historical permit activity, refreshed daily

---

### Contractors

The Kukun contractor index, with each contractor's Kukun profile and a summary of its permit activity. Find contractors around a location or property, look them up by license or company, or see every contractor that filed a permit at a property.

Features include:

- Contractor search around coordinates, a Kukun property, or a full address within a radius (`distance`, in miles), nearest first, e.g. `/v1/contractors/search?kukun-id=113982207&distance=5`
- Lookup by license number, company name, or website
- Filtering by city, state, ZIP, county, business type, services, work labels (same syntax as the permit `label` filter), minimum Kukun score, years in business, and permit count
- Property search: every contractor that filed a permit at a property, by `kukun-id` or address (`/v1/contractors/property-search`)
- Cursor pagination with `next-page-id`

---

### AVM & PICO

Resolve a property by address or Kukun ID, then retrieve its automated valuation estimate, property score, and neighborhood score. See the API Reference for full parameters and examples.

Features include:

- Automated Valuation Model (AVM) with low/high confidence range
- Property Score and Neighborhood Score use a 0–1000 scale; actual scores range from 500 to 850
- Resolve by structured address or known kukun-id
- Structured, versioned API responses

---

### Property Investment Outlook (KIO)

A proprietary, predictive metric forecasting real estate appreciation with a 5-yr KIO outlook.

---

### Property Details

Property records with assessor and parcel-level metadata.

Features include:

- Property enrichment
- Address-based queries
- Structured property records
- Geographic segmentation

---

## Authentication

All API requests require authentication. Pass your API key as a Bearer token in the Authorization header on every request.

Example request:

```bash
curl -X GET "https://api.mykukun.com/v1/permits/search" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

Send the key only in the `Authorization` header, with the `Bearer ` prefix. Never send it as a query parameter or in another header.

Keep the key on your server. Never put it in browser or mobile app code. If a key is exposed, rotate it at once in [My API Keys](/api-keys).

Using an AI assistant? The same API key works with the Kukun MCP server. See the <a href="/mcp-quickstart" style={{textDecoration: 'none', fontWeight: 600}}>Kukun MCP Quickstart</a>.

---

## Base URL

These are the only public hosts:

| Interface | Base URL                       |
| --------- | ------------------------------ |
| REST API  | `https://api.mykukun.com/v1`   |
| MCP       | `https://api.mykukun.com/mcp`  |

For the MCP server, see the <a href="/mcp-quickstart" style={{textDecoration: 'none', fontWeight: 600}}>Kukun MCP Quickstart</a>.

---

## Required parameters

| Endpoint | Required |
| --- | --- |
| `/v1/permits/search` | At least one filter |
| `/v1/permits/area-search` | One `label`, `label-condition` (`has` or `missing`), `date-from`, `date-to`, and an area |
| Property endpoints (`/v1/property/*`) | `kukun-id`, or `address` + `city` + `state` + `zip-code`. KIO and Community Facts also accept `zip-code` alone |

`distance` is in miles; the default is 5. See the <a href="/api" style={{textDecoration: 'none', fontWeight: 600}}>API Reference</a> for every parameter.

---

## Response Format

All API responses are JSON, with Content-Type: application/json.

Example paginated response:

```json
{
  "success": true,
  "message": {
    "permits": [
      {
        "permit": {
          "id": "FGEO00X088",
          "number": "#XXXXX-XXXXX",
          "description": "Remodeling of the kitchen. the existing wall located where the sink is will move outwards to create more space in the kitchen",
          "status": "applied",
          "labels": "residential, addition alteration to existing residence",
          "tags": ["kitchen-remodel"],
          "type": "residential",
          "city_assigned_cost": null,
          "fees": null,
          "inspection_pass_rate": null,
          "timeline": [
            {
              "status": "applied",
              "date": "2025-07-11"
            }
          ],
          "durations": {
            "total_days": 0,
            "construction_days": null,
            "approval_days": null
          }
        },
        "contractor": {
          "id": "324655",
          "company_name": "Company Name",
          "company_phone": "5649873211",
          "business_type": null,
          "address": {
            "street": "123 Main St",
            "city": "Kansas City",
            "county": "Jackson",
            "state": "MO",
            "zip_code": "64113",
            "plus4_code": "2628",
            "formatted": "123 Main St, Kansas City, MO 64113"
          }
        },
        "property": {
          "type": "residential",
          "subtype": "single_family",
          "year_built": 1970,
          "lot_size_sqft": 36176,
          "building_area_sqft": 7680,
          "stories": null,
          "owner": {
            "name": "Owner Name",
            "phone": 5649873211
          },
          "valuation": {
            "market_value": 0
          }
        },
        "location": {
          "address": {
            "id_address": 324234324,
            "street_address": "123 Main St",
            "city": "Kansas City",
            "county": "Jackson",
            "state": "MO",
            "zip_code": "64113",
            "zip_plus4": "3925"
          },
          "coordinates": {
            "lat": 28.300478,
            "lng": -82.613849
          },
          "postal_metadata": {
            "delivery_point_barcode": "654321321321568"
          },
          "jurisdiction": ["San Mateo"]
        }
      }
    ],
    "total": 139,
    "limit": 1,
    "total_pages": 139,
    "next_page_id": "WzAsIk1ORFUwMDAwODEwOTQQ=="
  },
  "errors": null,
  "metadata": {
    "responseId": "8e4b43ff9b4709cac2b9d428376asd",
    "timestamp": "2026-05-27T00:00:00.000Z",
    "version": "v1"
  }
}
```

When next_page_id is null or omitted, there are no additional pages to request.

---

## Pagination

Permits search (`/v1/permits/search`) and area search (`/v1/permits/area-search`) use cursor-based pagination. Control page size with `limit` (max 1000 on these two endpoints; the default varies by endpoint). Each response includes:

- `total` - total number of records matching the query, across all pages
- `limit` - number of records returned in this response
- `total_pages` - total number of pages available at the current limit
- `next_page_id` - opaque cursor pointing to the last record in this result set; pass it back in as the `next-page-id` query parameter on the next request, with the same filters, to continue

Example response:

```json
{
  "total": 447700,
  "limit": 1000,
  "total_pages": 448,
  "next_page_id": "WzAsIkZMQUwwMDAwMDIzODQiXQ=="
}
```

Next page:

```http
GET /v1/permits/search?limit=1000&next-page-id=WzAsIkZMQUwwMDAwMDIzODQiXQ==
```

When `next_page_id` is null, there are no more pages.

Property search (`/v1/permits/property-search`) and the Property Join (`/v1/property/join`) don't paginate. They return at most 100 permits and a `truncated` flag that is `true` when the property has more than were returned. Property search returns 10 permits unless you send `limit` (up to 100), so send `limit=100` when you need the full history. The Property Join's `permit-limit` defaults to 100.

---

## HTTP Response Codes

The API uses standard HTTP status codes.

| Code | Description |
| ---- | --- |
| 200  | Success |
| 400  | Bad request — a parameter is missing or invalid; `errors.details` says which. Validation errors are always 400 |
| 401  | Unauthorized — the `Authorization` header is missing, the `Bearer ` prefix is missing, or the key is unknown, revoked or expired (create a new one in [My API Keys](/api-keys)) |
| 403  | Forbidden — your plan doesn't include the endpoint, or its allowance is used up (see below) |
| 404  | Not found — the address or Kukun ID didn't resolve, or no record exists |
| 429  | Too many requests — wait the number of seconds in `Retry-After`. `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset` help you pace calls |
| 500  | Internal server error — contact support with `metadata.responseId` if it persists |
| 502  | Bad gateway — an upstream dependency returned an invalid response |
| 503  | Service unavailable — an upstream dependency is temporarily unavailable |
| 504  | Gateway timeout — an upstream dependency timed out |

For 502, 503 and 504, retry with backoff. If the error persists, contact support with `metadata.responseId`.

### 403 Forbidden

`errors.message` tells the two causes apart:

| `errors.message` | Cause | What to do |
| --- | --- | --- |
| `Access denied for this endpoint` (details: `Your plan does not include access to <path>`) | Your plan doesn't include this endpoint, or you sent the key of another plan | Use the key of a plan that includes the endpoint, or subscribe to one |
| Starts with `API Key has exceeded the allowed limit` | Your plan's allowance is used up | Proofer allowances are one-time: upgrade to Starter. Starter is blocked until the next billing month |

---

## Error Handling

Validation and request errors return structured JSON responses with a consistent shape. `errors` carries `statusCode`, `message`, `details` and `path`. There is no `code` field, and `details` is an array of strings.

Example (`400` from `/v1/property/avm` when `zip-code` is missing):

```json
{
  "success": false,
  "message": null,
  "errors": {
    "statusCode": 400,
    "message": "zip-code is required when address is provided",
    "details": [
      "Received: address, city, state — missing: zip-code"
    ],
    "path": "/v1/property/avm?address=2328%20ELLIS%20DR&city=AUTAUGAVILLE&state=AL"
  },
  "metadata": {
    "responseId": "0123456789abcdef0123456789abcdef",
    "timestamp": "2026-08-06T00:00:00.000Z",
    "version": "v1"
  }
}
```

---

## API Versioning

The current API version is:

```txt
v1
```

Versioning is included directly in the request path:

```http
/v1/permits/search
```

Future API versions may introduce additional capabilities while maintaining backward compatibility whenever possible.

---

## API Reference

The API Reference section documents every endpoint with parameters, authentication, request and response examples, and error responses.

Continue to <a href="/api" style={{textDecoration: 'none', fontWeight: 600}}>API Reference</a> section to explore all available endpoints.

---

## Plans and keys

Each plan includes specific endpoints; see <a href="https://mykukun.com/developers/pricing" style={{textDecoration: 'none', fontWeight: 600}}>Pricing</a> for which.

- New accounts start on the **Proofer** plan, with one API key for the Property Join and the three permits endpoints (search, property search and area search). Its allowance is one-time.
- Each **Starter** plan has its own API key. Call an endpoint with the key of the plan that includes it. When a Starter allowance is used up, the plan is blocked until the next billing month.

To cancel a plan, open <a href="/subscriptions" style={{textDecoration: 'none', fontWeight: 600}}>My Subscription</a>, scroll to the bottom and click **Cancel subscription**. The plan is canceled at the end of the billing cycle: access continues until then, the plan doesn't renew, and you must subscribe again to continue.

---

## Best Practices

To improve performance and result quality:

- Filter by date range and geography before broader filters — these are indexed first
- Use the smallest limit that meets your needs; on permits search and area search the maximum is 1000 per request
- For bulk pulls of more than 100K records, contact sales@mykukun.com about flat-file delivery
- Cache static responses (jurisdiction lists, label taxonomy) — these change infrequently
- Respect the Retry-After header on 429 responses

---

## Support

Email partner.support@mykukun.com for authentication, rate-limit, or data-availability issues. Standard response time is one business day. For sales questions, use sales@mykukun.com.
