{
  "openapi": "3.1.0",
  "info": {
    "title": "dotMD Primary-Source Clinical & Health Price Intelligence API",
    "version": "2026.11.28",
    "description": "Independent, ad-free clinical reference API grounded in FDA DailyMed, CMS NADAC wholesale drug pricing, NIH DSLD v9 supplement stoichiometry, PubMed trials, 927K CMS NPI physicians, and dotMD Real-World Patient Consensus. Educational only; every response returns mandatory primary sources and physician-first disclaimers.",
    "contact": {
      "name": "dotMD Research & API Desk",
      "email": "audit@dotmd.com",
      "url": "https://dotmd.com/developers"
    },
    "license": {
      "name": "CC BY 4.0 (Attribution Required)",
      "url": "https://creativecommons.org/licenses/by/4.0/"
    }
  },
  "servers": [
    {
      "url": "https://dotmd.com",
      "description": "dotMD Production Edge API"
    }
  ],
  "paths": {
    "/api/v1/drugs": {
      "get": {
        "operationId": "getDrugMonograph",
        "summary": "Look up FDA medication monograph, CMS NADAC price & real-world consensus",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "metformin"
          }
        ],
        "responses": {
          "200": {
            "description": "Grounded medication dossier with sources and disclaimer"
          }
        }
      }
    },
    "/api/v1/prices": {
      "get": {
        "operationId": "comparePrices",
        "summary": "Compare CMS NADAC 30-day wholesale floor vs. pharmacy retail/paid price",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "pantoprazole"
          },
          {
            "name": "paid",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "example": 42
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                30,
                90
              ]
            },
            "example": 30
          }
        ],
        "responses": {
          "200": {
            "description": "Markup multiplier, annual overpay, and 3-step pharmacist script"
          }
        }
      }
    },
    "/api/v1/labs/explain": {
      "get": {
        "operationId": "explainLab",
        "summary": "Explain a blood lab marker across 3 clinical zones (portal normal vs. guideline target)",
        "parameters": [
          {
            "name": "marker",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "ferritin"
          },
          {
            "name": "value",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "example": 18
          }
        ],
        "responses": {
          "200": {
            "description": "3-zone clinical explanation and doctor visit questions"
          }
        }
      }
    },
    "/api/v1/timing": {
      "get": {
        "operationId": "checkPillTiming",
        "summary": "Build a 24-hour conflict-free pill and supplement spacing schedule",
        "parameters": [
          {
            "name": "items",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "levothyroxine,coffee,vitd3,magnesium"
          }
        ],
        "responses": {
          "200": {
            "description": "FDA/NIH absorption alerts and 4-slot daily schedule"
          }
        }
      }
    },
    "/api/v1/supplements": {
      "get": {
        "operationId": "auditSupplement",
        "summary": "Audit NIH DSLD elemental yield stoichiometry and real-world consensus",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "magnesium glycinate"
          }
        ],
        "responses": {
          "200": {
            "description": "Stoichiometry, label trap alerts, and real-world consensus"
          }
        }
      }
    },
    "/api/v1/doctors": {
      "get": {
        "operationId": "findDoctors",
        "summary": "Search 927K CMS NPI verified physicians by specialty and state/city/ZIP",
        "parameters": [
          {
            "name": "specialty",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "cardiology"
          },
          {
            "name": "location",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "TX"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "example": 8
          }
        ],
        "responses": {
          "200": {
            "description": "Verified CMS NPI physicians ranked by objective Medicare volume"
          }
        }
      }
    },
    "/api/v1/trials": {
      "get": {
        "operationId": "summarizeTrial",
        "summary": "Search 6,900+ PubMed clinical trials with rigor scores and PMIDs",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "apixaban"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "example": 5
          }
        ],
        "responses": {
          "200": {
            "description": "Peer-reviewed trial summaries with PubMed & dotMD links"
          }
        }
      }
    },
    "/api/v1/visit-prep": {
      "post": {
        "operationId": "buildVisitPrep",
        "summary": "Assemble a grounded doctor-visit preparation checklist (human confirmation required)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "meds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "supplements": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "labs": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "marker": {
                          "type": "string"
                        },
                        "value": {
                          "type": "number"
                        }
                      }
                    }
                  },
                  "chief_question": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Structured doctor appointment checklist with sources and disclaimer"
          }
        }
      }
    },
    "/api/v1/ask": {
      "post": {
        "operationId": "askDotMd",
        "summary": "Ask a natural-language question grounded in dotMD primary federal datasets and consensus reports",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "q": {
                    "type": "string"
                  }
                },
                "required": [
                  "q"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Grounded answer, canonical links, sources, and mandatory disclaimer"
          }
        }
      }
    }
  }
}