{
  "openapi": "3.0.1",
  "info": {
    "title": "NY Environmental Records - Spills, Sites & Tanks",
    "description": "New York (NYSDEC) environmental data in one API: 574,559 spill incidents, 237,135 remediation sites (Superfund, Brownfield, VCP, ERP, RCRA) and 286,691 bulk storage tanks. Filter by county, ZIP, city, DEC region, facility, program, material or status; aggregate by county, program or year.",
    "version": "0.0",
    "x-build-id": "0NHPlhaDjEEc1pqi9"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/j0401~ny-environmental-records/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-j0401-ny-environmental-records",
        "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~ny-environmental-records/runs": {
      "post": {
        "operationId": "runs-sync-j0401-ny-environmental-records",
        "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~ny-environmental-records/run-sync": {
      "post": {
        "operationId": "run-sync-j0401-ny-environmental-records",
        "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": {
          "corpus": {
            "title": "Corpus",
            "enum": [
              "",
              "spills",
              "sites",
              "tanks"
            ],
            "type": "string",
            "description": "spills = spill incidents (default). sites = environmental remediation sites. tanks = bulk storage tanks.",
            "default": ""
          },
          "address": {
            "title": "Address prefix",
            "type": "string",
            "description": "Street-address prefix, case-insensitive (e.g. \"MAIN ST\"). Works on all three corpora; spill records have no coordinates, so there is no radius search."
          },
          "county": {
            "title": "County",
            "type": "string",
            "description": "Exact county name, case-insensitive, e.g. \"Erie\" or \"Nassau\"."
          },
          "zip": {
            "title": "ZIP code",
            "type": "string",
            "description": "ZIP prefix, e.g. \"14201\" (a 5-digit query also matches ZIP+4 values such as 14201-1234). The spill corpus publishes a ZIP on only about 10% of rows."
          },
          "city": {
            "title": "City / town / village",
            "type": "string",
            "description": "City-name prefix, case-insensitive, e.g. \"BUFFALO\"."
          },
          "region": {
            "title": "DEC region",
            "minimum": 0,
            "maximum": 9,
            "type": "number",
            "description": "NYSDEC region number, 0-9. Region 0 is reserved for vessels with no fixed location; those rows are facility-level tank registrations with no tank number or status and are not delivered."
          },
          "facilityName": {
            "title": "Facility / site name",
            "type": "string",
            "description": "Facility-name prefix, case-insensitive, e.g. \"BETHPAGE\"."
          },
          "programNumber": {
            "title": "Program number",
            "type": "string",
            "description": "Exact program id: spill number (spills) or program number (sites / tanks), e.g. \"130003A\" or \"2-481637\"."
          },
          "programType": {
            "title": "Remediation / storage program",
            "type": "string",
            "description": "Sites: HW (State Superfund), BCP, VCP, ERP, RCRA. Tanks: PBS, CBS, MOSF, LNG. Not used by the spill corpus."
          },
          "material": {
            "title": "Material / contaminant",
            "type": "string",
            "description": "Material-name prefix. Spills and tanks match the stored material name; sites match the published contaminants. E.g. \"Gasoline\"."
          },
          "units": {
            "title": "Quantity units (spills only)",
            "type": "string",
            "description": "Exact spilled-quantity unit, e.g. \"Gallons\" or \"Pounds\". Required when metric=quantity, because the corpus publishes both and they cannot be added together."
          },
          "siteClass": {
            "title": "Site class (sites only)",
            "type": "string",
            "description": "Site classification / status code: 02, 03, 04, 05, A (active), C (completed), P (preliminary), PR (RCRA), N (no further action)."
          },
          "tankStatus": {
            "title": "Tank status (tanks only)",
            "type": "string",
            "description": "Exact tank status, e.g. \"In Service\", \"Closed - Removed\", \"Closed - In Place\", \"Out of Service\"."
          },
          "north": {
            "title": "Bounding box: north latitude",
            "type": "number",
            "description": "Sites and tanks only: north edge of a latitude/longitude box. Give all four of north, south, east, west. Spill records carry no coordinates."
          },
          "south": {
            "title": "Bounding box: south latitude",
            "type": "number",
            "description": "South edge of the box; must be less than north."
          },
          "east": {
            "title": "Bounding box: east longitude",
            "type": "number",
            "description": "East edge of the box, e.g. -73.5 for western Long Island; must be greater than west."
          },
          "west": {
            "title": "Bounding box: west longitude",
            "type": "number",
            "description": "West edge of the box, e.g. -74.5; longitudes are negative in New York."
          },
          "openOnly": {
            "title": "Open spills only",
            "type": "boolean",
            "description": "When true, only spill records with no close date (spills corpus only).",
            "default": false
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "ISO date YYYY-MM-DD. Applies to the corpus's primary date: spill date (spills), project completion date (sites), install date (tanks)."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "ISO date YYYY-MM-DD, inclusive, on the same primary date column as dateFrom."
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "",
              "rows",
              "aggregate"
            ],
            "type": "string",
            "description": "rows = records (default). aggregate = one row per group.",
            "default": ""
          },
          "groupBy": {
            "title": "Aggregate by",
            "enum": [
              "",
              "county",
              "programType",
              "siteClass",
              "tankStatus",
              "materialFamily",
              "materialName",
              "city",
              "region",
              "status",
              "year"
            ],
            "type": "string",
            "description": "Dimension for mode=aggregate (blank = county). Only the dimensions that exist for the chosen corpus are accepted.",
            "default": ""
          },
          "metric": {
            "title": "Aggregate metric",
            "enum": [
              "",
              "count",
              "quantity",
              "capacityGallons"
            ],
            "type": "string",
            "description": "What to aggregate (blank = count). quantity sums the spilled quantity and REQUIRES a units filter (Gallons or Pounds - they cannot be mixed); capacityGallons sums tank capacity (tanks only).",
            "default": ""
          },
          "maxResults": {
            "title": "Max records",
            "minimum": 0,
            "type": "integer",
            "description": "Cap on records pushed in rows mode (0 = default 50; up to 5,000 per run). Each record is metered individually, so there is no per-run charge cap.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}