{
  "openapi": "3.0.1",
  "info": {
    "title": "UK CQC Care Providers & Sub-Ratings Scraper",
    "description": "Extract 57,000+ UK CQC care homes, clinics & providers from the official OGL directory with all 5 live sub-ratings (Safe, Effective, Caring, Responsive, Well-led), bed capacity, registered managers & warning notices. Filter directly for Inadequate or Requires improvement leads.",
    "version": "0.0",
    "x-build-id": "rLsTR7EaoTWy8w1v8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kailouis_labs~uk-cqc-care-providers-sub-ratings-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kailouis_labs-uk-cqc-care-providers-sub-ratings-scraper",
        "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/kailouis_labs~uk-cqc-care-providers-sub-ratings-scraper/runs": {
      "post": {
        "operationId": "runs-sync-kailouis_labs-uk-cqc-care-providers-sub-ratings-scraper",
        "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/kailouis_labs~uk-cqc-care-providers-sub-ratings-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-kailouis_labs-uk-cqc-care-providers-sub-ratings-scraper",
        "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": {
          "serviceTypes": {
            "title": "Service types",
            "type": "array",
            "description": "Keep only these CQC service types. Case-insensitive partial match, e.g. \"Residential homes\" matches every residential care home; \"Dentist\" matches dental practices. Leave empty for all types. Common values: Residential homes, Nursing homes, Homecare agencies, Supported living, Dentist, Doctors/GPs, Clinic, Hospice, Hospital, Extra Care housing.",
            "items": {
              "type": "string"
            }
          },
          "regions": {
            "title": "CQC regions",
            "type": "array",
            "description": "Keep only locations in these CQC regions. Case-insensitive partial match. Values are: London, South East, South West, East of England, Midlands, North East and Yorkshire, North West.",
            "items": {
              "type": "string"
            }
          },
          "postcodePrefixes": {
            "title": "Postcode prefixes",
            "type": "array",
            "description": "Keep only locations whose postcode starts with these prefixes. Spaces and case are ignored, so \"SW\", \"E1\" and \"m1\" all work. Great for city-level or territory-based targeting.",
            "items": {
              "type": "string"
            }
          },
          "excludePostcodePrefixes": {
            "title": "Exclude postcode prefixes",
            "type": "array",
            "description": "Optional. Drop locations whose postcode starts with these prefixes, e.g. use [\"N\", \"E\"] to trim north and east London out of a wider London pull.",
            "items": {
              "type": "string"
            }
          },
          "localAuthorities": {
            "title": "Local authorities",
            "type": "array",
            "description": "Optional. Exact local authority names as CQC records them, e.g. \"Wandsworth\", \"Manchester\", \"Kent\". Case-insensitive.",
            "items": {
              "type": "string"
            }
          },
          "providerName": {
            "title": "Provider or location name contains",
            "type": "string",
            "description": "Partial match on the location name or the provider (operator) name. Useful for tracking one group: e.g. \"Barchester\", \"HC-One\", \"Nuffield\"."
          },
          "includeSubRatings": {
            "title": "Fetch ratings and inspection details (recommended)",
            "type": "boolean",
            "description": "When on, each location that survives your filters gets one polite HTTP request to its public CQC page to collect the overall rating, all five key-question sub-ratings (Safe, Effective, Caring, Responsive, Well-led), report date, specialisms, registered manager and enforcement signals. The official CSV has none of these. Turn off for a lightning-fast directory-only pull.",
            "default": true
          },
          "filterByRating": {
            "title": "Keep only these ratings",
            "type": "array",
            "description": "Optional. Applied after enrichment, on the overall rating (or on any sub-rating when the next switch is on). Typical B2B trigger lists: [\"Inadequate\", \"Requires improvement\"] for providers under pressure, [\"Outstanding\"] for flagship groups. Requires \"Fetch ratings and inspection details\".",
            "items": {
              "type": "string",
              "enum": [
                "Outstanding",
                "Good",
                "Requires improvement",
                "Inadequate"
              ]
            }
          },
          "matchAnySubRating": {
            "title": "Match any sub-rating too",
            "type": "boolean",
            "description": "When on, a location is kept if ANY of its five sub-ratings matches your rating list, even if its overall rating does not. This is how you surface homes rated Good overall but Requires improvement on Safe.",
            "default": false
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 0,
            "type": "integer",
            "description": "Safety cap so test runs stay fast and cheap. Default 100; 0 means unlimited (use only when you really want the whole filtered register). When a rating filter is set the cap applies to results pushed, so the Actor keeps enriching until it fills the cap.",
            "default": 100
          },
          "maxConcurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "How many CQC pages to fetch at once. 4 is the measured default and keeps peak memory around 230 MB even on long enriched runs; up to 8 works but costs memory. No proxy needed.",
            "default": 4
          },
          "requestDelaySecs": {
            "title": "Delay between requests (seconds)",
            "minimum": 0,
            "type": "number",
            "description": "Minimum gap between two requests to the same CQC host. 0.2s is plenty; raise it if you run the full 57k directory.",
            "default": 0.2
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 10,
            "maximum": 120,
            "type": "integer",
            "description": "Per-page timeout for the CQC location pages.",
            "default": 45
          },
          "cacheDirectory": {
            "title": "Cache the directory CSV for 24 hours",
            "type": "boolean",
            "description": "Keeps the 19 MB official CSV in the key-value store and reuses it for 24 hours, so repeated or split runs do not re-download it.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}