{
  "openapi": "3.0.1",
  "info": {
    "title": "CQC Register: England Care Locations, Ratings & Changes",
    "description": "CQC register search for care locations in England: look up locations with CQC ratings (where CQC's ratings file has them), list changes between directory files, count locations by region, council or service type. Person-like names left out (about 17% shown). OGL data; not affiliated with CQC.",
    "version": "0.0",
    "x-build-id": "8bGr7g0b6Y3jaq0fz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/yappman~cqc-register/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-yappman-cqc-register",
        "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/yappman~cqc-register/runs": {
      "post": {
        "operationId": "runs-sync-yappman-cqc-register",
        "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/yappman~cqc-register/run-sync": {
      "post": {
        "operationId": "run-sync-yappman-cqc-register",
        "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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "lookup",
              "search",
              "changes",
              "aggregate"
            ],
            "type": "string",
            "description": "lookup: locations by CQC id. search: locations matching filters. changes: change events since a date. aggregate: counts over all locations in CQC's file (run fee only).",
            "default": "search"
          },
          "groupBy": {
            "title": "Group by (aggregate)",
            "enum": [
              "rating",
              "region",
              "localAuthority",
              "serviceType"
            ],
            "type": "string",
            "description": "Aggregate mode: count all locations in CQC's file by this. Rating uses CQC's ratings file."
          },
          "thenBy": {
            "title": "Then by (aggregate)",
            "enum": [
              "rating"
            ],
            "type": "string",
            "description": "Aggregate mode, optional second grouping: region then rating, or localAuthority then rating."
          },
          "locationIds": {
            "title": "Location ids (lookup)",
            "type": "array",
            "description": "CQC location ids, up to 500 together with providerIds. Ids not found or left out are counted, not listed.",
            "items": {
              "type": "string"
            }
          },
          "providerIds": {
            "title": "Provider ids (lookup)",
            "type": "array",
            "description": "CQC provider ids: the locations of each provider that are shown.",
            "items": {
              "type": "string"
            }
          },
          "localAuthorities": {
            "title": "Local authorities",
            "type": "array",
            "description": "Exact local authority names as CQC publishes them.",
            "items": {
              "type": "string"
            }
          },
          "regions": {
            "title": "Regions",
            "type": "array",
            "description": "CQC regions, for example London or North West.",
            "items": {
              "type": "string"
            }
          },
          "postcodeDistricts": {
            "title": "Postcode districts",
            "type": "array",
            "description": "Outward codes such as SW11.",
            "items": {
              "type": "string"
            }
          },
          "serviceTypes": {
            "title": "Service types (search)",
            "type": "array",
            "description": "CQC service types, for example Homecare agencies or Nursing homes.",
            "items": {
              "type": "string"
            }
          },
          "careHome": {
            "title": "Care home",
            "type": "boolean",
            "description": "Not available on the directory route yet (refused, uncharged)."
          },
          "registrationStatus": {
            "title": "Registration status",
            "enum": [
              "Registered",
              "Deregistered"
            ],
            "type": "string",
            "description": "The directory lists registered locations only."
          },
          "overallRating": {
            "title": "Overall rating",
            "enum": [
              "Outstanding",
              "Good",
              "Requires improvement",
              "Inadequate",
              "No rating"
            ],
            "type": "string",
            "description": "Search: the overall rating from CQC's ratings file (RUN_SUMMARY.ratingsFileDate). No rating matches locations without one of the four ratings. Refused, uncharged, if the register holds no ratings file."
          },
          "since": {
            "title": "Since (changes)",
            "type": "string",
            "description": "Changes mode: a date such as 2026-10-22, not before the history start shown in RUN_SUMMARY. Give since or sinceDays, not both."
          },
          "sinceDays": {
            "title": "Since, days ago (changes)",
            "minimum": 1,
            "maximum": 92,
            "type": "integer",
            "description": "Changes mode: events from this many days before today (UTC), 1 to 92, for scheduled runs. Give since or sinceDays, not both. If it reaches back before the history start, all the history there is is read and RUN_SUMMARY.sinceBeforeHistoryStart is true. RUN_SUMMARY.since shows the date it worked out."
          },
          "events": {
            "title": "Event kinds (changes)",
            "type": "array",
            "description": "listed, no_longer_listed, details_changed, rating_changed. Leave empty for every kind this route produces.",
            "items": {
              "type": "string"
            }
          },
          "includeFirstSeen": {
            "title": "Include first_seen (changes)",
            "type": "boolean",
            "description": "The baseline rows of the first file. Off by default.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum rows",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "At most this many rows are returned and charged.",
            "default": 1000
          },
          "failIfFileOlderThanDays": {
            "title": "Fail if CQC's file is older than (days)",
            "minimum": 1,
            "maximum": 92,
            "type": "integer",
            "description": "Optional, for monitoring, any mode. If the CQC file behind the register (RUN_SUMMARY.fileDate) is more than this many days old, or its age cannot be read, the run fails after reading only the register's index, before any location or event, charging nothing, and reports the file's date and age but nothing about your query. The copy is refreshed about weekly and a week can be skipped, so a value under 14 can fail when nothing is wrong. Leave empty for normal use. 1 to 92."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}