Getting Started

  • Introduction
  • Concepts & Glossary
  • Quickstart
  • Authentication

API Reference

  • Endpoints
  • Error Handling
  • Versioning

Guides

  • Code Examples
  • FHIR R4 Integration
  • Integration Patterns
  • Going to Production

Medical Content

  • Knowledge Base

Tools

  • Interactive Sandbox
  • API Status

Resources

  • FAQ
  • Changelog
  • Support
DevelopersAPI ReferenceEndpoints

Loading documentation…

AuthenticationError Handling
PearMedica Logo

The clinical intelligence layer built for African healthcare. Empowering providers with AI-driven triage and decision support.

Product

  • Symptom Assessment
  • Triage Engine
  • Decision Support
  • Pricing

Developers

  • Documentation
  • API Reference
  • Quickstart Guide
  • Code Examples

Company

  • About Us
  • Contact
  • Blog
  • Careers

Legal

  • Privacy Policy
  • Terms of Service
  • Security & Compliance
  • NDPA Compliance
NDPA 2023
AES-256 Encryption
Audit Logging

© 2026 PearMedica. All rights reserved.

Status

API Reference

Complete documentation for all 13 PearMedica v1 endpoints. All requests use JSON and require Authorization: Bearer <api_key> unless noted otherwise.

Base URL: https://api.pearmedica.com
Format: JSON
Rate Limit: 100 req/min
OpenAPI 3.1 Spec ↓

Pagination

List endpoints (GET /v1/symptoms, GET /v1/risk-factors, GET /v1/lab-tests) support offset-based pagination via two query parameters:

ParameterTypeDefaultDescription
limitinteger20Maximum results per page (1–50)
offsetinteger0Number of results to skip
GET /v1/symptoms?limit=10&offset=20

Responses include a total field so you can calculate total pages: Math.ceil(total / limit).

POST
/v1/assessBillableAPI Key (Bearer token)

Symptom Assessment

Core assessment endpoint. Accepts patient demographics and symptom evidence, returns differential diagnosis, triage level, and optional follow-up questions. Powers the conversational assessment loop.

Request Body

{
  "patient": {
    "age": 28,
    "sex": "female",
    "location": "lagos_nigeria"
  },
  "evidence": [
    { "id": "s_fever", "choice_id": "present", "source": "initial", "duration_days": 3 },
    { "id": "s_headache", "choice_id": "present", "source": "initial", "severity": "severe" }
  ],
  "risk_factors": [
    { "id": "rf_mosquito_exposure", "choice_id": "present" }
  ],
  "interview_id": "int_abc123"
}

Response

{
  "interview_id": "int_abc123",
  "conditions": [{ "name": "Malaria", "probability": 0.82, "icd10": "B50", "snomed_ct": "61462000", "rationale_one_line": "High fever with headache and mosquito exposure in Lagos is strongly suggestive of P. falciparum malaria." }],
  "triage": { "level": "urgent", "description": "Seek medical attention within 24 hours.", "timeframe": "within_24_hours", "recommended_specialist": { "id": "sp_internal_medicine", "name": "Internal Medicine" }, "recommended_channel": "personal_visit" },
  "should_stop": false,
  "next_question": { "id": "q_1", "text": "Have you travelled to a rural area recently?", "options": [{ "id": "yes", "label": "Yes" }, { "id": "no", "label": "No" }, { "id": "unknown", "label": "Not sure" }] },
  "red_flags_present": ["High fever (≥39°C) with severe headache"],
  "red_flags_watch_for": ["Confusion or altered consciousness", "Difficulty breathing"],
  "clinical_warnings": [],
  "recommended_investigations": [{ "priority": 1, "test_name": "Malaria RDT", "purpose": "Confirm P. falciparum infection", "urgency": "immediate" }],
  "nearest_facilities": [{ "name": "Lagos General Hospital", "distance_km": 2.3 }],
  "metadata": { "confidence": 0.87, "total_latency_ms": 1850, "escalation_tier": 3, "phi_tokenized": true },
  "disclaimer": "This assessment is generated by PearMDx AI and does not constitute a medical diagnosis."
}
POST
/v1/parseFreeAPI Key (Bearer token)

NLP Symptom Extraction

Extract structured symptoms and risk factors from free-text patient descriptions using NLP. Useful for chatbot and voice interfaces.

Request Body

{
  "text": "I have had fever and headaches for 3 days, with chills at night",
  "context": { "age": 28, "sex": "female", "location": "lagos_nigeria" }
}

Response

