{
  "openapi": "3.0.1",
  "info": {
    "title": "CA LA County Building Permits (EPIC-LA)",
    "description": "LA County unincorporated building & planning cases (EPIC-LA public data, 916k records): residential / commercial / multifamily / electrical / plumbing / mechanical / solar / pool / road permits with status, valuation, dates, AIN, ADU & affordable-housing flags.",
    "version": "0.0",
    "x-build-id": "vG2gN1ZlSrNgLfLvx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/j0401~ca-epic-la-permits/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-j0401-ca-epic-la-permits",
        "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~ca-epic-la-permits/runs": {
      "post": {
        "operationId": "runs-sync-j0401-ca-epic-la-permits",
        "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~ca-epic-la-permits/run-sync": {
      "post": {
        "operationId": "run-sync-j0401-ca-epic-la-permits",
        "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": {
          "module": {
            "title": "Case module",
            "enum": [
              "",
              "permits",
              "planning"
            ],
            "type": "string",
            "description": "permits = building & construction cases (PermitManagement, ~614k): residential / commercial / multifamily / electrical / plumbing / mechanical / solar / road / sewer / pool permits. planning = zoning & land-use plan reviews (PlanManagement, ~302k). Blank = building permits on a plain browse; both modules when you add a locating filter (address / AIN / case number / ...).",
            "default": ""
          },
          "permitType": {
            "title": "Permit type",
            "type": "string",
            "description": "Building-permit type (fuzzy, matches the source list). E.g. residential, commercial, multifamily, electrical, plumbing, mechanical, solar, sewer, grading, pool/spa, road, construction & demolition, flood, film.",
            "default": ""
          },
          "status": {
            "title": "Status",
            "type": "string",
            "description": "Case status. Use a source value exactly (Finaled, Issued, Approved, Completed, Void, Accepted, Canceled, Open, Expired, Denied, Withdrawn, Rejected, Revoked ...), or 'open' / 'active' for the live in-progress slice. Blank = any status (default).",
            "default": ""
          },
          "caseNumber": {
            "title": "Case number",
            "type": "string",
            "description": "Exact case number (e.g. UNC-BLDR260902008726, RPPL2024006019) -> that case's record.",
            "default": ""
          },
          "projectName": {
            "title": "Project name",
            "type": "string",
            "description": "Project name substring, case-insensitive.",
            "default": ""
          },
          "address": {
            "title": "Address",
            "type": "string",
            "description": "Main address substring (e.g. a street name). Populated on ~95% of building rows.",
            "default": ""
          },
          "ain": {
            "title": "APN / AIN",
            "type": "string",
            "description": "Assessor parcel number (10-digit AIN) substring.",
            "default": ""
          },
          "supervisorialDistrict": {
            "title": "Supervisorial district",
            "type": "string",
            "description": "LA County supervisorial district number (1-5).",
            "default": ""
          },
          "countywideStatArea": {
            "title": "Countywide statistical area",
            "type": "string",
            "description": "Countywide statistical area / community name substring, e.g. 'East Los Angeles', 'Altadena'.",
            "default": ""
          },
          "minValuation": {
            "title": "Min valuation ($)",
            "type": "integer",
            "description": "Only cases with permit valuation >= this amount. Valuation is filled on ~34% of rows."
          },
          "maxValuation": {
            "title": "Max valuation ($)",
            "type": "integer",
            "description": "Only cases with permit valuation <= this amount."
          },
          "appliedFrom": {
            "title": "Applied on or after",
            "type": "string",
            "description": "Only cases applied on/after this date (YYYY-MM-DD).",
            "default": ""
          },
          "appliedTo": {
            "title": "Applied before",
            "type": "string",
            "description": "Only cases applied on/before this date (YYYY-MM-DD).",
            "default": ""
          },
          "issuedFrom": {
            "title": "Issued on or after",
            "type": "string",
            "description": "Only cases with a permit issuance date on/after this date.",
            "default": ""
          },
          "issuedTo": {
            "title": "Issued before",
            "type": "string",
            "description": "Only cases with a permit issuance date on/before this date.",
            "default": ""
          },
          "aggregate": {
            "title": "Aggregate instead of cases",
            "type": "boolean",
            "description": "When on, returns one summary record per group (see groupBy) with count - instead of individual cases. Computed server-side.",
            "default": false
          },
          "groupBy": {
            "title": "Aggregate by",
            "enum": [
              "caseType",
              "status",
              "module",
              "useCurr",
              "supervisorialDistrict",
              "countywideStatArea",
              "workClassName"
            ],
            "type": "string",
            "description": "Which dimension to aggregate over. caseType -> the permit-type mix (residential vs electrical vs road vs ...); status -> how many are finaled/issued/open/...; countywideStatArea -> where the work is.",
            "default": "caseType"
          },
          "maxResults": {
            "title": "Max records",
            "minimum": 0,
            "type": "integer",
            "description": "Cap the number of records pushed (0 = up to ~10k rows per run - the practical page limit; a case query can hit the run's charge cap first). An aggregate has at most a few hundred groups.",
            "default": 200
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}