{
  "openapi": "3.0.1",
  "info": {
    "title": "NRC ERNS Chemical Spill & Release Incident Screener by Address",
    "description": "Screen any US property against the National Response Center (ERNS) release-report corpus, 2005-present. Tiered coordinate / address / city / county matching with an explicit match class on every row, because only ~19% of NRC records carry a coordinate. Materials, CAS, evacuations, injuries, damage.",
    "version": "1.0",
    "x-build-id": "AyNAr0HkGEmrEJDkd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/malonestar~erns-nrc-release-incident-screener/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-malonestar-erns-nrc-release-incident-screener",
        "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/malonestar~erns-nrc-release-incident-screener/runs": {
      "post": {
        "operationId": "runs-sync-malonestar-erns-nrc-release-incident-screener",
        "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/malonestar~erns-nrc-release-incident-screener/run-sync": {
      "post": {
        "operationId": "run-sync-malonestar-erns-nrc-release-incident-screener",
        "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": [
              "screen",
              "delta"
            ],
            "type": "string",
            "description": "screen = check properties against the NRC corpus (the default when omitted). delta = monitor the current-year file for newly reported incidents using a named cross-run baseline."
          },
          "assets": {
            "title": "Properties to screen",
            "type": "array",
            "description": "One entry per property. Give lat + lon, or a street + city + state the US Census geocoder can resolve. Optional: label, county. Required in screen mode; ignored in delta mode. Example: [{\"label\":\"Deer Park terminal\",\"lat\":29.7317,\"lon\":-95.1267}]."
          },
          "radiusMiles": {
            "title": "Search radius (miles)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Radius for the COORDINATE tier only. Applies to roughly 19% of NRC records - the rest carry no coordinate and are reached by the address, city and county tiers instead. Falls back to 1 mile when omitted. Max 50."
          },
          "yearsBack": {
            "title": "Years of history",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "How many calendar years back to read, newest first. The NRC corpus starts at CY2005, so a larger value is silently clamped to 2005 and the row says so. Each year is a 14-18 MB workbook, so more years means a longer run. Falls back to 10 when omitted."
          },
          "matchTiers": {
            "title": "Match tiers to apply",
            "type": "array",
            "description": "Which tiers to use, in strict precedence order: coordinate, address, city, county. Disabling the non-coordinate tiers makes the screen miss roughly four out of five NRC records. All four are applied when omitted.",
            "items": {
              "type": "string",
              "enum": [
                "coordinate",
                "address",
                "city",
                "county"
              ]
            }
          },
          "includeNonRelease": {
            "title": "Include non-release incidents",
            "type": "boolean",
            "description": "RAILROAD NON-RELEASE reports are 11% of the corpus and by definition involve no material released. Leave on to see them (flagged is_release=false); turn off to suppress them - the count suppressed is always reported, never silently dropped. On when omitted."
          },
          "maxIncidentsPerAsset": {
            "title": "Max incidents per property",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Cap on incident rows emitted per property, nearest and highest-tier first. The true match count is always published as incidents_matched_total. Falls back to 500 when omitted."
          },
          "maxResults": {
            "title": "Max rows in the dataset",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Hard cap on total emitted rows across all properties. matched_rows_total and results_truncated are on every row so a capped answer is never mistaken for a complete one. Falls back to 5000 when omitted."
          },
          "deltaStates": {
            "title": "States to monitor (delta mode)",
            "type": "array",
            "description": "Two-letter state or territory codes to scope the delta monitor, e.g. [\"TX\",\"LA\"]. Leave empty to monitor the whole current-year file. Ignored in screen mode.",
            "items": {
              "type": "string"
            }
          },
          "deltaOnly": {
            "title": "Emit only newly reported incidents",
            "type": "boolean",
            "description": "Delta mode only. When on, emit ONLY incidents absent from the previous run's baseline. The first run for a scope has no baseline, so it fails loudly and stores one rather than billing you for the whole file labelled new. Off when omitted."
          },
          "useFileCache": {
            "title": "Cache annual files between runs",
            "type": "boolean",
            "description": "Cache each annual workbook index in a named key-value store keyed by the file's Last-Modified header. Historical years are frozen so they download once ever; the current-year file is re-downloaded only when NRC actually replaces it. On when omitted."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}