{
  "openapi": "3.0.1",
  "info": {
    "title": "HRSA HPSA & MUA Shortage Designation Monitor API",
    "description": "Monitor HRSA HPSA & MUA/MUP shortage designations from the official ArcGIS feed. Normalize the 3 HPSA disciplines + MUA into one row per designation; filter by state, discipline, score, rural; delta newly designated vs withdrawn; roll up by county, district or state.",
    "version": "1.0",
    "x-build-id": "gOBynZkgLftJCzAHX"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/malonestar~hrsa-shortage-designation-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-malonestar-hrsa-shortage-designation-monitor",
        "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/malonestar~hrsa-shortage-designation-monitor/runs": {
      "post": {
        "operationId": "runs-sync-malonestar-hrsa-shortage-designation-monitor",
        "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/malonestar~hrsa-shortage-designation-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-malonestar-hrsa-shortage-designation-monitor",
        "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": {
          "designationType": {
            "title": "Designation type",
            "enum": [
              "HPSA",
              "MUA",
              "all"
            ],
            "type": "string",
            "description": "Which HRSA shortage program to pull. HPSA = Health Professional Shortage Areas (point designations by discipline). MUA = Medically Underserved Areas/Populations (polygon designations). 'all' returns both.",
            "default": "HPSA"
          },
          "discipline": {
            "title": "HPSA discipline",
            "enum": [
              "all",
              "Primary Care",
              "Mental Health",
              "Dental"
            ],
            "type": "string",
            "description": "HPSA discipline to query (ignored for MUA). 'all' queries Primary Care, Mental Health, and Dental layers.",
            "default": "Primary Care"
          },
          "state": {
            "title": "State (full name)",
            "type": "string",
            "description": "Filter by full state name exactly as HRSA stores it, e.g. 'Alabama', 'California', 'Texas'. Leave blank for all states (large result set)."
          },
          "minScore": {
            "title": "Minimum shortage score",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Only return designations with a shortage score at or above this value. HPSA scores run 0-26 (higher = greater need, drives NHSC loan repayment / J-1 waiver priority). MUA/IMU scores run 0-100. Use 0 for no threshold.",
            "default": 0
          },
          "status": {
            "title": "Designation status",
            "type": "string",
            "description": "Optional exact status filter, e.g. 'Designated', 'Withdrawn', 'Proposed for Withdrawal'. Leave blank for all statuses."
          },
          "ruralStatus": {
            "title": "Rural status",
            "enum": [
              "any",
              "rural",
              "non-rural"
            ],
            "type": "string",
            "description": "Filter by rural classification. 'any' returns all; 'rural' or 'non-rural' filter to that class.",
            "default": "any"
          },
          "sinceDate": {
            "title": "Delta since date (YYYY-MM-DD)",
            "type": "string",
            "description": "Delta mode. When set, only returns designations that were newly Designated or newly Withdrawn on/after this date (compared against last-update and withdrawal dates). Adds a status_change field. A withdrawal = loss of Medicare originating-site / NHSC eligibility — a real recurring alert. Leave blank for a full snapshot."
          },
          "rollupBy": {
            "title": "Geo rollup",
            "enum": [
              "",
              "state",
              "county_fips",
              "congressional_district",
              "discipline"
            ],
            "type": "string",
            "description": "Optional aggregation. When set, output becomes one row per group with a designation count and average score instead of one row per designation.",
            "default": ""
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum number of designation records to fetch/emit (before rollup). Paginates the ArcGIS layers in pages of 1000.",
            "default": 5000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}