{
  "openapi": "3.0.1",
  "info": {
    "title": "CMS Home Health & Hospice Lookup",
    "description": "One event per home health agency or hospice: CMS Care Compare star ratings, patient-survey stars, quality measures with periods, services, ownership and contact details, filtered by state, ZIP, city, CCN, ownership, services or rating. Optional verified NPI match and change watch.",
    "version": "0.1",
    "x-build-id": "G2dv3qfkGEtXLwdlo"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sovereign_workspace~cms-home-health-hospice-lookup/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sovereign_workspace-cms-home-health-hospice-lookup",
        "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/sovereign_workspace~cms-home-health-hospice-lookup/runs": {
      "post": {
        "operationId": "runs-sync-sovereign_workspace-cms-home-health-hospice-lookup",
        "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/sovereign_workspace~cms-home-health-hospice-lookup/run-sync": {
      "post": {
        "operationId": "run-sync-sovereign_workspace-cms-home-health-hospice-lookup",
        "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": {
          "profile": {
            "title": "Operator profile",
            "enum": [
              "standard",
              "smoke"
            ],
            "type": "string",
            "description": "Named config preset applied at start. Any field you set explicitly below overrides the preset."
          },
          "provider_types": {
            "title": "Provider types",
            "type": "array",
            "description": "Which CMS provider types to return. Leave empty for both.",
            "items": {
              "type": "string",
              "enum": [
                "home_health",
                "hospice"
              ],
              "enumTitles": [
                "Home health agencies",
                "Hospices"
              ]
            }
          },
          "states": {
            "title": "States (2-letter)",
            "type": "array",
            "description": "Two-letter state codes, e.g. VT, NY.",
            "items": {
              "type": "string"
            }
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "City names as CMS spells them (matched in capitals, e.g. BURLINGTON).",
            "items": {
              "type": "string"
            }
          },
          "zips": {
            "title": "ZIP codes",
            "type": "array",
            "description": "5-digit ZIP codes of the agency's listed address.",
            "items": {
              "type": "string"
            }
          },
          "ccns": {
            "title": "CMS Certification Numbers (CCN)",
            "type": "array",
            "description": "6-character CCNs, e.g. 477000 (home health) or 471500 (hospice).",
            "items": {
              "type": "string"
            }
          },
          "name_contains": {
            "title": "Name contains",
            "type": "string",
            "description": "Part of the agency name as CMS lists it (not case-sensitive)."
          },
          "ownership": {
            "title": "Ownership",
            "type": "array",
            "description": "CMS ownership type, normalized across both provider types.",
            "items": {
              "type": "string",
              "enum": [
                "for_profit",
                "non_profit",
                "government",
                "other",
                "combination"
              ],
              "enumTitles": [
                "For-profit",
                "Non-profit",
                "Government",
                "Other (hospice only)",
                "Combination government & non-profit (hospice only)"
              ]
            }
          },
          "services": {
            "title": "Services offered (home health only)",
            "type": "array",
            "description": "Only agencies that offer every listed service. Home health only: set Provider types to home health.",
            "items": {
              "type": "string",
              "enum": [
                "nursing",
                "physical_therapy",
                "occupational_therapy",
                "speech_pathology",
                "medical_social",
                "home_health_aide"
              ],
              "enumTitles": [
                "Nursing care",
                "Physical therapy",
                "Occupational therapy",
                "Speech pathology",
                "Medical social services",
                "Home health aide"
              ]
            }
          },
          "min_quality_star": {
            "title": "Minimum quality-of-care star (home health only)",
            "enum": [
              "",
              "1",
              "1.5",
              "2",
              "2.5",
              "3",
              "3.5",
              "4",
              "4.5",
              "5"
            ],
            "type": "string",
            "description": "Home health quality of patient care star rating, in half stars. Unrated agencies never match."
          },
          "min_survey_star": {
            "title": "Minimum patient-survey star",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "HHCAHPS (home health) or CAHPS Hospice summary star rating. Unrated agencies never match."
          },
          "include_measures": {
            "title": "Include quality & survey measures",
            "type": "boolean",
            "description": "Add the quality measures (with CMS measure periods), survey topic results and the hospice profile to each record.",
            "default": true
          },
          "enrich_npi": {
            "title": "Match organization NPI (NPPES)",
            "type": "boolean",
            "description": "Look up the agency's organization NPI in NPPES. Filled only when the match is verifiable or unambiguous; each record says how it matched. About a third of agencies get an NPI.",
            "default": false
          },
          "changes_only": {
            "title": "Watch: changes only",
            "type": "boolean",
            "description": "Report only agencies whose star ratings, ownership, phone or address changed since the last run for the same filters. The first run records a baseline and returns nothing.",
            "default": false
          },
          "state_key": {
            "title": "Watch name (optional)",
            "type": "string",
            "description": "Name for this watch's saved state. Leave empty to derive it from the filters."
          },
          "allow_mass_removal": {
            "title": "Accept a mass removal",
            "type": "boolean",
            "description": "Watch mode stops, charging nothing, if more than 20% of 25+ watched agencies vanish at once (usually a CMS feed gap). Turn on to accept it.",
            "default": false
          },
          "limit": {
            "title": "Max records",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of agency records per run.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}