{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ticexplorer-com/json-schema/ticexplorer-com-analytics-request-schema.json",
  "title": "AnalyticsRequest",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ticexplorer-com-openapi.json#/components/schemas/AnalyticsRequest",
  "properties": {
    "codes": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "maxItems": 20,
      "minItems": 1,
      "title": "Codes",
      "description": "1-20 CPT/HCPCS codes from find_codes. Codes that hospitals are paid per APC also bring in the hospitals' APC case rates."
    },
    "geography": {
      "$ref": "#/$defs/Geography"
    },
    "payers": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Payers",
      "description": "Insurer names as people say them (\"Premera\", \"Aetna\", \"Regence\", \"UnitedHealthcare\", \"Cigna\", \"Kaiser\"), catalog payer ids, or [\"major\"] = the largest insurers in this market (major_payers of them)."
    },
    "major_payers": {
      "type": "integer",
      "maximum": 8.0,
      "minimum": 1.0,
      "title": "Major Payers",
      "description": "How many insurers \"major\" means.",
      "default": 5
    },
    "files_per_payer": {
      "type": "integer",
      "maximum": 40.0,
      "minimum": 1.0,
      "title": "Files Per Payer",
      "description": "Most rate files read per insurer (in-area and most-used files first). More = more coverage, more first-time indexing (time, price).",
      "default": 8
    },
    "index_new_files": {
      "type": "boolean",
      "title": "Index New Files",
      "description": "false = read only files that are already indexed (fast, nearly free; coverage may be lower). true = also index the in-scope files that are not yet indexed.",
      "default": true
    },
    "providers": {
      "type": "string",
      "enum": [
        "relevant",
        "all"
      ],
      "title": "Providers",
      "description": "relevant = billing entities with evidence they provide the service (Medicare billing for the code, facility, hospital APC); all = also entities that merely hold a contracted rate.",
      "default": "relevant"
    },
    "include_providers": {
      "type": "boolean",
      "title": "Include Providers",
      "description": "Add the least / most expensive billing entities (name, TIN, site address, miles) to each result group.",
      "default": false
    },
    "providers_per_group": {
      "type": "integer",
      "maximum": 25.0,
      "minimum": 1.0,
      "title": "Providers Per Group",
      "default": 5
    },
    "max_price_usd": {
      "anyOf": [
        {
          "type": "number",
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Max Price Usd",
      "description": "Highest estimated usage charge (USD) the job may start with (default $1.00); above it the job is not started (409 price_confirmation_required)."
    }
  },
  "type": "object",
  "required": [
    "codes",
    "geography"
  ],
  "$defs": {
    "Geography": {
      "properties": {
        "zip": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Zip",
          "description": "5-digit ZIP at the center of a radius, e.g. 98052."
        },
        "miles": {
          "anyOf": [
            {
              "type": "number",
              "maximum": 100.0,
              "minimum": 1.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Miles",
          "description": "Radius around zip in miles (default 25)."
        },
        "metro": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Metro",
          "description": "Metro area name as in CMS CBSA names, e.g. \"Seattle\", \"Tacoma\", \"Denver-Aurora\" (a CBSA / metropolitan division)."
        },
        "cbsa": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cbsa",
          "description": "CBSA or metropolitan-division code, e.g. 42644 (Seattle-Bellevue-Kent, WA)."
        },
        "state": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "State",
          "description": "2-letter state, e.g. WA (large: slower and costlier than a metro or a radius)."
        }
      },
      "type": "object",
      "title": "Geography",
      "description": "The market: one of zip (+ miles), metro, cbsa or state."
    }
  }
}