{
  "openapi": "3.0.1",
  "info": {
    "title": "LA Building Occupancy Certificates - CofO & Contractor",
    "description": "LA certificates of occupancy (~71,060, 2005-2026; the publisher dropped most pre-2013 history): premises, APN, permit type, declared valuation, units, floor area, zoning, occupancy group, contractor with licence, applicant, coordinates. Search, total valuation, or roll up one parcel.",
    "version": "0.0",
    "x-build-id": "N1y1TuaWScAjQ4J6a"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/j0401~la-building-occupancy/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-j0401-la-building-occupancy",
        "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/j0401~la-building-occupancy/runs": {
      "post": {
        "operationId": "runs-sync-j0401-la-building-occupancy",
        "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/j0401~la-building-occupancy/run-sync": {
      "post": {
        "operationId": "run-sync-j0401-la-building-occupancy",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "",
              "rows",
              "aggregate",
              "profile",
              "parcel"
            ],
            "type": "string",
            "description": "rows = certificates (default). aggregate = one row per group with a count, valuation total/average, unit total or floor-area total. profile = one certificate by number. parcel = every certificate at one assessor parcel (apn required) with the parcel summary.",
            "default": ""
          },
          "cofoNumber": {
            "title": "Certificate number",
            "type": "string",
            "description": "The CofO number, e.g. \"234037\"."
          },
          "pcisPermit": {
            "title": "PCIS permit",
            "type": "string",
            "description": "Permit number, e.g. \"03014-20000-04721\"."
          },
          "referenceOldPermit": {
            "title": "Legacy permit",
            "type": "string",
            "description": "Older permit reference as the city publishes it, e.g. \"16VN18124\" or \"23ON 0299\" (about a quarter of values carry an internal space)."
          },
          "apn": {
            "title": "APN (book-page-parcel)",
            "type": "string",
            "description": "Assessor parcel, e.g. \"2368-016-034\". Used with mode=parcel or as a filter."
          },
          "address": {
            "title": "Street name contains",
            "type": "string",
            "description": "Case-insensitive substring on the street name, e.g. \"GENTRY\"."
          },
          "streetName": {
            "title": "Street name contains (alias)",
            "type": "string",
            "description": "Same as address; kept for symmetry with other actors."
          },
          "zip": {
            "title": "ZIP code",
            "type": "string",
            "description": "Exact 5-digit ZIP code."
          },
          "permitType": {
            "title": "Permit type",
            "type": "string",
            "description": "e.g. \"Bldg-New\", \"Bldg-Addition\", \"Bldg-Alter/Repair\", \"Swimming-Pool/Spa\"."
          },
          "permitSubType": {
            "title": "Permit sub-type",
            "type": "string",
            "description": "\"1 or 2 Family Dwelling\", \"Commercial\" or \"Apartment\"."
          },
          "permitCategory": {
            "title": "Permit category",
            "type": "string",
            "description": "\"Plan Check\" (125,668 rows) or \"No Plan Check\"."
          },
          "status": {
            "title": "Latest status",
            "type": "string",
            "description": "\"CofO Issued\", \"CofO Corrected\", \"CofO Superseded\" or \"CofO Reactivated\"."
          },
          "initiatingOffice": {
            "title": "Initiating office",
            "type": "string",
            "description": "VAN NUYS, METRO, WEST LA, SOUTH LA, SANPEDRO or WILSHIRE."
          },
          "zone": {
            "title": "Zone",
            "type": "string",
            "description": "Zoning code exactly as published, e.g. \"R1-1\", \"C2-1XL\". The feed has 1,294 zone values plus a blank group of 83 rows."
          },
          "occupancy": {
            "title": "Occupancy group",
            "type": "string",
            "description": "e.g. \"R3 Occ. Group\", \"Misc. Occ. Group\". Filled on 21,326 rows."
          },
          "contractor": {
            "title": "Contractor name contains",
            "type": "string",
            "description": "Case-insensitive substring on the contractor business name."
          },
          "licenseNumber": {
            "title": "Contractor licence number",
            "type": "string",
            "description": "Digits only."
          },
          "ownerBuilder": {
            "title": "Owner-builder",
            "enum": [
              "",
              "yes",
              "no"
            ],
            "type": "string",
            "description": "yes = the published contractor name is \"OWNER-BUILDER\" (55,189 rows); no = every other row, including the 9,473 with no published contractor name.",
            "default": ""
          },
          "valuationMin": {
            "title": "Minimum valuation (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Declared job valuation, lower bound."
          },
          "valuationMax": {
            "title": "Maximum valuation (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Declared job valuation, upper bound."
          },
          "minUnits": {
            "title": "Minimum residential units",
            "minimum": 0,
            "type": "number",
            "description": "of_residential_dwelling_units lower bound."
          },
          "issueFrom": {
            "title": "Certificate issued from",
            "type": "string",
            "description": "ISO date (YYYY-MM-DD) on cofo_issue_date."
          },
          "issueTo": {
            "title": "Certificate issued to",
            "type": "string",
            "description": "ISO date (YYYY-MM-DD) on cofo_issue_date."
          },
          "year": {
            "title": "Certificate issue year",
            "type": "integer",
            "description": "Exact year, 2005-2026."
          },
          "groupBy": {
            "title": "Aggregate dimension",
            "enum": [
              "",
              "year",
              "permitType",
              "permitSubType",
              "permitCategory",
              "status",
              "initiatingOffice",
              "zone",
              "occupancy",
              "zip",
              "eventCode"
            ],
            "type": "string",
            "description": "Used only with mode=aggregate. Default permitType.",
            "default": ""
          },
          "metric": {
            "title": "Aggregate metric",
            "enum": [
              "",
              "count",
              "sumValuation",
              "avgValuation",
              "sumUnits",
              "sumFloorArea"
            ],
            "type": "string",
            "description": "count (default); valuation and unit metrics sum or average the published columns.",
            "default": ""
          },
          "maxResults": {
            "title": "Max records",
            "type": "integer",
            "description": "Records delivered in rows mode (default 50, max 5000). parcel returns every certificate at the APN up to its 2,000 ceiling and profile returns the certificate regardless of this value; aggregate ignores it. 0 uses the default 50.",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}