{
  "openapi": "3.0.1",
  "info": {
    "title": "Nursing Home Deficiency Citations (CMS) Scraper",
    "description": "Nursing home deficiency citations from CMS: every health inspection violation (F-tag) for every US nursing home, about 418,000 records, with scope/severity decoded and correction status. Filter by state, CCN, facility, survey date, severity, tag or cycle. $0.003/record.",
    "version": "1.0",
    "x-build-id": "ldb6oiUNGpDrd9pl8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jserle~nursing-home-deficiency-citations/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jserle-nursing-home-deficiency-citations",
        "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/jserle~nursing-home-deficiency-citations/runs": {
      "post": {
        "operationId": "runs-sync-jserle-nursing-home-deficiency-citations",
        "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/jserle~nursing-home-deficiency-citations/run-sync": {
      "post": {
        "operationId": "run-sync-jserle-nursing-home-deficiency-citations",
        "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": {
          "states": {
            "title": "States",
            "uniqueItems": true,
            "type": "array",
            "description": "Two-letter postal codes, matched exactly. Example: NY, NJ, CT. Leave blank for all states and territories.",
            "items": {
              "type": "string"
            }
          },
          "ccns": {
            "title": "CMS Certification Numbers (CCNs)",
            "uniqueItems": true,
            "type": "array",
            "description": "Six-character CMS Certification Numbers, matched exactly, for tracking a specific facility or a portfolio of them. Example: 015009. Keep the leading zero.",
            "items": {
              "type": "string"
            }
          },
          "providerNameContains": {
            "title": "Provider name contains",
            "type": "string",
            "description": "Case-insensitive substring matched against the facility name. Example: MANOR. Useful for tracking a chain across states."
          },
          "surveyDateFrom": {
            "title": "Survey date from",
            "type": "string",
            "description": "Keep citations from surveys on or after this date. ISO format, for example 2026-01-01."
          },
          "surveyDateTo": {
            "title": "Survey date to",
            "type": "string",
            "description": "Keep citations from surveys on or before this date. ISO format, for example 2026-06-30."
          },
          "scopeSeverityCodes": {
            "title": "Scope and severity codes",
            "uniqueItems": true,
            "type": "array",
            "description": "Single letters A to L, matched exactly. In CMS's scope/severity grid, J, K and L are immediate jeopardy to resident health or safety; G, H and I are actual harm that is not immediate jeopardy. Each delivered record also carries the decoded severity and scope.",
            "items": {
              "type": "string"
            }
          },
          "tagPrefix": {
            "title": "Deficiency tag prefix",
            "type": "string",
            "description": "A single letter, matched exactly. Every citation in this dataset is an F-tag (health deficiency); K and E tags are fire safety and live in a separate CMS dataset. Leave blank unless CMS starts publishing another prefix here."
          },
          "tagNumbers": {
            "title": "Deficiency tag numbers",
            "uniqueItems": true,
            "type": "array",
            "description": "Four-digit tag numbers, matched exactly, without the prefix. Example: 0689 (accident hazards and supervision), 0600 (free from abuse and neglect), 0684 (quality of care).",
            "items": {
              "type": "string"
            }
          },
          "inspectionCycles": {
            "title": "Inspection cycles",
            "uniqueItems": true,
            "type": "array",
            "description": "1, 2 or 3, where 1 is the most recent cycle. Standard cycles are counted sequentially into the past and complaint cycles annually into the past.",
            "items": {
              "type": "string"
            }
          },
          "surveyKind": {
            "title": "Survey kind",
            "enum": [
              "any",
              "standard",
              "complaint",
              "infectionControl"
            ],
            "type": "string",
            "description": "Restrict to citations found on one kind of inspection. A citation can be flagged on more than one, and every record carries all three flags regardless of this filter.",
            "default": "any"
          },
          "maxResults": {
            "title": "Maximum records",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "How many citations to deliver, most recent survey first. You are charged per delivered record, so this is also your cost cap.",
            "default": 100
          },
          "includeRaw": {
            "title": "Include the raw source row",
            "type": "boolean",
            "description": "Attach a `raw` object holding the CMS columns under their original snake_case names, exactly as the API returned them. Useful for auditing the normalization; roughly doubles item size.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}