{
  "openapi": "3.0.1",
  "info": {
    "title": "Storm & Hail Damage Leads: NOAA Hail Reports by ZIP Code",
    "description": "ZIP codes hit by hail, damaging wind, tornadoes and hurricanes from official NWS warnings, NOAA Storm Events and OpenFEMA declarations, scored by severity and joined with city roofing-permit surges. Street-level permit counts, no homeowner data. Incremental runs.",
    "version": "0.1",
    "x-build-id": "4hrMsPONA1dfHUc2M"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/clearfeedlabs~storm-roofing-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-clearfeedlabs-storm-roofing-feed",
        "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/clearfeedlabs~storm-roofing-feed/runs": {
      "post": {
        "operationId": "runs-sync-clearfeedlabs-storm-roofing-feed",
        "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/clearfeedlabs~storm-roofing-feed/run-sync": {
      "post": {
        "operationId": "run-sync-clearfeedlabs-storm-roofing-feed",
        "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",
        "required": [
          "states"
        ],
        "properties": {
          "states": {
            "title": "States",
            "type": "array",
            "description": "2-letter U.S. state codes to watch, e.g. TX, CO, FL.",
            "default": [
              "TX"
            ],
            "items": {
              "type": "string"
            }
          },
          "lookbackDays": {
            "title": "Live warnings lookback (days)",
            "minimum": 1,
            "maximum": 7,
            "type": "integer",
            "description": "How many days of National Weather Service warnings to include (api.weather.gov keeps about a week).",
            "default": 3
          },
          "eventTypes": {
            "title": "Event types",
            "type": "array",
            "description": "Which storm types to include.",
            "items": {
              "type": "string",
              "enum": [
                "hail",
                "wind",
                "tornado",
                "hurricane"
              ],
              "enumTitles": [
                "Hail",
                "Damaging wind",
                "Tornado",
                "Hurricane / extreme wind"
              ]
            },
            "default": [
              "hail",
              "wind",
              "tornado",
              "hurricane"
            ]
          },
          "minHailInches": {
            "title": "Minimum hail size (inches)",
            "enum": [
              "0.75",
              "1",
              "1.5",
              "2"
            ],
            "type": "string",
            "description": "Hail warnings and reports smaller than this are ignored.",
            "default": "1"
          },
          "minWindMph": {
            "title": "Minimum wind gust (mph)",
            "minimum": 40,
            "maximum": 150,
            "type": "integer",
            "description": "58 mph is the NWS severe threshold.",
            "default": 58
          },
          "bufferMiles": {
            "title": "Buffer around reports (miles)",
            "minimum": 0,
            "maximum": 25,
            "type": "integer",
            "description": "ZIP codes whose center is within this distance of a storm report are included.",
            "default": 3
          },
          "includeNwsAlerts": {
            "title": "Live NWS warnings",
            "type": "boolean",
            "description": "Severe Thunderstorm, Tornado, Hurricane and Extreme Wind warnings from the official api.weather.gov API.",
            "default": true
          },
          "includeStormEventsHistory": {
            "title": "NOAA Storm Events history",
            "type": "boolean",
            "description": "Verified storm reports from NOAA NCEI bulk files. Lags 2-4 months; good for territory planning and backfill.",
            "default": false
          },
          "historyDays": {
            "title": "History window (days)",
            "minimum": 7,
            "maximum": 730,
            "type": "integer",
            "description": "Used when NOAA Storm Events history is on.",
            "default": 120
          },
          "includeFema": {
            "title": "FEMA disaster declarations",
            "type": "boolean",
            "description": "Tag ZIPs in counties with a matching OpenFEMA major-disaster or emergency declaration.",
            "default": true
          },
          "includeFemaCountyZips": {
            "title": "Also output every ZIP in FEMA-declared counties",
            "type": "boolean",
            "description": "Adds one row per ZIP in each county named in a matching OpenFEMA declaration (last 120 days), even when no warning or storm report matched. Can produce many rows; use Max rows to cap spend.",
            "default": false
          },
          "includePermits": {
            "title": "Roofing-permit layer",
            "type": "boolean",
            "description": "Join roof permits from official city open-data portals and flag surges vs. a 52-week baseline. Rows in covered ZIPs are billed as permit-enriched.",
            "default": true
          },
          "permitCities": {
            "title": "Permit cities",
            "type": "array",
            "description": "Only cities in your selected states are queried.",
            "items": {
              "type": "string",
              "enum": [
                "austin",
                "minneapolis",
                "new-orleans",
                "baton-rouge",
                "dallas",
                "fort-worth",
                "miami-dade"
              ],
              "enumTitles": [
                "Austin, TX",
                "Minneapolis, MN",
                "New Orleans, LA",
                "Baton Rouge, LA",
                "Dallas, TX",
                "Fort Worth, TX",
                "Miami-Dade County, FL"
              ]
            },
            "default": [
              "austin",
              "minneapolis",
              "new-orleans",
              "baton-rouge",
              "dallas",
              "fort-worth",
              "miami-dade"
            ]
          },
          "permitWindowDays": {
            "title": "Post-storm permit window (days)",
            "minimum": 3,
            "maximum": 60,
            "type": "integer",
            "description": "Roof permits counted from the storm date.",
            "default": 14
          },
          "baselineWeeks": {
            "title": "Baseline (weeks)",
            "minimum": 8,
            "maximum": 104,
            "type": "integer",
            "description": "Weeks before the storm used for the normal weekly roof-permit rate.",
            "default": 52
          },
          "surgeRatio": {
            "title": "Surge ratio",
            "type": "string",
            "description": "Flag a surge when the weekly permit rate is at least this multiple of baseline.",
            "default": "2"
          },
          "minSurgePermits": {
            "title": "Minimum permits for a surge",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "A surge also needs at least this many roof permits in the window.",
            "default": 5
          },
          "maxGeocodePerRun": {
            "title": "Max new addresses to geocode per run",
            "minimum": 0,
            "maximum": 50000,
            "type": "integer",
            "description": "Miami-Dade permits have no ZIP, so addresses are matched to ZIPs with the official U.S. Census Geocoder (batched, cached across runs; only a hashed key and ZIP are stored).",
            "default": 15000
          },
          "includePermitSurgeZips": {
            "title": "Also output permit-surge ZIPs without a storm",
            "type": "boolean",
            "description": "Adds rows for covered ZIPs whose roof permits surged in the last window even when no storm matched this run.",
            "default": false
          },
          "onlyNewSinceLastRun": {
            "title": "Only new or changed rows",
            "type": "boolean",
            "description": "Scheduled runs output (and bill) only ZIP-event rows that are new or changed since the last run with the same state key.",
            "default": true
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Use a different key per schedule/task to keep their 'since last run' memory separate.",
            "default": "default"
          },
          "maxRows": {
            "title": "Max rows",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Hard cap on billed rows per run.",
            "default": 500
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}