{
  "symptoms": [
    { "id": "s_fever", "name": "Fever", "confidence": 0.95, "duration_days": 3 },
    { "id": "s_headache", "name": "Headache", "confidence": 0.92, "duration_days": 3 },
    { "id": "s_chills", "name": "Chills", "confidence": 0.88 }
  ],
  "risk_factors": []
}
GET
/v1/symptomsFreeAPI Key (Bearer token)

List Symptoms

Returns the full catalogue of symptoms recognised by PearMedica, including IDs, common names, and categories.

Response

{
  "symptoms": [
    { "id": "s_fever", "name": "Fever", "common_name": "High temperature", "category": "general" },
    { "id": "s_headache", "name": "Headache", "common_name": "Head pain", "category": "neurological" }
  ],
  "total": 150
}
GET
/v1/risk-factorsFreeAPI Key (Bearer token)

List Risk Factors

Returns available risk factors (lifestyle, environmental, genetic) that can be submitted alongside symptoms for more accurate assessments.

Response

{
  "risk_factors": [
    { "id": "rf_mosquito_exposure", "name": "Mosquito exposure", "category": "environmental" },
    { "id": "rf_sickle_cell", "name": "Sickle cell trait", "category": "genetic" }
  ],
  "total": 40
}
GET
/v1/lab-testsFreeAPI Key (Bearer token)

List Lab Tests

Returns available lab tests that PearMedica may recommend as part of a triage assessment.

Response

{
  "lab_tests": [
    { "id": "lt_malaria_rdt", "name": "Malaria Rapid Diagnostic Test", "category": "infectious" },
    { "id": "lt_fbc", "name": "Full Blood Count", "category": "general" }
  ],
  "total": 25
}
GET
/v1/conditions/{id}FreeAPI Key (Bearer token)

Condition Detail

Returns detailed information about a specific condition, including description, prevalence data, symptoms, risk factors, treatment overview, and prevention tips.

Response

{
  "id": "c_malaria",
  "name": "Malaria (Plasmodium falciparum)",
  "description": "Parasitic infection transmitted by Anopheles mosquitoes...",
  "prevalence": { "global": "high", "africa": "very_high" },
  "symptoms": ["fever", "chills", "headache", "sweating"],
  "risk_factors": ["mosquito_exposure", "no_antimalarial_prophylaxis"],
  "treatment_overview": "Artemisinin-based combination therapy (ACT)",
  "resources": [{ "title": "WHO Malaria Guidelines", "url": "..." }]
}
GET
/v1/conditions/{id}/educationFreeAPI Key (Bearer token)

Patient Education

Returns plain-language patient education content for a specific condition. Localised for health literacy appropriate to the African context.

Response

{
  "condition_id": "c_malaria",
  "title": "Understanding Malaria",
  "summary": "Malaria is a serious disease spread by mosquito bites...",
  "key_facts": ["Preventable with bed nets", "Treatable when caught early"],
  "when_to_seek_care": "If you have fever with chills lasting more than 2 days",
  "prevention_tips": ["Use insecticide-treated bed nets", "Take antimalarial medication"]
}
GET
/v1/usageFreeAPI Key (Bearer token)

Usage Statistics

Returns aggregated usage statistics for your tenant, including assessment counts, cost breakdown, and urgency distribution over a date range.

Response

{
  "period": { "start": "2026-02-01", "end": "2026-02-28" },
  "total_assessments": 1247,
  "breakdown": {
    "by_urgency": { "emergency": 45, "urgent": 312, "routine": 678, "self-care": 212 },
    "top_conditions": [{ "name": "Malaria", "count": 189 }]
  },
  "cost": { "total_naira": 24940, "current_tier": "professional", "usage_percentage": 62.35 }
}
GET
/v1/healthFreeNone (public)

Health Check

Returns the operational status of all PearMedica services (database, cache, AI provider, knowledge base). Useful for monitoring integrations.

Response

{
  "status": "healthy",
  "timestamp": "2026-02-16T12:00:00Z",
  "version": "1.0.0",
  "checks": {
    "database": "healthy",
    "redis": "healthy",
    "ai_provider": "healthy",
    "knowledge_base": "healthy"
  },
  "uptime_seconds": 2592000
}
POST
/v1/rationaleFreeAPI Key (Bearer token)

Assessment Rationale

Retrieve the clinical reasoning behind a specific assessment, including evidence weighting, knowledge sources consulted, and validation results.

Request Body

{
  "assessment_id": "550e8400-e29b-41d4-a716-446655440000"
}

Response

