{
  "openapi": "3.0.1",
  "info": {
    "title": "EPA ECHO — US Facility Environmental Compliance and Enforcement",
    "description": "Search every US facility the EPA regulates and return its compliance record: current violation status under the Clean Air Act, Clean Water Act, RCRA and the Safe Drinking Water Act, inspections, formal enforcement actions and penalties in dollars. Free EPA open data, no key, no scraping.",
    "version": "0.1",
    "x-build-id": "36GmiaxWb9xGMbebQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/dalbian~epa-echo-facility-compliance/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-dalbian-epa-echo-facility-compliance",
        "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/dalbian~epa-echo-facility-compliance/runs": {
      "post": {
        "operationId": "runs-sync-dalbian-epa-echo-facility-compliance",
        "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/dalbian~epa-echo-facility-compliance/run-sync": {
      "post": {
        "operationId": "run-sync-dalbian-epa-echo-facility-compliance",
        "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": {
          "states": {
            "title": "States",
            "type": "array",
            "description": "Two-letter state or territory codes, one per line — NJ, TX, PR. ECHO refuses any search that would match more than 100 000 facilities, so a whole state on its own is usually too broad; add a programme, a county or the major-facilities filter.",
            "default": [
              "NJ"
            ],
            "items": {
              "type": "string"
            }
          },
          "facilityName": {
            "title": "Facility name",
            "type": "string",
            "description": "Part of a facility name, for example MERCK. ECHO matches the name and the aliases it holds for the same site, so a search for MERCK also returns DUPONT MERCK PHARMACEUTICAL CO."
          },
          "registryIds": {
            "title": "Registry IDs",
            "type": "array",
            "description": "Look up known facilities directly by their 12-digit EPA Registry ID, or by a programme ID such as an NPDES permit or an RCRA handler ID, one per line. Identifiers ECHO does not recognise are listed in the summary row.",
            "items": {
              "type": "string"
            }
          },
          "city": {
            "title": "City",
            "type": "string",
            "description": "City name, for example NEWARK."
          },
          "county": {
            "title": "County",
            "type": "string",
            "description": "County name without the word County, for example ESSEX."
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "Five-digit ZIP codes, one per line.",
            "items": {
              "type": "string"
            }
          },
          "naicsCodes": {
            "title": "NAICS codes",
            "type": "array",
            "description": "Two, four or six-digit NAICS codes, one per line. A short code is a prefix match: 325 covers all chemical manufacturing.",
            "items": {
              "type": "string"
            }
          },
          "sicCodes": {
            "title": "SIC codes",
            "type": "array",
            "description": "Two to four-digit SIC codes, one per line. 2911 is petroleum refining; the two-digit 29 covers the whole petroleum and coal products group.",
            "items": {
              "type": "string"
            }
          },
          "mediaProgram": {
            "title": "Environmental programme",
            "enum": [
              "any",
              "air",
              "water",
              "hazardousWaste",
              "drinkingWater",
              "riskManagement"
            ],
            "type": "string",
            "description": "Restrict the search to facilities regulated under one programme. A facility outside that programme is excluded entirely, rather than returned with a blank status.",
            "default": "any"
          },
          "majorFacilitiesOnly": {
            "title": "Major facilities only",
            "type": "boolean",
            "description": "Only major sources — large air emitters and major NPDES dischargers. On by default: ECHO refuses any search matching more than 100 000 facilities, and a whole state exceeds that on its own (New Jersey holds 334 914 regulated facilities but 419 majors). Turn it off only together with a narrower filter — a county, a ZIP code, a NAICS code or a facility name.",
            "default": true
          },
          "inViolationOnly": {
            "title": "In violation only",
            "type": "boolean",
            "description": "Only facilities with a current violation under any programme.",
            "default": false
          },
          "significantViolationsOnly": {
            "title": "Significant violations only",
            "type": "boolean",
            "description": "Only facilities in significant non-compliance — the EPA's own high-priority tier. Overrides the in-violation filter when both are on.",
            "default": false
          },
          "minQuartersInViolation": {
            "title": "Minimum quarters in violation",
            "enum": [
              "any",
              "GT1",
              "GT2",
              "GT4",
              "GT8",
              "GT12"
            ],
            "type": "string",
            "description": "Persistence rather than a single bad quarter. ECHO tracks the last twelve quarters, so more than 8 means a facility that has been out of compliance for most of three years.",
            "default": "any"
          },
          "withPenaltiesOnly": {
            "title": "With penalties only",
            "type": "boolean",
            "description": "Only facilities that have ever been assessed a monetary penalty.",
            "default": false
          },
          "activeOnly": {
            "title": "Active facilities only",
            "type": "boolean",
            "description": "Exclude facilities EPA records as closed or no longer operating. Around eight in ten records in a state-wide search are inactive.",
            "default": false
          },
          "federalFacilitiesOnly": {
            "title": "Federal facilities only",
            "type": "boolean",
            "description": "Only sites operated by a federal agency — military bases, laboratories, depots.",
            "default": false
          },
          "latitude": {
            "title": "Latitude",
            "type": "string",
            "description": "Centre of a radius search, in decimal degrees (NAD83), for example 41.8240."
          },
          "longitude": {
            "title": "Longitude",
            "type": "string",
            "description": "Centre of a radius search, in decimal degrees, negative in the US, for example -71.4128."
          },
          "radiusMiles": {
            "title": "Radius (miles)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Search radius in statute miles around the latitude and longitude. Required when either coordinate is given."
          },
          "includeEnforcementDetail": {
            "title": "Include enforcement detail",
            "type": "boolean",
            "description": "Fetch each facility's Detailed Facility Report and add a row per statute (inspections, quarters in non-compliance, penalties) and a row per formal enforcement action (date, action type, lead agency, penalty amount). One extra request per facility, so it is capped and off by default.",
            "default": false
          },
          "maxDetailReports": {
            "title": "Maximum detail reports",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Cap on how many facilities get a Detailed Facility Report, highest penalties first.",
            "default": 100
          },
          "maxResults": {
            "title": "Maximum facilities",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Cap on facilities returned. ECHO itself refuses any query matching more than 100 000.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}