{
  "openapi": "3.0.1",
  "info": {
    "title": "EPA ECHO Scraper: Facility Compliance Records, No Login",
    "description": "US facilities from EPA ECHO with compliance status, inspections, violations, enforcement actions and penalties. Filter by state, ZIP, county, industry code, program or violation status. No key. $1 per 1,000 results, platform usage included.",
    "version": "0.1",
    "x-build-id": "FeNsOVzly0lTufPuJ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/one_dollar_store~epa-echo-facility-compliance/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-one_dollar_store-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/one_dollar_store~epa-echo-facility-compliance/runs": {
      "post": {
        "operationId": "runs-sync-one_dollar_store-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/one_dollar_store~epa-echo-facility-compliance/run-sync": {
      "post": {
        "operationId": "run-sync-one_dollar_store-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",
            "maxItems": 60,
            "type": "array",
            "description": "Two letter state or territory codes, for example DE or TX. Give at least one state, ZIP code, county, city, facility name, permit ID or industry code.",
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "ZIP codes",
            "maxItems": 100,
            "type": "array",
            "description": "Five digit ZIP codes, for example 19713.",
            "items": {
              "type": "string"
            }
          },
          "county": {
            "title": "County",
            "type": "string",
            "description": "County name, for example New Castle. Use it together with a state."
          },
          "city": {
            "title": "City",
            "type": "string",
            "description": "City name, for example Newark."
          },
          "facilityNames": {
            "title": "Facility names",
            "maxItems": 25,
            "type": "array",
            "description": "Company or site names, one search per line, for example DuPont. Up to 25. Combine with a state to keep the search small.",
            "items": {
              "type": "string"
            }
          },
          "permitIds": {
            "title": "Permit or system IDs",
            "maxItems": 500,
            "type": "array",
            "description": "Exact IDs from EPA programs (an air, water, hazardous waste or drinking water ID, or an EPA registry ID).",
            "items": {
              "type": "string"
            }
          },
          "naicsCodes": {
            "title": "NAICS industry codes",
            "maxItems": 50,
            "type": "array",
            "description": "2, 4 or 6 digit NAICS codes, for example 3251 for basic chemical manufacturing.",
            "items": {
              "type": "string"
            }
          },
          "sicCodes": {
            "title": "SIC industry codes",
            "maxItems": 50,
            "type": "array",
            "description": "2 to 4 digit SIC codes, for example 2911 for petroleum refining.",
            "items": {
              "type": "string"
            }
          },
          "program": {
            "title": "Program",
            "enum": [
              "any",
              "air",
              "water",
              "hazardousWaste",
              "drinkingWater"
            ],
            "type": "string",
            "description": "Only facilities regulated under this EPA program.",
            "default": "any"
          },
          "complianceStatus": {
            "title": "Current compliance",
            "enum": [
              "any",
              "anyViolation",
              "significantViolation",
              "significantInSeveralPrograms"
            ],
            "type": "string",
            "description": "Only facilities in violation now.",
            "default": "any"
          },
          "quartersInViolation": {
            "title": "Quarters in violation",
            "enum": [
              "any",
              "GT1",
              "GT2",
              "GT4",
              "GT8",
              "GT12"
            ],
            "type": "string",
            "description": "Quarters out of the last 12 (three years) with a violation.",
            "default": "any"
          },
          "lastPenalty": {
            "title": "Last penalty",
            "enum": [
              "any",
              "LE1YR",
              "LE2YR",
              "LE3YR",
              "LE5YR",
              "GT1YR",
              "GT2YR",
              "GT3YR",
              "GT5YR",
              "never"
            ],
            "type": "string",
            "description": "When the facility last received a penalty.",
            "default": "any"
          },
          "formalActionWithinYears": {
            "title": "Formal enforcement action within (years)",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Only facilities with a formal enforcement action in the last 1 to 5 years. Leave empty for any."
          },
          "inspectedWithinYears": {
            "title": "Inspected within (years)",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Only facilities inspected in the last 1 to 5 years. Use this or the next field, not both."
          },
          "notInspectedWithinYears": {
            "title": "Not inspected within (years)",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Only facilities not inspected in the last 1 to 5 years."
          },
          "majorOnly": {
            "title": "Major facilities only",
            "type": "boolean",
            "description": "Only facilities that ECHO marks as major, usually the large ones.",
            "default": false
          },
          "activeOnly": {
            "title": "Active facilities only",
            "type": "boolean",
            "description": "Only facilities with an active permit or status. Turn off to include closed ones.",
            "default": true
          },
          "sortBy": {
            "title": "Order of results",
            "enum": [
              "default",
              "penalties",
              "quartersInNonCompliance",
              "formalActions",
              "informalActions",
              "name"
            ],
            "type": "string",
            "description": "ECHO's own order is by facility name within the search. The other choices sort all matches before the first rows are returned.",
            "default": "default"
          },
          "maxItems": {
            "title": "Maximum results",
            "minimum": 10,
            "maximum": 5000,
            "type": "integer",
            "description": "The run stops after this many facilities. 10 to 5,000.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}