{
  "openapi": "3.0.1",
  "info": {
    "title": "CT Child Care & Youth Camp Licensing",
    "description": "Connecticut child care & youth camp licensing (public open data): three linked tables keyed by case id - violations (353k code findings), inspections (99k by type/status) and investigations (34k complaints). Pull a case's full chain, filter by provider/outcome, or aggregate.",
    "version": "0.0",
    "x-build-id": "AG9P44m11R7mmI2AN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/j0401~ct-childcare/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-j0401-ct-childcare",
        "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-childcare/runs": {
      "post": {
        "operationId": "runs-sync-j0401-ct-childcare",
        "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-childcare/run-sync": {
      "post": {
        "operationId": "run-sync-j0401-ct-childcare",
        "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": [
              "violations",
              "inspections",
              "investigations",
              "case",
              "aggregate"
            ],
            "type": "string",
            "description": "violations = code findings (default). inspections = licensing inspections. investigations = complaints / self-reports. case = every row for one `caseId` across all three tables. aggregate = one count row per group (see groupBy).",
            "default": "violations"
          },
          "corpus": {
            "title": "Aggregate over",
            "enum": [
              "violations",
              "inspections",
              "investigations"
            ],
            "type": "string",
            "description": "Which table to aggregate when mode=aggregate. Ignored in other modes.",
            "default": "violations"
          },
          "caseId": {
            "title": "Case id",
            "type": "string",
            "description": "Numeric OEC case id. The through-key linking violations, inspections and investigations — use with mode=case to pull the whole chain.",
            "default": ""
          },
          "name": {
            "title": "Provider name",
            "type": "string",
            "description": "Provider / facility name substring (inspections and investigations carry the name). Blank = any.",
            "default": ""
          },
          "licenseNumber": {
            "title": "License number",
            "type": "string",
            "description": "Exact license number, e.g. 'DCFH.57872'.",
            "default": ""
          },
          "actionType": {
            "title": "Action type",
            "enum": [
              "",
              "1-Inspection & Findings",
              "05-Inspection & Findings",
              "4-Follow Up Visit & Findings",
              "10-Follow Up Visit & Findings"
            ],
            "type": "string",
            "description": "The visit kind. Note the source keeps both a '1-' and a '05-' spelling of Inspection & Findings — pick the exact one. Blank = any.",
            "default": ""
          },
          "inspectionType": {
            "title": "Inspection type",
            "type": "string",
            "description": "Inspection type substring, e.g. 'UNANNOUNCED', 'FULL'. Blank = any.",
            "default": ""
          },
          "inspectionStatus": {
            "title": "Inspection status",
            "enum": [
              "",
              "CLOSED",
              "IN PROCESS",
              "OPENED"
            ],
            "type": "string",
            "description": "Inspection status. OPENED + IN PROCESS = live work. Blank = any.",
            "default": ""
          },
          "howReceived": {
            "title": "Investigation received as",
            "enum": [
              "",
              "Complaints",
              "Self-Reported",
              "Licensing"
            ],
            "type": "string",
            "description": "How an investigation came in. Blank = any.",
            "default": ""
          },
          "resolution": {
            "title": "Resolution",
            "type": "string",
            "description": "Outcome substring, e.g. 'Corrective Action Plan', 'Referred to Legal'. Blank = any.",
            "default": ""
          },
          "visitFrom": {
            "title": "Visit on or after",
            "type": "string",
            "description": "Only rows with a visit date on/after this date (violations + inspections).",
            "default": ""
          },
          "visitTo": {
            "title": "Visit before",
            "type": "string",
            "description": "Only rows with a visit date before this date (violations + inspections).",
            "default": ""
          },
          "openedFrom": {
            "title": "Investigation opened on or after",
            "type": "string",
            "description": "Only investigations opened on/after this date.",
            "default": ""
          },
          "openedTo": {
            "title": "Investigation opened before",
            "type": "string",
            "description": "Only investigations opened before this date.",
            "default": ""
          },
          "groupBy": {
            "title": "Aggregate by",
            "enum": [
              "",
              "actionType",
              "caseType",
              "statute",
              "inspectionType",
              "inspectionStatus",
              "resolution",
              "howReceived"
            ],
            "type": "string",
            "description": "Dimension to aggregate over. Blank = the corpus's own default (actionType for violations, inspectionStatus for inspections, resolution for investigations). Available dimensions depend on `corpus`.",
            "default": ""
          },
          "maxResults": {
            "title": "Max records",
            "minimum": 0,
            "type": "integer",
            "description": "Cap the number of records pushed (0 = up to ~10k per run; each record is metered individually, so there is no per-run charge cap). Aggregate mode returns every group; maxResults applies to rows only.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}