Get up and running with the MedExtract API in under 5 minutes. Parse your first lab report, receive LOINC-coded results, and export a FHIR R4 bundle.
Sign up for a MedExtract account at dashboard.medextract.ai and navigate to Settings → API Keys. Create a new key and copy it. You will need to include this key in the X-API-Key header of every authenticated request.
Keep your API key secret. Do not expose it in client-side code or commit it to version control. Use environment variables in production.
Upload a lab report PDF to the /v1/lab/parse-pdf endpoint. The API will process the document, extract test results, match them to LOINC codes, and return structured JSON.
curl -X POST https://api.medextract.ai/v1/lab/parse-pdf \ -H "X-API-Key: your-api-key" \ -F "file=@lab-report.pdf" \ -F "dpi=300"The API returns a LabReportModel with patient demographics, organized sections containing individual test results, a summary, and processing metadata. Each result includes the original Spanish name, English translation, LOINC code, reference ranges, and clinical interpretation.
{ "patient": { "name": "Juan Garcia", "age": 45, "sex": "M", "date": "2026-02-20" }, "sections": [ { "name": "Hematologia", "results": [ { "test_name": "Hemoglobina", "test_name_en": "Hemoglobin", "value": "14.2", "numeric_value": 14.2, "unit": "g/dL", "unit_ucum": "g/dL", "reference_range": "13.0 - 17.0", "reference_low": 13.0, "reference_high": 17.0, "loinc_code": "718-7", "panel": "CBC", "interpretation": "normal", "flag": null, "plausibility": "plausible", "confidence": 0.97, "needs_review": false }, { "test_name": "Glucosa", "test_name_en": "Glucose", "value": "126", "numeric_value": 126, "unit": "mg/dL", "unit_ucum": "mg/dL", "reference_range": "70 - 100", "reference_low": 70, "reference_high": 100, "loinc_code": "2345-7", "panel": "BMP", "interpretation": "high", "flag": "H", "plausibility": "plausible", "confidence": 0.95, "needs_review": true } ] } ], "summary": { "total_tests": 2, "flagged": 1, "needs_review": 1 }, "metadata": { "engine": "primary", "processing_time_ms": 1243, "confidence_mean": 0.96 }}If your system consumes FHIR R4, use the /v1/lab/fhir endpoint instead. It returns a standard FHIR Bundle with Patient and Observation resources, ready for integration with any FHIR-compliant EHR.
curl -X POST https://api.medextract.ai/v1/lab/fhir \ -H "X-API-Key: your-api-key" \ -F "file=@lab-report.pdf"{ "resourceType": "Bundle", "type": "collection", "entry": [ { "resource": { "resourceType": "Patient", "name": [{ "text": "Juan Garcia" }], "gender": "male", "birthDate": "1981-01-01" } }, { "resource": { "resourceType": "Observation", "status": "final", "code": { "coding": [ { "system": "http://loinc.org", "code": "718-7", "display": "Hemoglobin" } ], "text": "Hemoglobina" }, "valueQuantity": { "value": 14.2, "unit": "g/dL", "system": "http://unitsofmeasure.org", "code": "g/dL" }, "interpretation": [ { "coding": [ { "system": "http://hl7.org/fhir/v3/ObservationInterpretation", "code": "N", "display": "Normal" } ] } ] } } ]}Now that you have made your first request, explore the full API.