{
  "openapi": "3.0.1",
  "info": {
    "title": "CT Underground Storage Tanks - Facility & Enforcement Register",
    "description": "Connecticut's underground storage tank register (public open data): 49.4K tank records across 12,752 facilities, with the named responsible parties, inspection findings and violation text, and DEEP enforcement actions (field NOV, warning letter, red tag, consent order) linked on one facility id.",
    "version": "0.0",
    "x-build-id": "4guG4spDB9apUudRJ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/j0401~ct-ust-tanks/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-j0401-ct-ust-tanks",
        "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~ct-ust-tanks/runs": {
      "post": {
        "operationId": "runs-sync-j0401-ct-ust-tanks",
        "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~ct-ust-tanks/run-sync": {
      "post": {
        "operationId": "run-sync-j0401-ct-ust-tanks",
        "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": [
              "",
              "tanks",
              "contacts",
              "compliance",
              "enforcement",
              "facility",
              "aggregate"
            ],
            "type": "string",
            "description": "tanks = tank rows (default). contacts = the named parties on a facility (Owner / Operator / Class A Operator). compliance = inspection findings and violation text. enforcement = DEEP actions (field NOV, warning letter, red tag, consent order). facility = EVERYTHING for one facility id, in one response. aggregate = one count row per group.",
            "default": "tanks"
          },
          "corpus": {
            "title": "Aggregate table",
            "enum": [
              "",
              "tanks",
              "contacts",
              "compliance",
              "enforcement"
            ],
            "type": "string",
            "description": "Which table to aggregate - only used when mode=aggregate. Ignored otherwise.",
            "default": "tanks"
          },
          "groupBy": {
            "title": "Group by",
            "type": "string",
            "description": "Aggregate dimension, only used when mode=aggregate. Valid per table: tanks -> tankStatus, substance, closureType, city; contacts -> affiliation, city, state; compliance -> complianceMethod, violation, city, tankId; enforcement -> enforcementType, enforcementStatus, clientType, city. Blank = a sensible default per table. Blank = a sensible default for the selected table - do not leave it set when switching corpus.",
            "default": ""
          },
          "facilityId": {
            "title": "Facility ID",
            "type": "string",
            "description": "Exact facility id, e.g. '135-9468'. One id links the tanks, contacts, compliance and enforcement tables - this is the through-key. Blank = any. Use it with mode=facility to pull one site's whole record.",
            "default": ""
          },
          "name": {
            "title": "Facility name",
            "type": "string",
            "description": "Facility name substring, e.g. 'SHELL'. Blank = any. Not available on the compliance table (which carries no name).",
            "default": ""
          },
          "city": {
            "title": "City",
            "type": "string",
            "description": "City substring, e.g. 'HARTFORD'. Blank = any.",
            "default": ""
          },
          "zip": {
            "title": "ZIP",
            "type": "string",
            "description": "ZIP prefix, e.g. '06103' or '061'. Blank = any.",
            "default": ""
          },
          "tankStatus": {
            "title": "Tank status",
            "enum": [
              "",
              "Currently In Use",
              "Temporarily Closed",
              "Permanently Closed"
            ],
            "type": "string",
            "description": "Exact tank status. Blank = any.",
            "default": ""
          },
          "substance": {
            "title": "Substance",
            "enum": [
              "",
              "Gasoline",
              "Heating Oil(on-site consumption)",
              "Diesel",
              "Used Oil",
              "Hazardous Substance",
              "Kerosene (for resale)",
              "Other Petroleum (Specify)",
              "Heating Oil(for resale)",
              "E-15",
              "E-85",
              "Kerosene (on-site consumption)",
              "Biodiesel (GT20)",
              "Biodiesel (LE20)"
            ],
            "type": "string",
            "description": "Exact substance the tank holds. Blank = any.",
            "default": ""
          },
          "closureType": {
            "title": "Closure type",
            "enum": [
              "",
              "Tank was Removed From Ground",
              "Tank Filled with Inert Material",
              "Tank was Abandoned in Ground"
            ],
            "type": "string",
            "description": "Exact closure method (tanks table only). Blank = any.",
            "default": ""
          },
          "affiliation": {
            "title": "Contact affiliation",
            "enum": [
              "",
              "Owner",
              "Registrant",
              "Operator",
              "Billing Contact",
              "Primary Contact",
              "Property Owner",
              "Class A Operator",
              "Class B Operator",
              "Other",
              "Off Site Records",
              "Representive"
            ],
            "type": "string",
            "description": "Exact party role (contacts table only). Blank = any.",
            "default": ""
          },
          "complianceMethod": {
            "title": "Compliance method",
            "enum": [
              "",
              "Documentation",
              "Reinspected",
              "Warning Only",
              "Test Results",
              "Other",
              "Escalated-Other",
              "Escalated-Order",
              "Mistakenly Marked Failed",
              "Archived",
              "Escalated-Red Tag",
              "Referred to Enforcement",
              "Ownership Change"
            ],
            "type": "string",
            "description": "How the finding was resolved (compliance table only). Blank = any.",
            "default": ""
          },
          "violation": {
            "title": "Violation text",
            "type": "string",
            "description": "Violation-name substring (compliance table only), e.g. 'RELEASE DETECTION'. Blank = any.",
            "default": ""
          },
          "enforcementType": {
            "title": "Enforcement type",
            "enum": [
              "",
              "Field Notice of Violation",
              "Warning Letter",
              "Red Tag Order",
              "Consent Order",
              "Notice Of Violation",
              "Referral to Attorney General",
              "Stipulated Judgment",
              "Unilateral Order",
              "Referral To Epa",
              "Federal Consent Decree",
              "State Court Order",
              "Settlement Agreement",
              "Contempt Order",
              "Referral To Chief State s Attorney"
            ],
            "type": "string",
            "description": "Exact DEEP action (enforcement table only). Blank = any.",
            "default": ""
          },
          "enforcementStatus": {
            "title": "Enforcement status",
            "enum": [
              "",
              "Closed",
              "Active"
            ],
            "type": "string",
            "description": "Exact action status (enforcement table only). Blank = any.",
            "default": ""
          },
          "installedFrom": {
            "title": "Installed from",
            "type": "string",
            "description": "Earliest tank installation date, YYYY-MM-DD (tanks table only). Blank = any.",
            "default": ""
          },
          "installedTo": {
            "title": "Installed to",
            "type": "string",
            "description": "Latest tank installation date, YYYY-MM-DD (tanks table only). Blank = any.",
            "default": ""
          },
          "inspectedFrom": {
            "title": "Inspected from",
            "type": "string",
            "description": "Earliest inspection date, YYYY-MM-DD (compliance table only). Blank = any.",
            "default": ""
          },
          "inspectedTo": {
            "title": "Inspected to",
            "type": "string",
            "description": "Latest inspection date, YYYY-MM-DD (compliance table only). Blank = any.",
            "default": ""
          },
          "actionFrom": {
            "title": "Action from",
            "type": "string",
            "description": "Earliest enforcement action start date, YYYY-MM-DD (enforcement table only). Blank = any.",
            "default": ""
          },
          "actionTo": {
            "title": "Action to",
            "type": "string",
            "description": "Latest enforcement action start date, YYYY-MM-DD (enforcement table only). Blank = any.",
            "default": ""
          },
          "maxResults": {
            "title": "Max records",
            "minimum": 0,
            "type": "integer",
            "description": "Cap records returned for this run. Default 50 keeps the daily auto-test fast. 0 = no cap (the full matching slice, up to 10,000).",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}