Overview
Free calculators for maternal and child health in Ghana and Nigeria, built on WHO, Ghana Health Service and NPHCDA guidance. Use them in clinic software, apps, SMS services and research tools.
- Pregnancy calculator: EDD, gestational age and the dates of the 8 WHO antenatal contacts.
- Vaccines: Ghana's EPI and Nigeria's NPHCDA schedules, and one child's doses, statuses and next clinic visit.
- Danger-sign screen: checks a message for pregnancy and newborn danger signs and returns the advice ProtectMum sends mothers.
- Antenatal risk score: a draft score in test (shadow) mode, for research partners with sandbox keys.
Base URL: https://protectmum.org/v1 · Machine-readable spec: openapi.json (OpenAPI 3.1, import it into Postman or Insomnia)
Quick start
- Ask for a sandbox key (see Keys).
- Keep it in an environment variable on your server, e.g.
PM_KEY. - Make your first call:
curl https://protectmum.org/v1/pregnancy/calculate \
-H "Authorization: Bearer $PM_KEY" \
-H "Content-Type: application/json" \
-d '{"lmp": "2026-06-01"}'Keys and sandbox
Send your key in the Authorization header: Authorization: Bearer pm_test_…. The header X-Api-Key also works. GET /v1/health needs no key.
| Key | Starts with | Use it for |
|---|---|---|
| Sandbox | pm_test_ | Building and testing. Same answers as live, lower limits. The only key that can use the risk score. |
| Live | pm_live_ | Your product in use, once we have seen how it shows our answers to people. |
Getting a key: email developers@protectmum.org with your organisation, a contact person and what you are building. Sandbox keys are usually issued within a week. We show the key once; store it then.
Scopes: pregnancy, vaccines and triage come with every key. risk is granted on request to research partners.
Rate limits
| Key | Per minute | Per day (UTC) |
|---|---|---|
| Sandbox | 30 | 1,000 |
| Live | 120 | 50,000 |
Every answer carries X-RateLimit-Limit and X-RateLimit-Remaining for the current minute. Over the limit you get 429 with Retry-After (seconds). Need more? Ask; we raise limits for health services.
The calculators give the same answer for the same input on the same day, so cache results where you can.
Errors
Errors are JSON with a stable code to program against, a readable message, and a request_id to quote if you contact us.
{
"error": {
"code": "date_out_of_range",
"message": "The dates do not give a current pregnancy (0 to 44 weeks). Check them.",
"request_id": "9f2c4e1a7b3d5c60"
}
}| HTTP | code | Meaning |
|---|---|---|
| 400 | invalid_json | The body is not a JSON object. |
| 401 | missing_key | No key was sent. |
| 401 | invalid_key | The key is wrong or has been revoked. |
| 403 | scope_missing | The key is not allowed to use this endpoint. |
| 403 | not_available | The risk score with a live key (it is sandbox-only for now). |
| 404 | not_found | No such endpoint. |
| 405 | method_not_allowed | Wrong HTTP method; see the Allow header. |
| 413 | too_large | Body over 16 KB. |
| 415 | unsupported_media_type | Content-Type is not application/json. |
| 422 | invalid_input | A field is missing, unknown or the wrong type. The message names it. |
| 422 | date_out_of_range | The dates do not make sense (for example an LMP in the future). |
| 429 | rate_limited | Too many requests. Wait for Retry-After seconds. |
| 500 | server_error | Our fault. Retry once, then send us the request_id. |
Dates are always YYYY-MM-DD. Unknown fields are rejected rather than ignored, so a typo cannot silently change an answer.
Endpoints
POST /v1/pregnancy/calculate
EDD, gestational age and ANC contact dates. Scope: pregnancy.
Send exactly one of lmp, edd or scan. The EDD from an LMP uses Naegele's rule (LMP + 280 days); a scan in the first half of pregnancy is more accurate. The next ANC contact is marked next.
| Field | Type | Notes |
|---|---|---|
lmp | date | First day of the last menstrual period. 0 to 44 weeks ago. |
edd | date | An EDD from the clinic. From 14 days ago to 40 weeks ahead. |
scan.date / scan.ga_weeks / scan.ga_days | date, int 4-42, int 0-6 | A dating scan and the gestational age it showed. |
today | date, optional | Defaults to today in Ghana (UTC). |
Request
curl https://protectmum.org/v1/pregnancy/calculate \
-H "Authorization: Bearer $PM_KEY" \
-H "Content-Type: application/json" \
-d '{"lmp": "2026-06-01"}'Response
{
"edd": "2027-03-08",
"dating_method": "lmp",
"today": "2026-11-26",
"gestational_age": {
"weeks": 25,
"days": 3,
"label": "25+3"
},
"trimester": 2,
"days_to_edd": 102,
"post_dates": false,
"anc_contacts": [
{
"contact": 1,
"week": 12,
"date": "2026-08-24",
"status": "past"
},
{
"contact": 2,
"week": 20,
"date": "2026-10-19",
"status": "past"
},
{
"contact": 3,
"week": 26,
"date": "2026-11-30",
"status": "next"
},
{
"contact": 4,
"week": 30,
"date": "2026-12-28",
"status": "upcoming"
},
{
"contact": 5,
"week": 34,
"date": "2027-01-25",
"status": "upcoming"
},
{
"contact": 6,
"week": 36,
"date": "2027-02-08",
"status": "upcoming"
},
{
"contact": 7,
"week": 38,
"date": "2027-02-22",
"status": "upcoming"
},
{
"contact": 8,
"week": 40,
"date": "2027-03-08",
"status": "upcoming"
}
],
"notes": [
"EDD from LMP uses Naegele's rule (LMP + 280 days). An early scan is more accurate.",
"ANC contacts follow the WHO 2016 eight-contact model.",
"Information only. Not a diagnosis and not a substitute for a health worker."
]
}GET /v1/vaccines/schedule
The national vaccine schedule for a country. Scope: vaccines.
Add ?country=NG for Nigeria's NPHCDA schedule; without it you get Ghana's EPI schedule (country is GH or NG). Each dose has a code, a dose number and an age (days, weeks, months or years after birth). Doses with requires_clinic_check (malaria vaccine, HPV) are not offered at every clinic yet. The version changes whenever the schedule does. Response shortened here.
Request
curl https://protectmum.org/v1/vaccines/schedule \
-H "Authorization: Bearer $PM_KEY"Response
{
"schedule_id": "ghs-epi",
"version": "2026-11-25",
"source": "https://ghs.gov.gh/immunisation",
"notes": [
"Ages are offsets from the child's date of birth. Weeks = 7 days; months and years are calendar offsets (31 Jan + 1 month = 28/29 Feb).",
"Entries with requires_clinic_check = true are only reminded after the mother confirms her clinic offers them (malaria vaccine is a phased introduction since 2019).",
"Vitamin A after 24 months: GHS says every 6 months until age 5. Doses at 30-54 months are listed here; confirm the final dose with Prof Bonsaffoh.",
"HPV at 9 years: confirm eligibility rules (sex, age band) before reminding."
],
"doses": [
{
"code": "BCG",
"name": "BCG",
"dose": 1,
"age": {
"days": 0
},
"requires_clinic_check": false
},
{
"code": "OPV",
"name": "Oral polio vaccine",
"dose": 0,
"age": {
"days": 0
},
"requires_clinic_check": false
},
{
"code": "HEPB_BIRTH",
"name": "Hepatitis B birth dose",
"dose": 1,
"age": {
"days": 0
},
"requires_clinic_check": false
},
{
"code": "PENTA",
"name": "DPT-HepB-Hib",
"dose": 1,
"age": {
"weeks": 6
},
"requires_clinic_check": false
}
]
}POST /v1/vaccines/child
One child's doses, statuses and next visit. Scope: vaccines.
Status is one of given, overdue, due_today, due_soon (within 7 days), upcoming or needs_clinic_check. next_visit is the earliest date that still has doses to give. Response shortened here.
| Field | Type | Notes |
|---|---|---|
dob | date, required | Child's date of birth; under 5 years old. |
given | object, optional | Doses already given: {"BCG:1": "2026-10-01"}. Keys are CODE:dose from the schedule. |
clinic_offers | list, optional | Codes of phased-in vaccines the child's clinic gives, e.g. ["MALARIA"]. |
country | string, optional | GH (default) or NG: which national schedule to use. |
today | date, optional | Defaults to today in Ghana. |
Request
curl https://protectmum.org/v1/vaccines/child \
-H "Authorization: Bearer $PM_KEY" \
-H "Content-Type: application/json" \
-d '{"dob": "2026-10-01", "given": {"BCG:1": "2026-10-01", "OPV:0": "2026-10-01", "HEPB_BIRTH:1": "2026-10-02"}}'Response
{
"dob": "2026-10-01",
"today": "2026-11-26",
"schedule_version": "2026-11-25",
"next_visit": {
"date": "2026-11-12",
"doses": [
{
"code": "OPV",
"name": "Oral polio vaccine",
"dose": 1,
"status": "overdue"
},
{
"code": "PCV",
"name": "Pneumococcal vaccine",
"dose": 1,
"status": "overdue"
},
{
"code": "PENTA",
"name": "DPT-HepB-Hib",
"dose": 1,
"status": "overdue"
},
{
"code": "ROTA",
"name": "Rotavirus vaccine",
"dose": 1,
"status": "overdue"
}
]
},
"doses": [
{
"code": "BCG",
"name": "BCG",
"dose": 1,
"due_date": "2026-10-01",
"status": "given",
"given_date": "2026-10-01",
"reminder_dates": []
},
{
"code": "HEPB_BIRTH",
"name": "Hepatitis B birth dose",
"dose": 1,
"due_date": "2026-10-01",
"status": "given",
"given_date": "2026-10-02",
"reminder_dates": []
},
{
"code": "OPV",
"name": "Oral polio vaccine",
"dose": 0,
"due_date": "2026-10-01",
"status": "given",
"given_date": "2026-10-01",
"reminder_dates": []
},
{
"code": "OPV",
"name": "Oral polio vaccine",
"dose": 1,
"due_date": "2026-11-12",
"status": "overdue",
"given_date": null,
"reminder_dates": [
"2026-11-09",
"2026-11-12"
]
}
],
"notes": [
"Statuses: given, overdue, due_today, due_soon, upcoming, needs_clinic_check.",
"Information only. Not a diagnosis and not a substitute for a health worker."
]
}POST /v1/triage/message
Screen a message for danger signs. Scope: triage.
Checks free text for the danger signs of pregnancy and the newborn (bleeding, severe headache, fits, reduced baby movements, a newborn not feeding, and others), including common Ghanaian and Nigerian English and Pidgin. When one is found, advice is the message ProtectMum sends: go to a health facility now or call 112. The text is not stored.
| Field | Type | Notes |
|---|---|---|
text | string, required | 1 to 1,000 characters. |
language | en | tw | gaa | ee | Language of the advice. English rules are always checked; Twi, Ga and Ewe rules are being written. |
danger_sign: false does not mean safe. It only means no keyword matched. Your product must always let people reach a health worker.Request
curl https://protectmum.org/v1/triage/message \
-H "Authorization: Bearer $PM_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "I am bleeding and my head is paining me seriously"}'Response
{
"danger_sign": true,
"codes": [
"bleeding",
"severe_headache"
],
"advice": "This could be a danger sign. Please go to the nearest health facility now. If you cannot get there, call 112. Do not wait.",
"rules_version": "draft-2026-11-26",
"notes": [
"This is a keyword screen. danger_sign = false does NOT mean the person is safe: always let them reach a health worker.",
"Information only. Not a diagnosis and not a substitute for a health worker."
]
}POST /v1/risk/antenatal
Draft antenatal risk score (shadow mode). Scope: risk.
A rule-based score modelled on the WHO antenatal classifying-form approach: one high-risk factor moves a woman out of routine care. Bands: urgent (same-day review), high (doctor-led care), moderate, low, and incomplete when key items are missing and nothing was found. Missing data never lowers a band.
| Field | Type | Notes |
|---|---|---|
age_years, gravida, parity, ga_weeks | integers | gravida counts this pregnancy; parity is previous births. |
systolic_bp, diastolic_bp, proteinuria | int, int, bool | Booking or latest reading. |
hb_g_dl, height_cm, bmi | number, int, number | |
previous_caesareans, consecutive_miscarriages, last_baby_weight_g | integers | |
previous_stillbirth_or_neonatal_death, previous_preeclampsia, previous_uterine_surgery, previous_pph, multiple_pregnancy, rh_sensitised, vaginal_bleeding, pelvic_mass, malpresentation | booleans | |
conditions | list | Any of: diabetes, chronic_hypertension, renal_disease, cardiac_disease, sickle_cell_disease, epilepsy, substance_use, hiv, other_severe. |
Request
curl https://protectmum.org/v1/risk/antenatal \
-H "Authorization: Bearer $PM_KEY" \
-H "Content-Type: application/json" \
-d '{"age_years": 37, "gravida": 4, "parity": 3, "systolic_bp": 142, "diastolic_bp": 92, "proteinuria": false, "hb_g_dl": 9.8, "previous_caesareans": 1}'Response
{
"band": "high",
"score": 6,
"factors": [
{
"code": "hypertension",
"level": "high",
"label": "Blood pressure 140/90 or higher"
},
{
"code": "age_16_17_or_35_40",
"level": "moderate",
"label": "Age 16-17 or 35-40"
},
{
"code": "one_previous_caesarean",
"level": "moderate",
"label": "One previous caesarean section"
},
{
"code": "moderate_anaemia",
"level": "moderate",
"label": "Haemoglobin 7 to 9.9 g/dL"
}
],
"missing": [],
"advice": "Doctor-led antenatal care. Plan birth where caesarean section and blood transfusion are available.",
"model_version": "antenatal-risk-v0-draft",
"mode": "shadow",
"for_clinical_use": false,
"notes": [
"Draft rule-based score, not validated. Do not use it to make care decisions.",
"Missing data never lowers the band; with key items missing and no factor found the band is \"incomplete\"."
]
}Safety rules for apps using the API
- Show the answers as information, not a diagnosis, and say so near them.
- Wherever you show triage results, show a way to reach care: the nearest facility and 112.
- Never present
danger_sign: falseas "you are fine". - Do not use the risk score to decide anyone's care while it is in shadow mode.
- Show the dates we return as estimates to confirm with the clinic.
- Tell us if you see an answer that looks wrong: developers@protectmum.org, with the request_id.
Privacy
No endpoint needs a name, phone number, hospital number, NHIS number or address. Do not send them. Unknown fields are rejected, which also stops most accidental leaks.
We do not store request bodies. For each request we keep only the key used, the endpoint, the status code, an error code and the time taken, to run limits and fix problems. For the risk score we also keep the band and the factor codes (not the values you sent), to evaluate the score.
Terms of use
- Free for health services, NGOs, researchers, students and companies building health products.
- Follow the safety rules above. We may suspend keys that present answers unsafely.
- Say "Calculations by ProtectMum" where you show our results.
- The API is provided as is. It does not replace clinical judgement, and ProtectMum is not responsible for decisions made from its answers.
- We will give at least 90 days' notice before a breaking change to
/v1.
Draft terms, to be reviewed before live keys are issued.
Changelog
v1 (preview), November 2026. First release: pregnancy calculator, vaccine schedule and child vaccines, danger-sign screen, and the antenatal risk score in shadow mode.