{"openapi":"3.1.0","info":{"title":"Due Date","version":"1.0.0","summary":"The dating wheel, with the assumptions it hides made explicit.","description":"Estimate a due date from a last menstrual period, a known conception or transfer date, or an ultrasound measurement — then see what the estimate actually rests on. Adjusts Naegele's rule for cycle length, applies the ACOG thresholds for when an ultrasound should replace period-based dating, and reports gestational age, trimester boundaries, and the term windows.\n\n**Not for:** Not medical advice and not a substitute for clinical dating by a qualified clinician. This is arithmetic on the dates you supply; it cannot see an ultrasound, a chart, or a person, and it does not know about multiples, irregular cycles beyond the length you enter, or any complication. Estimated dates are estimates — a small minority of births happen on them.\n\nFree tier: 250 calls per UTC day per caller. Past that, endpoints return 402 with x402 payment requirements. An MCP server exposing the same capabilities is available at https://due-date.gumballtools.com/api/mcp.","contact":{"url":"https://github.com/bwalvoord/gumball"}},"servers":[{"url":"https://due-date.gumballtools.com","description":"Production"}],"externalDocs":{"url":"https://due-date.gumballtools.com/llms-full.txt","description":"Full documentation for agents"},"paths":{"/api/v1/estimate":{"get":{"operationId":"estimateDueDate","summary":"The dating wheel, with the assumptions it hides made explicit.","description":"Returns the estimated due date, gestational age in weeks-plus-days, the estimated conception date, dated milestones for every ACOG term boundary, the redating comparison when both a period date and a scan are supplied, warnings, and a not-medical-advice disclaimer in the payload.","parameters":[{"name":"method","in":"query","required":true,"description":"How the pregnancy is being dated. `lmp` adds 280 days (plus a cycle-length adjustment); `conception` adds 266; `ivf-day3` adds 263; `ivf-day5` adds 261; `ultrasound` works backwards from the measured gestational age.","schema":{"type":"string","enum":["lmp","conception","ivf-day3","ivf-day5","ultrasound"]}},{"name":"date","in":"query","required":true,"description":"The date the method is based on: first day of the last period, conception date, transfer date, or scan date. Free-form dates are refused, not guessed.","schema":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"cycleLength","in":"query","required":false,"description":"Cycle length in days. Only affects `lmp`. Naegele's rule assumes 28; a 35-day cycle moves the estimate a week later.","schema":{"type":"integer","minimum":20,"maximum":45,"default":28}},{"name":"scanWeeks","in":"query","required":false,"description":"For `ultrasound`: weeks part of the gestational age the scan reported.","schema":{"type":"integer","minimum":0,"maximum":42}},{"name":"scanDays","in":"query","required":false,"description":"For `ultrasound`: days part of the measured gestational age.","schema":{"type":"integer","minimum":0,"maximum":6}},{"name":"lmp","in":"query","required":false,"description":"For `ultrasound`: the last menstrual period, which enables the ACOG Committee Opinion 700 redating check against the scan.","schema":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"asOf","in":"query","required":false,"description":"Reference date for gestational age. Defaults to today (UTC).","schema":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"The estimate.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input. The body names the field and how to fix it.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","fix_hint","docs"],"properties":{"code":{"type":"string","description":"Stable machine-readable error code."},"message":{"type":"string"},"fix_hint":{"type":"string","description":"What to change before retrying."},"field":{"type":"string"},"token":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}},"docs":{"type":"string","format":"uri"}}}}}}}},"402":{"description":"Free quota of 250 calls per UTC day exhausted. Body is an x402 v1 payment requirement ($0.001 per call). While settlement is disabled the body carries payment_enabled: false and the call cannot be unblocked by paying — wait for quota.resetsAt.","content":{"application/json":{"schema":{"type":"object"}}}}}}}}}