{
  "openapi": "3.0.1",
  "info": {
    "title": "California HCAI Hospital 2030 Seismic & Permit Leads",
    "description": "Extract California HCAI (OSHPD) hospital buildings facing the 2030 SB 1953 seismic retrofit deadline with SPC/NPC ratings, Hazus collapse scores, Accela permit details, urgency scores, and stateful delta alerts for AEC, seismic engineering, and healthcare construction teams.",
    "version": "1.0",
    "x-build-id": "c3W1qqtWZ4syi2gfB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/zinky_atelier~ca-hcai-hospital-seismic-leads/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-zinky_atelier-ca-hcai-hospital-seismic-leads",
        "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/zinky_atelier~ca-hcai-hospital-seismic-leads/runs": {
      "post": {
        "operationId": "runs-sync-zinky_atelier-ca-hcai-hospital-seismic-leads",
        "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/zinky_atelier~ca-hcai-hospital-seismic-leads/run-sync": {
      "post": {
        "operationId": "run-sync-zinky_atelier-ca-hcai-hospital-seismic-leads",
        "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": {
          "county": {
            "title": "California County (Optional)",
            "type": "string",
            "description": "Filter by one or more California county names or codes (comma-separated, e.g. 'Alameda' or 'Los Angeles, Orange, San Diego'). Leave blank for all 58 California counties.",
            "default": ""
          },
          "city": {
            "title": "California City (Optional)",
            "type": "string",
            "description": "Filter by one or more California city names (comma-separated, e.g. 'Oakland, Berkeley' or 'Los Angeles'). Leave blank for all cities.",
            "default": ""
          },
          "facilityName": {
            "title": "Facility / Building Name or ID (Optional)",
            "type": "string",
            "description": "Optional substring filter matching Hospital Facility Name, Building Name, Building Number (e.g. 'BLD-01279'), or HCAI Perm ID (e.g. '11210').",
            "default": ""
          },
          "spcRatings": {
            "title": "SPC Structural Performance Ratings (Optional)",
            "type": "array",
            "description": "Filter by Structural Performance Category (SPC) ratings. SPC-1 and SPC-2 buildings face California's Jan 1, 2030 SB 1953 operational deadline. Leave empty for all SPC ratings.",
            "items": {
              "type": "string",
              "enum": [
                "1",
                "1s",
                "2",
                "2s",
                "3",
                "3s",
                "4",
                "4s",
                "4D",
                "5",
                "5s",
                "N/A"
              ],
              "enumTitles": [
                "SPC-1 (Significant Collapse Risk)",
                "SPC-1s (SPC-1 Shell / Special)",
                "SPC-2 (2030 SB 1953 Deadline - Must Retrofit/Replace)",
                "SPC-2s (SPC-2 Shell / Special)",
                "SPC-3 (Compliant Beyond 2030 - Repairable)",
                "SPC-3s (SPC-3 Shell / Special)",
                "SPC-4 (Compliant Beyond 2030)",
                "SPC-4s (SPC-4 Shell / Special)",
                "SPC-4D (2030-Compliant Performance-Based Retrofit)",
                "SPC-5 (Fully Compliant Post-Earthquake Operational)",
                "SPC-5s (SPC-5 Shell / Special)",
                "N/A (Non-Acute / Support Structure)"
              ]
            },
            "default": []
          },
          "npcRatings": {
            "title": "NPC Nonstructural Performance Ratings (Optional)",
            "type": "array",
            "description": "Filter by Nonstructural Performance Category (NPC) ratings from HCAI seismic collapse data. NPC-1 and NPC-2 buildings require MEP/life-safety anchoring upgrades for 2030 compliance. Leave empty for all NPC ratings.",
            "items": {
              "type": "string",
              "enum": [
                "1",
                "2",
                "2s",
                "3",
                "3R",
                "3s",
                "4",
                "4s",
                "4D-L1",
                "4D-L2",
                "5",
                "5s",
                "N/A"
              ],
              "enumTitles": [
                "NPC-1 (Basic Unanchored Equipment)",
                "NPC-2 (2030 Deadline - Life Safety Bracing Only)",
                "NPC-2s (NPC-2 Special)",
                "NPC-3 (Critical Care Areas Braced)",
                "NPC-3R (NPC-3 Reduced)",
                "NPC-3s (NPC-3 Special)",
                "NPC-4 (Full MEP Bracing Compliant)",
                "NPC-4s (NPC-4 Special)",
                "NPC-4D-L1 (2030 Operational Continuity Level 1)",
                "NPC-4D-L2 (2030 Operational Continuity Level 2)",
                "NPC-5 (72-Hour Water/Fuel/Wastewater Autonomy)",
                "NPC-5s (NPC-5 Special)",
                "N/A (Not Applicable)"
              ]
            },
            "default": []
          },
          "nonCompliant2030Only": {
            "title": "Only 2030 SB 1953 Non-Compliant Buildings (SPC-1/2 or NPC-1/2)",
            "type": "boolean",
            "description": "When enabled, filters strictly to hospital buildings rated SPC-1/1s, SPC-2/2s, NPC-1, or NPC-2/2s facing California's mandatory January 1, 2030 SB 1953 seismic retrofit or shutdown deadline.",
            "default": true
          },
          "enrichPermitDetails": {
            "title": "Enrich Live Accela Permit Details (esp.hcai.ca.gov)",
            "type": "boolean",
            "description": "Hydrates each matched building's official HCAI Accela Citizen Access permit page (automatically rewriting legacy esp.oshpd.ca.gov URLs to esp.hcai.ca.gov) to extract physical Work Location street address, Record Status, Project Description, structural Building Types, full SPC/NPC rating history, and related SRU project numbers.",
            "default": true
          },
          "onlyNew": {
            "title": "Only New or Rating/Status-Changed Buildings (Stateful SEEN_BUILDINGS Delta Mode)",
            "type": "boolean",
            "description": "Tracks seen buildings (SPC rating, NPC rating, and Building Status) in Key-Value Store ('SEEN_BUILDINGS'). On scheduled runs, skips unchanged buildings BEFORE Accela HTML hydration and emits only NEW_BUILDING, SEISMIC_RATING_CHANGED, or STATUS_CHANGED leads.",
            "default": false
          },
          "maxItems": {
            "title": "Max Hospital Building Leads to Emit",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of hospital building records to emit in this run (sorted by 2030 SB 1953 seismic urgency score descending).",
            "default": 20
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}