{
  "openapi": "3.0.1",
  "info": {
    "title": "UK CQC Care Provider Changes: New, Closed, Rated",
    "description": "Change feed of the Care Quality Commission (England) register: newly registered care homes, clinics, GPs, dentists and homecare agencies, deregistrations, new inspection ratings and Inadequate / Requires improvement downgrades. Organisations only, no manager names. No API key.",
    "version": "0.2",
    "x-build-id": "mx0LRKlDoc7pdanzD"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/moment-data~uk-cqc-care-provider-changes-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-moment-data-uk-cqc-care-provider-changes-feed",
        "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/moment-data~uk-cqc-care-provider-changes-feed/runs": {
      "post": {
        "operationId": "runs-sync-moment-data-uk-cqc-care-provider-changes-feed",
        "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/moment-data~uk-cqc-care-provider-changes-feed/run-sync": {
      "post": {
        "operationId": "run-sync-moment-data-uk-cqc-care-provider-changes-feed",
        "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": {
          "eventTypes": {
            "title": "Event types",
            "type": "array",
            "description": "newRegistration = location registered with CQC in the window; newRating = overall rating published in the window; deregistration = location deregistered/archived in the window; ratingChange = rating differs from the snapshot saved by your previous run (sinceLastRun mode only). Default: newRegistration + newRating. Empty list = all.",
            "items": {
              "type": "string",
              "enum": [
                "newRegistration",
                "newRating",
                "deregistration",
                "ratingChange"
              ],
              "enumTitles": [
                "Newly registered location",
                "New inspection rating published",
                "Deregistered / archived location",
                "Rating changed since last run"
              ]
            }
          },
          "daysBack": {
            "title": "Window (days before the CQC file date)",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Events dated within this many days before the CQC file's 'as at' date. CQC publishes these files monthly (early each month), so 31 covers one file.",
            "default": 31
          },
          "ratings": {
            "title": "Only these overall ratings",
            "type": "array",
            "description": "Filter by the location's latest overall rating, e.g. Inadequate + Requires improvement for risk alerts. Empty = any (new registrations usually have no rating yet, so this filter removes them).",
            "items": {
              "type": "string",
              "enum": [
                "Outstanding",
                "Good",
                "Requires improvement",
                "Inadequate"
              ]
            }
          },
          "onlyDowngrades": {
            "title": "ratingChange: downgrades only",
            "type": "boolean",
            "description": "For ratingChange events, only report downgrades (e.g. Good -> Requires improvement).",
            "default": true
          },
          "careHomesOnly": {
            "title": "Care homes only",
            "type": "boolean",
            "description": "Only locations flagged as care homes.",
            "default": false
          },
          "regions": {
            "title": "Regions",
            "type": "array",
            "description": "CQC or NHS region contains, e.g. London, North West, South East, Yorkshire.",
            "items": {
              "type": "string"
            }
          },
          "localAuthorities": {
            "title": "Local authorities",
            "type": "array",
            "description": "Exact local authority names, e.g. Leeds, Kent, Birmingham.",
            "items": {
              "type": "string"
            }
          },
          "sectors": {
            "title": "Sector / inspection category contains",
            "type": "array",
            "description": "Matched against location type/sector, inspection directorate and primary inspection category, e.g. Social Care, Dentists, Residential social care, Community based adult social care, Hospitals.",
            "items": {
              "type": "string"
            }
          },
          "serviceTypes": {
            "title": "Service types contain",
            "type": "array",
            "description": "e.g. Homecare agencies, Care home service with nursing, Supported living, Doctors consultation.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords (name)",
            "type": "array",
            "description": "Matched against location, provider and brand name (case/accent-insensitive).",
            "items": {
              "type": "string"
            }
          },
          "excludeNhs": {
            "title": "Exclude NHS bodies",
            "type": "boolean",
            "description": "Keep only independent organisations (companies, charities, CICs).",
            "default": false
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "window",
              "sinceLastRun"
            ],
            "type": "string",
            "description": "sinceLastRun remembers delivered events and the rating of every location (named key-value store), so scheduled runs only return new events and can report rating changes.",
            "default": "window"
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Separate memory per watchlist in sinceLastRun mode.",
            "default": "default"
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Maximum records delivered (also caps spend).",
            "default": 30
          },
          "activeFileUrl": {
            "title": "Active locations file URL (advanced)",
            "type": "string",
            "description": "Optional override: a cqc.org.uk/system/files/...HSCA_Active_Locations.ods link. By default the newest file is discovered on the official 'Using CQC data' page."
          },
          "deactivatedFileUrl": {
            "title": "Deactivated locations file URL (advanced)",
            "type": "string",
            "description": "Optional override: a cqc.org.uk/system/files/...Deactivated_Locations.ods link."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}