{
  "openapi": "3.0.1",
  "info": {
    "title": "CMS Care Compare Quality Scraper",
    "description": "Get Medicare hospital star ratings with mortality, readmission, infection and patient survey measures, plus nursing home staffing, inspections and fines, home health, dialysis and hospice quality. Compared with state averages. Export to CSV or Excel.",
    "version": "1.0",
    "x-build-id": "e8y685drPE6Ksfzzh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/parselab~cms-care-compare-quality-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-parselab-cms-care-compare-quality-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/parselab~cms-care-compare-quality-scraper/runs": {
      "post": {
        "operationId": "runs-sync-parselab-cms-care-compare-quality-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/parselab~cms-care-compare-quality-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-parselab-cms-care-compare-quality-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": {
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000."
          },
          "mode": {
            "title": "What to collect",
            "enum": [
              "hospitals",
              "nursingHomes",
              "nursingHomeDeficiencies",
              "nursingHomePenalties",
              "homeHealth",
              "dialysis",
              "hospices"
            ],
            "type": "string",
            "description": "Hospitals gives one row per hospital with the star rating and mortality, readmission, infection, patient survey and spending measures merged in. Nursing homes gives staffing, ratings, turnover and fines. Inspection findings and Penalties give one row per citation or fine. Home health, dialysis and hospice give one row per provider with their quality measures.",
            "default": "hospitals"
          },
          "states": {
            "title": "States",
            "type": "array",
            "description": "Two letter state codes such as TX or NY. Leave empty for the whole country.",
            "items": {
              "type": "string"
            }
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Keep only providers in these cities, for example HOUSTON. Combine with a state for common city names.",
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "Keep only providers in these five digit ZIP codes.",
            "items": {
              "type": "string"
            }
          },
          "nameContains": {
            "title": "Name contains",
            "type": "string",
            "description": "Keep only providers whose name contains this text, for example SUNRISE or MAYO."
          },
          "providerIds": {
            "title": "Provider IDs (CCN)",
            "type": "array",
            "description": "Look up specific providers by their six character CMS Certification Number, for example 530012.",
            "items": {
              "type": "string"
            }
          },
          "minRating": {
            "title": "Minimum star rating",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Keep only providers with at least this many stars (1 to 5). Providers without a rating are left out when you set it."
          },
          "maxRating": {
            "title": "Maximum star rating",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Keep only providers with at most this many stars. Use 2 to find the weakest providers."
          },
          "ownershipContains": {
            "title": "Ownership contains",
            "type": "string",
            "description": "Keep only providers whose ownership type contains this text, for example For profit, Government or Non profit."
          },
          "hospitalTypes": {
            "title": "Hospital types",
            "type": "array",
            "description": "Hospitals mode only. Keep only these kinds of hospitals, for example Acute Care, Critical Access, Childrens or Psychiatric.",
            "items": {
              "type": "string"
            }
          },
          "emergencyServicesOnly": {
            "title": "Hospitals with emergency services only",
            "type": "boolean",
            "description": "Hospitals mode only.",
            "default": false
          },
          "birthingFriendlyOnly": {
            "title": "Birthing friendly hospitals only",
            "type": "boolean",
            "description": "Hospitals mode only. Keep hospitals with the CMS birthing friendly designation.",
            "default": false
          },
          "includeMeasures": {
            "title": "Add quality measures",
            "type": "boolean",
            "description": "Hospitals and hospices mode. Adds mortality, complications, readmissions, infections, patient survey, spending and timely care measures to each row. Turn it off for a fast list.",
            "default": true
          },
          "includeDeficiencySummary": {
            "title": "Add inspection finding counts",
            "type": "boolean",
            "description": "Nursing homes mode only. Adds the number of inspection findings, harm findings, immediate jeopardy findings and infection control findings for each home. Adds about 30 seconds.",
            "default": false
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "name",
              "ratingHighToLow",
              "ratingLowToHigh",
              "state"
            ],
            "type": "string",
            "description": "Order of the provider rows.",
            "default": "name"
          },
          "minSeverity": {
            "title": "Minimum severity (inspection findings)",
            "enum": [
              "A",
              "D",
              "G",
              "J"
            ],
            "type": "string",
            "description": "Inspection findings mode only. CMS scope and severity letter: D and above is more than minimal harm, G and above is actual harm, J and above is immediate jeopardy."
          },
          "onlyInfectionControl": {
            "title": "Infection control findings only",
            "type": "boolean",
            "description": "Inspection findings mode only.",
            "default": false
          },
          "dateFrom": {
            "title": "From date",
            "type": "string",
            "description": "Inspection findings and penalties only. First survey or penalty date, written YYYY-MM-DD."
          },
          "dateTo": {
            "title": "To date",
            "type": "string",
            "description": "Inspection findings and penalties only. Last survey or penalty date, written YYYY-MM-DD."
          },
          "minFineUsd": {
            "title": "Minimum fine (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Penalties mode only. Keep only fines of at least this amount."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}