{
  "openapi": "3.0.1",
  "info": {
    "title": "California Building Permits by Trade: Solar, Roofing, HVAC",
    "description": "Newly issued building, electrical and mechanical permits from Los Angeles, San Francisco and San Jose official open data, tagged by trade (solar, battery, EV charger, roofing, HVAC, ADU, pool, plumbing...). Filter by city, trade, date, valuation and ZIP.",
    "version": "0.1",
    "x-build-id": "cf3dWtbVBe7sWKYXt"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/chaucerlabs~california-building-permits-by-trade/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-chaucerlabs-california-building-permits-by-trade",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/chaucerlabs~california-building-permits-by-trade/runs": {
      "post": {
        "operationId": "runs-sync-chaucerlabs-california-building-permits-by-trade",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/chaucerlabs~california-building-permits-by-trade/run-sync": {
      "post": {
        "operationId": "run-sync-chaucerlabs-california-building-permits-by-trade",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Which city portals to read. Default: all three.",
            "items": {
              "type": "string",
              "enum": [
                "los_angeles",
                "san_francisco",
                "san_jose"
              ],
              "enumTitles": [
                "Los Angeles",
                "San Francisco",
                "San Jose"
              ]
            },
            "default": [
              "los_angeles",
              "san_francisco",
              "san_jose"
            ]
          },
          "trades": {
            "title": "Trades",
            "type": "array",
            "description": "Keep permits tagged with any of these trades. Empty = all permits.",
            "items": {
              "type": "string",
              "enum": [
                "solar",
                "battery_storage",
                "ev_charger",
                "roofing",
                "hvac",
                "adu",
                "pool_spa",
                "electrical",
                "plumbing",
                "water_heater",
                "kitchen_bath",
                "windows_doors",
                "new_construction",
                "addition",
                "demolition",
                "fire_protection",
                "seismic_retrofit",
                "foundation",
                "sign",
                "tenant_improvement",
                "fence_wall",
                "grading"
              ],
              "enumTitles": [
                "Solar PV",
                "Battery storage",
                "EV charger",
                "Roofing / re-roof",
                "HVAC / heat pump",
                "ADU",
                "Pool / spa",
                "Electrical",
                "Plumbing",
                "Water heater",
                "Kitchen / bath remodel",
                "Windows / doors / siding",
                "New construction",
                "Addition",
                "Demolition",
                "Fire sprinkler / alarm",
                "Seismic retrofit",
                "Foundation",
                "Signs",
                "Tenant improvement",
                "Fence / retaining wall",
                "Grading"
              ]
            }
          },
          "daysBack": {
            "title": "Days back (issue date)",
            "minimum": 1,
            "maximum": 92,
            "type": "integer",
            "description": "Calendar days back from the end date. Los Angeles publishes weekly, so 14 is a good default.",
            "default": 14
          },
          "startDate": {
            "title": "Start date",
            "type": "string",
            "description": "Optional, YYYY-MM-DD issue date. Overrides Days back. San Jose only offers the last 30 days."
          },
          "endDate": {
            "title": "End date",
            "type": "string",
            "description": "Optional, YYYY-MM-DD. Defaults to today. Max range 92 days."
          },
          "minValuationUsd": {
            "title": "Minimum valuation (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep permits with a declared job value of at least this much. Permits with no valuation (most electrical/mechanical permits) are dropped when this is set.",
            "default": 0
          },
          "maxValuationUsd": {
            "title": "Maximum valuation (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "0 = no maximum.",
            "default": 0
          },
          "propertyTypes": {
            "title": "Property type",
            "type": "array",
            "description": "Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "residential",
                "commercial",
                "unknown"
              ],
              "enumTitles": [
                "Residential",
                "Commercial",
                "Unknown"
              ]
            }
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "Keep only these 5-digit ZIP codes. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "keyword": {
            "title": "Keyword",
            "type": "string",
            "description": "Optional text that must appear in the work description, permit type or address, e.g. heat pump, Tesla, Powerwall."
          },
          "requireContractor": {
            "title": "Only permits with a named contractor",
            "type": "boolean",
            "description": "Contractor names are published for San Francisco (DBI permits) and San Jose.",
            "default": false
          },
          "excludeSupplemental": {
            "title": "Exclude supplemental / revision permits",
            "type": "boolean",
            "description": "Drop paperwork-only permits such as plan revisions, contractor changes and permit re-issues.",
            "default": true
          },
          "includeUntagged": {
            "title": "Include permits with no trade tag",
            "type": "boolean",
            "description": "Only applies when Trades is empty.",
            "default": true
          },
          "onlyNewSinceLastRun": {
            "title": "Monitor mode: only permits not returned in earlier runs",
            "type": "boolean",
            "description": "Schedule weekly or daily for a no-repeat permit feed.",
            "default": false
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 0,
            "type": "integer",
            "description": "0 = no limit.",
            "default": 0
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}