{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Care Home Directory Scraper (CQC)",
    "description": "Scrape the official CQC (Care Quality Commission) register of nursing and residential care homes in England. Search by region, local authority, specialism, keyword or postcode, and fetch official inspection ratings (Outstanding/Good/Requires improvement/Inadequate) per home.",
    "version": "1.0",
    "x-build-id": "3ibAhMUsM3rv8Hmuu"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~cqc-care-home-directory-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-cqc-care-home-directory-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/crawlerbros~cqc-care-home-directory-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-cqc-care-home-directory-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/crawlerbros~cqc-care-home-directory-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-cqc-care-home-directory-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "byLocationIds"
            ],
            "type": "string",
            "description": "What to fetch.",
            "default": "search"
          },
          "keyword": {
            "title": "Keyword (name search)",
            "type": "string",
            "description": "Case-insensitive substring match against the care home's registered name or \"also known as\" name (mode=search). Leave blank to skip.",
            "default": ""
          },
          "providerName": {
            "title": "Provider / operator name",
            "type": "string",
            "description": "Case-insensitive substring match against the care provider/operator company name, e.g. `Bupa`, `Barchester` (mode=search). Leave blank to skip.",
            "default": ""
          },
          "region": {
            "title": "Region (England)",
            "enum": [
              "",
              "East",
              "East Midlands",
              "London",
              "North East",
              "North West",
              "South East",
              "South West",
              "West Midlands",
              "Yorkshire & Humberside"
            ],
            "type": "string",
            "description": "Restrict to one of CQC's 9 English regions (mode=search).",
            "default": ""
          },
          "localAuthority": {
            "title": "Local authority",
            "enum": [
              "",
              "Barking and Dagenham",
              "Barnet",
              "Barnsley",
              "Bath and North East Somerset",
              "Bedford",
              "Bexley",
              "Birmingham",
              "Blackburn with Darwen",
              "Blackpool",
              "Bolton",
              "Bournemouth, Christchurch and Poole",
              "Bracknell Forest",
              "Bradford",
              "Brent",
              "Brighton and Hove",
              "Bristol, City of",
              "Bromley",
              "Buckinghamshire",
              "Bury",
              "Calderdale",
              "Cambridgeshire",
              "Camden",
              "Central Bedfordshire",
              "Cheshire East",
              "Cheshire West and Chester",
              "Cornwall",
              "County Durham",
              "Coventry",
              "Croydon",
              "Cumberland",
              "Darlington",
              "Derby",
              "Derbyshire",
              "Devon",
              "Doncaster",
              "Dorset",
              "Dudley",
              "Ealing",
              "East Riding of Yorkshire",
              "East Sussex",
              "Enfield",
              "Essex",
              "Gateshead",
              "Gloucestershire",
              "Greenwich",
              "Hackney",
              "Halton",
              "Hammersmith and Fulham",
              "Hampshire",
              "Haringey",
              "Harrow",
              "Hartlepool",
              "Havering",
              "Herefordshire, County of",
              "Hertfordshire",
              "Hillingdon",
              "Hounslow",
              "Isle of Wight",
              "Isles of Scilly",
              "Islington",
              "Kensington and Chelsea",
              "Kent",
              "Kingston upon Hull, City of",
              "Kingston upon Thames",
              "Kirklees",
              "Knowsley",
              "Lambeth",
              "Lancashire",
              "Leeds",
              "Leicester",
              "Leicestershire",
              "Lewisham",
              "Lincolnshire",
              "Liverpool",
              "Luton",
              "Manchester",
              "Medway",
              "Merton",
              "Middlesbrough",
              "Milton Keynes",
              "Newcastle upon Tyne",
              "Newham",
              "Norfolk",
              "North East Lincolnshire",
              "North Lincolnshire",
              "North Northamptonshire",
              "North Somerset",
              "North Tyneside",
              "North Yorkshire",
              "Northumberland",
              "Nottingham",
              "Nottinghamshire",
              "Oldham",
              "Oxfordshire",
              "Peterborough",
              "Plymouth",
              "Portsmouth",
              "Reading",
              "Redbridge",
              "Redcar and Cleveland",
              "Richmond upon Thames",
              "Rochdale",
              "Rotherham",
              "Rutland",
              "Salford",
              "Sandwell",
              "Sefton",
              "Sheffield",
              "Shropshire",
              "Slough",
              "Solihull",
              "Somerset",
              "South Gloucestershire",
              "South Tyneside",
              "Southampton",
              "Southend-on-Sea",
              "Southwark",
              "St. Helens",
              "Staffordshire",
              "Stockport",
              "Stockton-on-Tees",
              "Stoke-on-Trent",
              "Suffolk",
              "Sunderland",
              "Surrey",
              "Sutton",
              "Swindon",
              "Tameside",
              "Telford and Wrekin",
              "Thurrock",
              "Torbay",
              "Tower Hamlets",
              "Trafford",
              "Wakefield",
              "Walsall",
              "Waltham Forest",
              "Wandsworth",
              "Warrington",
              "Warwickshire",
              "West Berkshire",
              "West Northamptonshire",
              "West Sussex",
              "Westminster",
              "Westmorland and Furness",
              "Wigan",
              "Wiltshire",
              "Windsor and Maidenhead",
              "Wirral",
              "Wokingham",
              "Wolverhampton",
              "Worcestershire",
              "York"
            ],
            "type": "string",
            "description": "Restrict to a single English local authority area (mode=search).",
            "default": ""
          },
          "serviceType": {
            "title": "Care home type",
            "enum": [
              "",
              "Nursing homes",
              "Residential homes"
            ],
            "type": "string",
            "description": "Restrict to nursing homes (registered nursing care) or residential homes (personal care only). Leave as \"any\" to include both (mode=search).",
            "default": ""
          },
          "specialism": {
            "title": "Specialism / care need",
            "enum": [
              "",
              "Caring for adults over 65 yrs",
              "Caring for adults under 65 yrs",
              "Caring for children (0 - 18yrs)",
              "Caring for people whose rights are restricted under the Mental Health Act",
              "Dementia",
              "Eating disorders",
              "Learning disabilities",
              "Mental health conditions",
              "Physical disabilities",
              "Sensory impairments",
              "Services for everyone",
              "Substance misuse problems"
            ],
            "type": "string",
            "description": "Restrict to care homes that CQC lists as supporting this specific care need, e.g. Dementia (mode=search).",
            "default": ""
          },
          "postcodeArea": {
            "title": "Postcode / postcode area",
            "type": "string",
            "description": "Match care homes whose postcode starts with this value, e.g. `NE31`, `SW1`, `B93` (mode=search). Leave blank to skip.",
            "default": ""
          },
          "sortBy": {
            "title": "Sort order",
            "enum": [
              "name",
              "latestInspectionDateDesc"
            ],
            "type": "string",
            "description": "Order of results (mode=search).",
            "default": "name"
          },
          "includeRatings": {
            "title": "Include official CQC ratings",
            "type": "boolean",
            "description": "Fetch each matched care home's CQC inspection page to add its Overall/Safe/Effective/Caring/Responsive/Well-led ratings, regulated activities, registered manager(s), and nominated individual(s) (mode=search). Adds one extra request per result, capped at 60 per run for reliability. Always included for mode=byLocationIds.",
            "default": false
          },
          "locationIds": {
            "title": "CQC Location IDs (mode=byLocationIds)",
            "type": "array",
            "description": "Exact CQC Location IDs (e.g. `1-10557588274`) or full `cqc.org.uk/location/...` URLs to fetch, each enriched with inspection ratings.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Hard cap on emitted records.",
            "default": 20
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}