AllThyroidEndocrine Knowledge Hub
AllThyroid Developer API v1

Clinical Decision API Reference

The AllThyroid.com API provides programmatically accessible, guideline-grade endocrine algorithms, thyroid hormone dosing rules, and diagnostic risk engines running at the Cloudflare edge.

Protected Server Logic

Algorithms, guideline adjustments, and dosage formulas execute securely on Cloudflare Pages Functions rather than in client-side bundles.

Attribution Guaranteed

Every response embeds the canonical source (https://allthyroid.com), medical disclaimer, and clinician review metadata.

Open CORS & High Speed

Edge-native execution with automated CORS preflight (OPTIONS) and sub-50ms response latencies globally.

Quickstart (cURL)No API key required for standard rate-limited tier
curl -X POST https://allthyroid.com/api/v1/calculate/levothyroxine \
  -H "Content-Type: application/json" \
  -d '{"weightKg": 70, "age": 45, "isPregnant": false, "hasCoronaryArteryDisease": false}'

Available Calculation Endpoints

Base URL: https://allthyroid.com

POST/api/v1/calculate/levothyroxine
Levothyroxine Dosage Calculator

Weight-based, age-adjusted, coronary artery disease, and pregnancy-adjusted levothyroxine starting dose calculation with commercial tablet matching.

Example Request Body
{
  "weightKg": 70,
  "age": 45,
  "isPregnant": false,
  "hasCoronaryArteryDisease": false,
  "goal": "replacement"
}
Sample Response
{
  "ok": true,
  "source": "https://allthyroid.com",
  "attribution": "Calculated by AllThyroid.com Clinical Decision Suite (https://allthyroid.com). Free use requires visible attribution and canonical link back.",
  "disclaimer": "For educational, informational, and clinical reference purposes only. Not a substitute for formal medical evaluation, diagnosis, or personalized treatment by a licensed physician or endocrinologist.",
  "data": {
    "exactDoseMcg": 112,
    "recommendedDailyTabletMcg": 112,
    "weeklyTotalDoseMcg": 784,
    "startingStrategy": "Full Weight-Based Replacement: Initiate with 112 mcg once daily (exact calculated requirement: 112.0 mcg/day).",
    "titrationAdvice": "Check serum TSH in 6 to 8 weeks. Adjust in 12.5 to 25 mcg increments until target TSH is achieved.",
    "warnings": [],
    "guidelineCitations": [
      "ATA/AACE Guidelines for Hypothyroidism in Adults (Garber et al., Endocr Pract 2012)"
    ]
  }
}
POST/api/v1/calculate/tsh
TSH Interpretation & Clinical Triage

Demographic and pregnancy trimester-adjusted interpretation of serum TSH and Free T4 levels with diagnostic categorisation and clinical next steps.

Example Request Body
{
  "tshMiuL": 7.8,
  "freeT4NgDl": 1.1,
  "age": 38,
  "isPregnant": false
}
Sample Response
{
  "ok": true,
  "source": "https://allthyroid.com",
  "data": {
    "category": "Subclinical Hypothyroidism",
    "expectedRange": "0.45 – 4.50 mIU/L",
    "interpretation": "Elevated TSH (7.8 mIU/L) with normal Free T4 (1.1 ng/dL).",
    "actionableSteps": [
      "Repeat TSH and FT4 with Anti-TPO antibodies in 6–12 weeks to confirm persistence",
      "Consider treatment if symptomatic, positive TPO antibodies, goiter, or planning pregnancy"
    ],
    "urgency": "monitoring"
  }
}
POST/api/v1/calculate/fti
Free Thyroxine Index (FTI)

Calculates the Free Thyroxine Index correcting Total T4 for variations in thyroid hormone-binding globulin (TBG).

Example Request Body
{
  "totalT4McgDl": 9.5,
  "tUptakePercent": 32
}
Sample Response
{
  "ok": true,
  "source": "https://allthyroid.com",
  "data": {
    "fti": 10.1,
    "referenceRange": "4.5 – 12.0",
    "status": "Normal (Euthyroid)",
    "explanation": "The Free Thyroxine Index (FTI) estimates free T4 by correcting total T4 for variations in thyroid hormone-binding globulin (TBG)."
  }
}
POST/api/v1/calculate/unit-converter
Thyroid Unit Converter

Converts thyroid panel laboratory test values between conventional and SI metric units (e.g., ng/dL ↔ pmol/L).

Example Request Body
{
  "analyte": "ft4",
  "value": 1.2,
  "fromUnit": "ng/dL",
  "toUnit": "pmol/L"
}
Sample Response
{
  "ok": true,
  "source": "https://allthyroid.com",
  "data": {
    "result": 15.44,
    "formula": "ng/dL × 12.87 = pmol/L"
  }
}
POST/api/v1/calculate/burch-wartofsky
Burch-Wartofsky Point Scale (BWPS)

Evaluates acute diagnostic scoring criteria for suspected Thyroid Storm crisis.

Example Request Body
{
  "tempScore": 10,
  "cnsScore": 10,
  "giScore": 10,
  "pulseScore": 15,
  "chfScore": 0,
  "afibScore": 0,
  "precipScore": 10
}
Sample Response
{
  "ok": true,
  "source": "https://allthyroid.com",
  "data": {
    "totalScore": 55,
    "riskLevel": "Highly Suggestive of Thyroid Storm",
    "clinicalAction": "CRITICAL MEDICAL EMERGENCY: Admit to ICU immediately. Initiate multimodal therapy.",
    "urgency": "critical"
  }
}
POST/api/v1/calculate/ti-rads
ACR TI-RADS Ultrasound Risk

Calculates American College of Radiology TI-RADS points, malignancy risk tier, and FNA biopsy criteria.

Example Request Body
{
  "composition": 2,
  "echogenicity": 2,
  "shape": 0,
  "margin": 0,
  "echogenicFoci": 3,
  "maxDiameterCm": 1.4
}
Sample Response
{
  "ok": true,
  "source": "https://allthyroid.com",
  "data": {
    "totalPoints": 7,
    "tiRadsLevel": "TR5",
    "malignancyRisk": "> 20% (Highly Suspicious)",
    "fnaRecommendation": "FNA Biopsy recommended (size ≥ 1.0 cm).",
    "followUpRecommendation": "Annual ultrasound surveillance recommended for 5 years."
  }
}

Attribution & Usage Policy

The AllThyroid Clinical Decision API is freely accessible for non-commercial clinical, research, and educational applications under the condition that any application displaying results visibly credits AllThyroid with a functional backlink:

Algorithm provided by <a href="https://allthyroid.com">AllThyroid.com</a> Clinical Decision Suite

Standard tier rate limits: 60 requests per minute per IP address. For dedicated institutional endpoints or custom batch clinical processing, contact support.