{
  "assessment_id": "550e8400-e29b-41d4-a716-446655440000",
  "interview_id": "int_abc123",
  "reasoning": "Assessment analysed 3 potential condition(s) with 87.0% confidence. Model: gpt-4o. Triage level matches LLM output.",
  "conditions": [{ "id": "c_malaria", "name": "Malaria", "probability": 0.82, "evidence_supporting": ["fever", "headache", "mosquito_exposure"], "evidence_against": [], "explanation": "Malaria is ranked #1 with 82.0% probability. Supporting evidence: fever, headache, mosquito_exposure." }],
  "triage": { "level": "urgent", "rationale": "Triage level 'urgent' was determined by the assessment model. Seek medical attention within 24 hours.", "overridden": false, "override_reason": null },
  "metadata": { "model_used": "gpt-4o", "confidence": 0.87, "generated_at": "2026-02-16T12:00:00Z", "processing_time_ms": 1850 }
}
GET
/v1/searchFreeAPI Key (Bearer token)

Knowledge Search

Search the PearMedica knowledge base for conditions, symptoms, and medical concepts using fuzzy trigram matching.

Query Parameters

phrasestringrequiredSearch query string (1–200 characters)Example: malaria
sexstringOptional sex filter (male, female, other)Example: female
max_resultsintegerMaximum results to return (1–20, default: 8)Example: 8

Response

{
  "data": [
    { "id": "c_malaria", "name": "Malaria", "type": "condition", "category": "infectious", "similarity": 0.95 },
    { "id": "s_fever", "name": "Fever", "type": "symptom", "category": "general", "similarity": 0.82 }
  ],
  "meta": { "total": 2, "phrase": "malaria", "timestamp": "2026-02-16T12:00:00Z" }
}
POST
/v1/fhir/assessBillableAPI Key (Bearer token)

FHIR R4 Assessment

FHIR R4-compatible assessment endpoint. Accepts and returns standard FHIR Bundle resources, enabling plug-and-play integration with FHIR-aware EMR/EHR systems including Epic, Cerner, and OpenMRS.

Request Body

{
  "resourceType": "Bundle",
  "type": "collection",
  "entry": [
    {
      "resource": {
        "resourceType": "Patient",
        "gender": "female",
        "birthDate": "1998-01-01"
      }
    },
    {
      "resource": {
        "resourceType": "Observation",
        "code": { "coding": [{ "system": "http://pearmedica.com/symptoms", "code": "s_fever" }] },
        "valueString": "present"
      }
    }
  ]
}

Response

{
  "resourceType": "Bundle",
  "type": "collection",
  "entry": [
    {
      "resource": {
        "resourceType": "RiskAssessment",
        "prediction": [{ "outcome": { "text": "Malaria" }, "qualitativeRisk": { "text": "high" } }]
      }
    }
  ]
}
GET
/v1/fhir/metadataFreeNone (public)

FHIR Capability Statement

Returns PearMedica's FHIR R4 CapabilityStatement, enabling integration engines to auto-discover supported resources, operations, and search parameters.

Response

{
  "resourceType": "CapabilityStatement",
  "status": "active",
  "kind": "instance",
  "fhirVersion": "4.0.1",
  "format": ["json"],
  "rest": [{
    "mode": "server",
    "resource": [{ "type": "RiskAssessment" }, { "type": "Patient" }]
  }]
}

Error Codes

CodeStatusDescription
400Bad RequestInvalid request body or missing required fields.
401UnauthorizedMissing or invalid API key.
403ForbiddenAPI key does not have permission for this endpoint.
404Not FoundResource not found (e.g., invalid condition ID).
429Rate LimitedRequest rate exceeded. Default: 100 req/min per key.
500Internal ErrorUnexpected server error. Contact support.
503Service UnavailablePearMDx degraded mode — LLM provider unreachable.

Webhooks

Coming Soon

Receive real-time notifications when events occur in your PearMedica account. Configure webhook endpoints, subscribe to event types, and verify payloads with HMAC-SHA256 signatures.

Planned Event Types

EventDescription
assessment.completedFired when a clinical assessment reaches a terminal state.
adverse_event.createdFired when an adverse event is flagged for regulatory review.
usage.threshold_reachedFired when API usage hits 80% or 100% of the tier quota.
api_key.expiringFired 7 days before an API key's scheduled expiration.

Planned Endpoints

POST
/v1/webhooksRegister a new webhook endpoint
GET
/v1/webhooksList all registered webhooks
DELETE
/v1/webhooks/{id}Remove a webhook endpoint

Want early access to webhooks?

Request Early Access