{
  "openapi": "3.0.1",
  "info": {
    "title": "CMS Medicare Data Scraper - data.cms.gov API",
    "description": "Pull any of the 395 Medicare and Medicaid datasets on data.cms.gov: 3.4M clinicians, provider enrollment and ownership, hospital and nursing home quality, Part B/Part D utilisation and drug spending. Server-side filters, no API key.",
    "version": "0.1",
    "x-build-id": "9urR5SsSeGmLkbWi5"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/parseforge~cms-medicare-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-parseforge-cms-medicare-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/parseforge~cms-medicare-scraper/runs": {
      "post": {
        "operationId": "runs-sync-parseforge-cms-medicare-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/parseforge~cms-medicare-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-parseforge-cms-medicare-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": [
          "dataset"
        ],
        "properties": {
          "dataset": {
            "title": "Dataset",
            "enum": [
              "catalog",
              "doctors-clinicians",
              "clinician-affiliations",
              "clinician-utilization",
              "provider-enrollment",
              "order-and-referring",
              "opt-out-affidavits",
              "revoked-providers",
              "revalidation-due-date",
              "revalidation-reassignment",
              "revalidation-clinic-groups",
              "pending-physicians",
              "pending-non-physicians",
              "missing-digital-contact",
              "taxonomy-crosswalk",
              "hospital-enrollments",
              "hospital-owners",
              "hospital-change-of-ownership",
              "snf-enrollments",
              "snf-owners",
              "snf-change-of-ownership",
              "home-health-enrollments",
              "home-health-owners",
              "hospice-enrollments",
              "hospice-owners",
              "rural-health-clinic-enrollments",
              "rural-health-clinic-owners",
              "fqhc-enrollments",
              "fqhc-owners",
              "opioid-treatment-programs",
              "home-infusion-providers",
              "provider-of-services-labs",
              "provider-of-services-facilities",
              "hospitals",
              "hospital-patient-survey",
              "hospital-complications-deaths",
              "hospital-infections",
              "hospital-readmissions",
              "hospital-timely-effective-care",
              "hospital-outpatient-imaging",
              "hospital-value-based-purchasing",
              "hospital-spending-per-beneficiary",
              "hospital-maternal-health",
              "nursing-homes",
              "nursing-home-ownership",
              "nursing-home-deficiencies",
              "nursing-home-fire-safety",
              "nursing-home-penalties",
              "nursing-home-quality-measures",
              "nursing-home-claims-measures",
              "nursing-home-survey-summary",
              "home-health-agencies",
              "home-health-patient-survey",
              "hospices",
              "hospice-provider-data",
              "dialysis-facilities",
              "inpatient-rehab-facilities",
              "long-term-care-hospitals",
              "medical-equipment-suppliers",
              "ambulatory-surgical-centers",
              "inpatient-psychiatric-facilities",
              "physician-by-provider",
              "physician-by-provider-service",
              "physician-by-geography",
              "inpatient-by-provider",
              "inpatient-by-provider-service",
              "outpatient-by-provider-service",
              "dme-by-supplier",
              "dme-by-referring-provider",
              "physician-supplier-procedure-summary",
              "part-d-prescribers",
              "part-d-prescribers-by-drug",
              "part-d-by-geography-drug",
              "part-d-opioid-rates",
              "medicaid-opioid-rates",
              "part-d-spending-by-drug",
              "part-b-spending-by-drug",
              "medicaid-spending-by-drug",
              "part-b-discarded-drug-units",
              "medicare-monthly-enrollment",
              "geographic-variation",
              "medicare-advantage-geographic-variation",
              "market-saturation",
              "hospital-service-area",
              "telehealth-trends",
              "hospital-cost-report",
              "snf-cost-report",
              "home-health-cost-report",
              "aco-participants",
              "accountable-care-organizations",
              "aco-financial-quality-results",
              "quality-payment-program",
              "medicare-covid-hospitalization",
              "custom"
            ],
            "type": "string",
            "description": "Which data.cms.gov dataset to pull. 92 datasets are wired up with named filters; every other dataset on the portal is reachable through \"Custom\". \"Catalog\" returns the metadata of all 395 datasets instead of data rows. Each group bills its own per-row event, so you only pay for the one you asked for.",
            "default": "doctors-clinicians"
          },
          "maxItems": {
            "title": "Max rows",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many rows. The row limit is the spending ceiling: nothing beyond it is written or billed. Free-plan runs are capped at 25 rows.",
            "default": 100
          },
          "state": {
            "title": "State",
            "type": "string",
            "description": "Two-letter state code, e.g. \"CA\". Applied by CMS on its own server. Available on 70 of the 92 datasets — the ones whose rows carry a state."
          },
          "city": {
            "title": "City",
            "type": "string",
            "description": "City or town, matched as a substring so \"SAN\" finds San Diego and San Jose. Available on 56 datasets."
          },
          "zipCode": {
            "title": "ZIP code",
            "type": "string",
            "description": "Five-digit ZIP. About half the CMS files store ZIP+4, so the query goes out as a prefix match and rows whose ZIP does not actually start with yours are dropped before they are written or billed. Available on 56 datasets."
          },
          "npi": {
            "title": "NPI",
            "type": "string",
            "description": "A single 10-digit National Provider Identifier, matched exactly. Available on 30 datasets."
          },
          "ccn": {
            "title": "CCN / provider number",
            "type": "string",
            "description": "CMS Certification Number — the six-character facility id used across Care Compare, cost reports and the Provider of Services file. Available on 46 datasets."
          },
          "providerName": {
            "title": "Provider or facility name",
            "type": "string",
            "description": "Substring of the organisation, facility or group name. Case-insensitive. Available on 60 datasets — the person-level files expose the surname as Clinician last name instead."
          },
          "lastName": {
            "title": "Clinician last name",
            "type": "string",
            "description": "Substring of an individual clinician's surname, for the person-level files. Available on 22 datasets."
          },
          "specialty": {
            "title": "Specialty / provider type",
            "type": "string",
            "description": "Substring of the specialty or provider-type column, e.g. \"Cardio\" or \"Nurse Practitioner\". Available on 17 datasets."
          },
          "drugName": {
            "title": "Drug name",
            "type": "string",
            "description": "Brand or generic drug name, matched as a substring, on the Part B, Part D and Medicaid drug files. Available on 6 datasets."
          },
          "hcpcsCode": {
            "title": "HCPCS code",
            "type": "string",
            "description": "A single HCPCS / CPT procedure code, matched exactly, on the service-level utilisation files. Available on 5 datasets."
          },
          "geography": {
            "title": "Geography",
            "type": "string",
            "description": "For the geography-level files, whose rows are a state or county rather than a provider: the geography description, e.g. \"California\" or \"Los Angeles\". Available on 7 datasets."
          },
          "year": {
            "title": "Year",
            "minimum": 1990,
            "maximum": 2100,
            "type": "integer",
            "description": "Data year. On the 7 datasets that carry a year column this filters the rows; on the rest of the main CMS catalog it switches to that year's published version of the file — the Part D and Physician files go back to 2013. Datasets in the Provider Data Catalog have no archive and reject this."
          },
          "search": {
            "title": "Full-text search",
            "type": "string",
            "description": "Free-text search across every column of the dataset, run by CMS. Main CMS catalog only — the Provider Data Catalog has no keyword endpoint and the run stops with a message rather than ignoring this."
          },
          "filters": {
            "title": "Custom filters",
            "type": "array",
            "description": "One expression per line, applied on top of the named filters above and ANDed together. Write them as \"Column operator value\" using = != > >= < <= contains in \"not in\" or between, e.g. \"Tot_Clms > 1000\", \"Prscrbr_State_Abrvtn in CA,NY,TX\", \"Brnd_Name contains OZEMPIC\". A column that does not exist stops the run and lists the ones that do.",
            "items": {
              "type": "string"
            }
          },
          "columns": {
            "title": "Columns",
            "type": "array",
            "description": "Only return these columns. Leave empty for every column. Narrowing the projection makes wide files (up to 473 columns) far faster to pull.",
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Sort by",
            "type": "string",
            "description": "Column to order by, applied by CMS. Combine with Max rows to take the top N — e.g. sort Part D prescribers by Tot_Drug_Cst descending."
          },
          "sortOrder": {
            "title": "Sort direction",
            "enum": [
              "asc",
              "desc"
            ],
            "type": "string",
            "description": "Direction for Sort by.",
            "default": "asc"
          },
          "catalogSource": {
            "title": "Catalogs to list",
            "enum": [
              "both",
              "main",
              "pdc"
            ],
            "type": "string",
            "description": "Which of the two catalogs to list in Catalog mode. CMS Data is the 159-dataset open-data portal; the Provider Data Catalog is the 236-dataset Care Compare feed. Ignored unless Dataset is \"Catalog\".",
            "default": "both"
          },
          "catalogSearch": {
            "title": "Catalog search",
            "type": "string",
            "description": "Keep only datasets whose title, description, keywords or theme contain this text."
          },
          "catalogTheme": {
            "title": "Catalog theme",
            "type": "string",
            "description": "Keep only datasets in a theme or keyword, e.g. \"Nursing homes\", \"Hospitals\", \"Medicare\", \"Dialysis facilities\"."
          },
          "catalogModifiedAfter": {
            "title": "Modified after",
            "type": "string",
            "description": "Keep only datasets CMS updated on or after this date (YYYY-MM-DD). Use it to poll the portal for refreshed files."
          },
          "onlyQueryable": {
            "title": "Only datasets with a live API",
            "type": "boolean",
            "description": "Drop the 28 datasets CMS publishes as ZIP or XLSX only, which this Actor can list but not query row by row.",
            "default": false
          },
          "includeFields": {
            "title": "Include the data dictionary",
            "type": "boolean",
            "description": "Also emit one row per column of the dataset, with its machine name, human label, SQL type and position. Billed as Data dictionary field. Off by default.",
            "default": false
          },
          "includeResources": {
            "title": "Include the downloadable files",
            "type": "boolean",
            "description": "Also emit one row per file CMS attaches to the dataset — the current CSV, every dated archive, and the data-dictionary PDF — with its URL and size. Billed as Dataset file. Off by default.",
            "default": false
          },
          "customDatasetId": {
            "title": "Custom dataset ID",
            "type": "string",
            "description": "Only used when Dataset is \"Custom\". Either a main-catalog UUID (the id in https://data.cms.gov/data-api/v1/dataset/<uuid>/data) or a Provider Data Catalog id such as xubh-q36u. A full dataset URL works too."
          },
          "customCatalog": {
            "title": "Which catalog the ID belongs to",
            "enum": [
              "auto",
              "main",
              "pdc"
            ],
            "type": "string",
            "description": "Leave on Auto: a 36-character UUID is looked up in the CMS Data catalog, anything else in the Provider Data Catalog.",
            "default": "auto"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}