{
  "openapi": "3.0.1",
  "info": {
    "title": "RCRA Corrective Action Cleanup Timeline & Overdue Milestones",
    "description": "Track RCRA corrective-action cleanups from EPA RCRAInfo: milestone dates, scheduled vs actual, schedule slip, overdue milestones, remedy status, engineering and institutional controls, and confirmed release media per facility.",
    "version": "1.0",
    "x-build-id": "EqJWlsaHLHthTIBOF"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/malonestar~epa-rcra-corrective-action-cleanup-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-malonestar-epa-rcra-corrective-action-cleanup-monitor",
        "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~epa-rcra-corrective-action-cleanup-monitor/runs": {
      "post": {
        "operationId": "runs-sync-malonestar-epa-rcra-corrective-action-cleanup-monitor",
        "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~epa-rcra-corrective-action-cleanup-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-malonestar-epa-rcra-corrective-action-cleanup-monitor",
        "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": [
          "state"
        ],
        "properties": {
          "state": {
            "title": "RCRAInfo activity location (required)",
            "type": "string",
            "description": "Two-letter RCRAInfo activity location to screen, e.g. CO, TX, CA. RCRAInfo uses 59 location codes, which are the 50 states plus DC, AS, GU, PR, VI, NN (Navajo Nation), TT (Trust Territories) and the EPA administrative codes XH and XJ. Required, so an empty call can never start a national run. Pass the literal value ANY to look facilities up nationally - ANY is only accepted together with a non-empty Handler IDs list."
          },
          "handlerIds": {
            "title": "RCRA handler IDs (optional)",
            "type": "array",
            "description": "Specific 12-character RCRAInfo handler IDs, e.g. COD007079478. When supplied these are matched nationally and the activity location above is ignored, so this is the right input for looking up a named facility. Leave empty to screen the whole activity location.",
            "items": {
              "type": "string"
            }
          },
          "outputMode": {
            "title": "Output mode",
            "enum": [
              "facility",
              "event",
              "both"
            ],
            "type": "string",
            "description": "facility = one rollup row per RCRA handler with the cleanup stage, every national milestone date and the past-due summary. event = one row per corrective-action event, the raw decoded timeline. both = facility rollups followed by the events of those same facilities, sharing one maximum-results budget: at most half of it (rounded up) goes to rollups and the rest to their events, and whichever side cannot fill its share hands the remainder to the other, so both always returns both kinds when both exist."
          },
          "onlyWithPastDueMilestones": {
            "title": "Only facilities with a past-due milestone",
            "type": "boolean",
            "description": "Keep only facilities where at least one corrective-action milestone has a scheduled date in the past and no completion date on file in RCRAInfo. Note the honest reading: that means EPA or the state records no completion, which can mean the milestone is genuinely outstanding OR that a completion was never entered."
          },
          "onlyOpenCleanups": {
            "title": "Only open cleanups",
            "type": "boolean",
            "description": "Keep only facilities whose corrective action is still open - no CA900 performance-standards-attained event and no CA999 process-terminated event. Facilities whose events use only state-specific codes are excluded by this filter because their completion status is genuinely unknown rather than open."
          },
          "includeFacilityDetails": {
            "title": "Look up facility name and address",
            "type": "boolean",
            "description": "Resolve each emitted handler's facility name, street address, city, county and FRS registry ID from the EPA Facility Registry Service. One small request per facility. Turn off for a faster run; the facility_* fields then stay null with site_lookup_status set to not_requested rather than being guessed."
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Hard cap on emitted rows, which is also the hard cap on what this run can bill. It is enforced identically in every output mode, including both, by one function every emitted row passes through - a run that cannot bound its own bill fails instead of emitting. Rows are ordered worst-overdue first, so a capped run keeps the most consequential facilities. matched_facilities_total and results_truncated on every row report what the cap left behind.",
            "default": 500
          },
          "maxFacilityLookups": {
            "title": "Maximum facility-detail lookups",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "Cap on EPA Facility Registry Service lookups per run. Facilities beyond the cap are still emitted with their full cleanup timeline; their facility_* fields stay null and site_lookup_status reads skipped_lookup_cap.",
            "default": 150
          },
          "maxSnapshotAgeDays": {
            "title": "Maximum snapshot age (days)",
            "minimum": 1,
            "maximum": 120,
            "type": "integer",
            "description": "The run fails if the newest RCRAInfo bulk export EPA publishes is older than this. RCRAInfo refreshes weekly, and a superseded export URL keeps answering HTTP 200 with the older snapshot instead of 404ing, so this freshness assertion is what stops stale cleanup milestones being sold as current.",
            "default": 21
          },
          "pinRunId": {
            "title": "Pin a RCRAInfo export run ID (advanced)",
            "type": "string",
            "description": "Reproduce an earlier answer by naming a RCRAInfo export run, e.g. CSV-2026-08-16T03-00-00-0400. If the pinned run is no longer the one EPA publishes, the run fails loudly rather than quietly serving a superseded snapshot. Leave blank for the current export."
          },
          "simulateOutage": {
            "title": "Simulate an outage (diagnostic)",
            "enum": [
              "none",
              "manifest_info",
              "manifest_modules",
              "module_download",
              "stale_snapshot",
              "dictionary",
              "positive_canary",
              "negative_control",
              "site_lookup"
            ],
            "type": "string",
            "description": "Diagnostic seam that forces one drift probe to be unable to complete, so the failure path can be re-proved on demand instead of only during a real outage. none runs normally."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}