{
  "openapi": "3.0.1",
  "info": {
    "title": "CQC Care Directory - 57K England Care Locations & Ratings",
    "description": "Every active CQC care location in England (57k, OGL v3): care homes, home care, dentists, GP practices and clinics with provider, address, service types, local authority, region and the latest Overall/Safe/Effective/Caring/Responsive/Well-led rating. Search, filter or aggregate.",
    "version": "0.0",
    "x-build-id": "plpZcu1nkcs4SlogH"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/j0401~uk-cqc-care-directory/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-j0401-uk-cqc-care-directory",
        "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~uk-cqc-care-directory/runs": {
      "post": {
        "operationId": "runs-sync-j0401-uk-cqc-care-directory",
        "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~uk-cqc-care-directory/run-sync": {
      "post": {
        "operationId": "run-sync-j0401-uk-cqc-care-directory",
        "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": [
              "",
              "search",
              "aggregate",
              "warm"
            ],
            "type": "string",
            "description": "search = filter the directory. aggregate = one row per group. warm = owner maintenance: rebuild the snapshot from the CQC source and upload it (no filters). Leave blank to auto-route: filters -> search, no filters -> aggregate."
          },
          "name": {
            "title": "Location name",
            "type": "string",
            "description": "Location name or trading name substring, case-insensitive (e.g. \"Henley House\")."
          },
          "provider": {
            "title": "Provider name",
            "type": "string",
            "description": "Provider / operator name substring, case-insensitive (e.g. \"Greensleeves\")."
          },
          "postcode": {
            "title": "Postcode",
            "type": "string",
            "description": "Postcode or prefix; spaces are ignored (e.g. \"SW1A\" or \"IP1 6TB\")."
          },
          "localAuthority": {
            "title": "Local authority",
            "type": "string",
            "description": "Exact council name, case-insensitive (e.g. \"Suffolk\")."
          },
          "region": {
            "title": "Region",
            "enum": [
              "",
              "East",
              "East Midlands",
              "London",
              "North East",
              "North West",
              "South East",
              "South West",
              "West Midlands",
              "Yorkshire & Humberside",
              "Wales"
            ],
            "type": "string",
            "description": "CQC region."
          },
          "serviceType": {
            "title": "Service type",
            "type": "string",
            "description": "Service type substring, case-insensitive (e.g. \"Residential homes\", \"Nursing homes\", \"Homecare agencies\", \"Dentist\")."
          },
          "locationType": {
            "title": "Location type",
            "type": "string",
            "description": "Exact location type, e.g. \"Social Care Org\", \"Primary Medical Services\", \"Primary Dental Care\", \"Independent Healthcare Org\", \"NHS Healthcare Organisation\". Blank for unrated locations."
          },
          "rating": {
            "title": "Overall rating",
            "type": "string",
            "description": "Exact latest Overall rating: Outstanding, Good, Requires improvement, Inadequate, Not applicable, Insufficient evidence to rate, No Approved Rating (rarely: Evidence requirements partially / not yet scored)."
          },
          "careHome": {
            "title": "Care home only",
            "type": "boolean",
            "description": "true = only care homes (the CQC flag, plus locations whose service type is Residential or Nursing homes). false (default) = no filter.",
            "default": false
          },
          "locationId": {
            "title": "CQC location ID",
            "type": "string",
            "description": "Exact CQC location ID (e.g. \"1-10000302982\")."
          },
          "groupBy": {
            "title": "Aggregate by",
            "enum": [
              "",
              "rating",
              "serviceType",
              "region",
              "localAuthority",
              "locationType",
              "careHome"
            ],
            "type": "string",
            "description": "rating -> latest Overall rating; serviceType -> service category; region / localAuthority -> geography; locationType -> CQC location type; careHome -> care home flag. Blank defaults to rating."
          },
          "maxResults": {
            "title": "Max records",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Cap the number of search records pushed (0 = the default 50, maximum 5000). Aggregate returns every group.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}