{"openapi":"3.1.0","info":{"title":"Epidemiology API","version":"1.0.0","description":"Epidemiology-basics maths as an API, computed locally and deterministically. The herd-immunity endpoint computes the herd-immunity threshold HIT = 1 − 1/R0 — the immune fraction of a population at which an outbreak can no longer sustain itself — from the basic reproduction number R0, and adjusts for an imperfect vaccine by dividing by its efficacy, so a disease with R0 = 3 needs about 67 % immune (74 % vaccinated with a 90 %-effective vaccine) while measles at R0 ≈ 15 needs about 93 %. The r-effective endpoint computes the effective reproduction number Re = R0 · susceptible fraction and flags whether the epidemic is growing (Re > 1) or shrinking. The final-size endpoint solves the final-epidemic-size equation Z = 1 − e^(−R0·Z) for the eventual attack rate of an unmitigated SIR epidemic — about 80 % at R0 = 2. The doubling-time endpoint gives the case-doubling time from a growth rate, or from R0 and the serial interval. Fractions are 0–1 and percentages are derived. Everything is computed locally and deterministically, so it is instant and private. Ideal for public-health, epidemiology-education, dashboard, science-communication and outbreak-planning app developers, herd-immunity and reproduction-number tools, and health software. Simple compartmental relations for education and planning, not a substitute for full epidemiological modelling. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 4 endpoints. This is epidemiology basics; for population-genetics Hardy-Weinberg use a genetics API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/epidemic-api","description":"oanor gateway"}],"tags":[{"name":"Epidemiology"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/doubling-time":{"get":{"operationId":"get_v1_doubling_time","tags":["Epidemiology"],"summary":"Case doubling time","description":"","parameters":[{"name":"growth_rate","in":"query","required":false,"description":"Daily growth rate","schema":{"type":"string"}},{"name":"r0","in":"query","required":false,"description":"R0 (with serial interval)","schema":{"type":"string"},"example":"2"},{"name":"serial_interval","in":"query","required":false,"description":"Serial interval (days)","schema":{"type":"string"},"example":"5"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Doubling time = ln2 / growth rate. From R0 and the serial interval, growth rate ≈ ln(R0)/serial interval.","inputs":{"growth_rate":0.13862944},"doubling_time_days":5},"meta":{"timestamp":"2026-06-05T19:50:17.888Z","request_id":"923ed2c7-476d-46f8-866a-a29660f8c0d4"},"status":"ok","message":"Doubling time","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/final-size":{"get":{"operationId":"get_v1_final_size","tags":["Epidemiology"],"summary":"Final epidemic size","description":"","parameters":[{"name":"r0","in":"query","required":true,"description":"Basic reproduction number R0","schema":{"type":"string"},"example":"2"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Final epidemic size (attack rate) solves Z = 1 − e^(−R0·Z) — the eventual fraction infected in an unmitigated SIR epidemic. R0=2 gives ≈80%.","inputs":{"r0":2},"final_size":0.79681213,"final_size_percent":79.681213},"meta":{"timestamp":"2026-06-05T19:50:17.981Z","request_id":"decf139c-d789-40ef-958a-cfbfb14d7af0"},"status":"ok","message":"Final epidemic size","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/herd-immunity":{"get":{"operationId":"get_v1_herd_immunity","tags":["Epidemiology"],"summary":"Herd-immunity threshold","description":"","parameters":[{"name":"r0","in":"query","required":true,"description":"Basic reproduction number R0","schema":{"type":"string"},"example":"3"},{"name":"vaccine_efficacy","in":"query","required":false,"description":"Vaccine efficacy (0–1)","schema":{"type":"string"},"example":"0.9"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Herd-immunity threshold HIT = 1 − 1/R0 — the immune fraction at which spread stops. Adjust for an imperfect vaccine by dividing by its efficacy. Measles (R0≈15) needs ≈93%.","inputs":{"r0":3,"vaccine_efficacy":0.9},"herd_immunity_percent":66.6667,"herd_immunity_threshold":0.666667,"vaccination_percent_needed":74.0741,"vaccination_coverage_needed":0.740741},"meta":{"timestamp":"2026-06-05T19:50:18.080Z","request_id":"54b8f2bb-cf65-4f4d-aee2-e00a8ebbf3fa"},"status":"ok","message":"Herd immunity threshold","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/r-effective":{"get":{"operationId":"get_v1_r_effective","tags":["Epidemiology"],"summary":"Effective reproduction number","description":"","parameters":[{"name":"r0","in":"query","required":true,"description":"Basic reproduction number R0","schema":{"type":"string"},"example":"3"},{"name":"immune_fraction","in":"query","required":false,"description":"Immune fraction (0–1)","schema":{"type":"string"},"example":"0.5"},{"name":"susceptible_fraction","in":"query","required":false,"description":"Or susceptible fraction","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Effective reproduction number Re = R0 · susceptible fraction. The epidemic grows while Re > 1 and declines once Re < 1.","inputs":{"r0":3,"susceptible_fraction":0.5},"status":"growing","r_effective":1.5,"epidemic_growing":true},"meta":{"timestamp":"2026-06-05T19:50:18.185Z","request_id":"7b1416d6-b169-4c2f-84f6-80b3676d508f"},"status":"ok","message":"Effective reproduction number","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"notes":"R0 is the basic reproduction number; fractions are 0–1, percentages are derived. Simple compartmental (SIR) relations for education and planning, not a substitute for epidemiological modelling.","service":"epidemic-api","endpoints":{"GET /v1/meta":"This document.","GET /v1/final-size":"Final epidemic size (attack rate) from R0.","GET /v1/r-effective":"Effective reproduction number from R0 and the susceptible fraction.","GET /v1/doubling-time":"Doubling time from a growth rate, or from R0 and the serial interval.","GET /v1/herd-immunity":"Herd-immunity threshold from R0 (with optional vaccine efficacy)."},"description":"Epidemiology basics: herd-immunity threshold, effective reproduction number, final epidemic size and doubling time."},"meta":{"timestamp":"2026-06-05T19:50:18.266Z","request_id":"9678453c-1691-4950-b6de-712ffac37389"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":4250,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":510,"monthly_call_quota":42500,"rps_limit":6,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":1380,"monthly_call_quota":199000,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":4200,"monthly_call_quota":1215000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/epidemic-api"}