DDXaid API Docs

Use these endpoints to integrate DDXaid’s differential diagnosis engine into your application. Includespecialty to select rule sets (default ob for OB/MFM).

Analyze

POST /api/ddx/analyze

Request body (OB example):

{
  "specialty": "ob",
  "ultrasound_findings": [
    { "name": "EFW <10th percentile", "present": true },
    { "name": "Umbilical artery PI elevated", "present": true },
    { "name": "AFI normal", "present": true }
  ],
  "context": { "gestational_age_weeks": 28 }
}

cURL:

curl -X POST http://localhost:3000/api/ddx/analyze   -H "Content-Type: application/json"   -d '{
    "specialty":"ob",
    "ultrasound_findings":[{"name":"EFW <10th percentile","present":true}, {"name":"Umbilical artery PI elevated","present":true}, {"name":"AFI normal","present":true}],
    "context":{"gestational_age_weeks":28}
  }'

JS fetch:

const res = await fetch('/api/ddx/analyze', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify(payload)
});
const session = await res.json();

Update

POST /api/ddx/update

Apply clinician decisions:

{
  "sessionId": "<id>",
  "decisions": [
    { "code": "fgr", "status": "ruled_in" },
    { "code": "pas", "set_criteria": [{ "id": "doppler_normal", "satisfied": true }] }
  ]
}

Get Session

GET /api/ddx/get?sessionId=<id>

Fetch current state for continuation or audit.

curl "http://localhost:3000/api/ddx/get?sessionId=<id>"

Ophthalmology Example

POST /api/ddx/analyze

Request body (Oph example):

{
  "specialty": "oph",
  "ultrasound_findings": [
    { "name": "Eye pain", "present": true },
    { "name": "Halos around lights", "present": true },
    { "name": "Reduced visual acuity", "present": true },
    { "name": "Nausea", "present": true }
  ]
}
Clinical decision support; not a diagnosis.