{"openapi":"3.1.0","info":{"title":"Statistical Inference API","version":"1.0.0","description":"Inferential-statistics maths as an API, computed locally and deterministically. The samplesize endpoint computes how many respondents a survey or experiment needs for a proportion, n = Z²·p(1−p)/E², from a confidence level and a margin of error (using p = 0.5 for the most conservative size), with a finite-population correction when the population is known. The confidence endpoint builds a confidence interval for a mean (estimate ± Z·σ/√n) or a proportion (p ± Z·√(p(1−p)/n)), returning the standard error, margin of error and the lower and upper bounds. The ztest endpoint runs a one-sample z-test, z = (x̄ − μ₀)/(σ/√n), and returns the z-score, the one- or two-tailed p-value and whether the result is significant at the chosen alpha. The z-scores come from an exact inverse-normal and the p-values from the normal CDF. Everything is computed locally and deterministically, so it is instant and private. Ideal for A/B-testing, survey, research and analytics app developers, experiment dashboards and data-science tools, and education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is inferential statistics; for descriptive statistics use a statistics API and for probability distributions use a probability API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/inference-api","description":"oanor gateway"}],"tags":[{"name":"Inference"},{"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/confidence":{"get":{"operationId":"get_v1_confidence","tags":["Inference"],"summary":"Confidence interval","description":"","parameters":[{"name":"type","in":"query","required":false,"description":"mean | proportion (default mean)","schema":{"type":"string"},"example":"mean"},{"name":"n","in":"query","required":true,"description":"Sample size","schema":{"type":"string"},"example":"50"},{"name":"confidence","in":"query","required":false,"description":"Confidence level (%, default 95)","schema":{"type":"string"},"example":"95"},{"name":"mean","in":"query","required":false,"description":"Sample mean (type=mean)","schema":{"type":"string"},"example":"100"},{"name":"stddev","in":"query","required":false,"description":"Std deviation (type=mean)","schema":{"type":"string"},"example":"15"},{"name":"proportion","in":"query","required":false,"description":"Sample proportion (type=proportion)","schema":{"type":"string"},"example":"0.4"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"CI = estimate ± Z·SE. For a mean SE = σ/√n; for a proportion SE = √(p(1−p)/n). Uses the normal (z) approximation.","lower":95.842289,"upper":104.157711,"inputs":{"n":50,"type":"mean","confidence":95},"z_score":1.959964,"estimate":100,"standard_error":2.12132,"margin_of_error":4.157711},"meta":{"timestamp":"2026-06-04T18:38:14.415Z","request_id":"41e4a104-21cc-4fd3-8779-c6ffdad834fc"},"status":"ok","message":"Confidence interval","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/samplesize":{"get":{"operationId":"get_v1_samplesize","tags":["Inference"],"summary":"Sample size","description":"","parameters":[{"name":"confidence","in":"query","required":false,"description":"Confidence level (%, default 95)","schema":{"type":"string"},"example":"95"},{"name":"margin_of_error","in":"query","required":false,"description":"Margin of error (fraction or %, default 0.05)","schema":{"type":"string"},"example":"0.05"},{"name":"proportion","in":"query","required":false,"description":"Expected proportion (default 0.5)","schema":{"type":"string"},"example":"0.5"},{"name":"population","in":"query","required":false,"description":"Population size for finite correction","schema":{"type":"string"},"example":"10000"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"n = Z²·p(1−p)/E². Use p = 0.5 for the most conservative (largest) sample. Finite-population correction applied when a population is given.","inputs":{"confidence":95,"proportion":0.5,"margin_of_error":0.05},"z_score":1.959964,"population":10000,"sample_size":385,"sample_size_finite":370},"meta":{"timestamp":"2026-06-04T18:38:14.517Z","request_id":"c4d5902b-5042-49d0-95ba-9f70397bf606"},"status":"ok","message":"Sample 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/ztest":{"get":{"operationId":"get_v1_ztest","tags":["Inference"],"summary":"One-sample z-test","description":"","parameters":[{"name":"sample_mean","in":"query","required":true,"description":"Sample mean","schema":{"type":"string"},"example":"105"},{"name":"population_mean","in":"query","required":true,"description":"Hypothesised mean μ₀","schema":{"type":"string"},"example":"100"},{"name":"stddev","in":"query","required":true,"description":"Population std deviation","schema":{"type":"string"},"example":"15"},{"name":"n","in":"query","required":true,"description":"Sample size","schema":{"type":"string"},"example":"50"},{"name":"tail","in":"query","required":false,"description":"two | left | right (default two)","schema":{"type":"string"},"example":"two"},{"name":"alpha","in":"query","required":false,"description":"Significance level (default 0.05)","schema":{"type":"string"},"example":"0.05"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"z = (x̄ − μ₀)/(σ/√n). p-value from the standard normal; significant when p < alpha. Known-σ (z) test.","inputs":{"n":50,"tail":"two","alpha":0.05,"stddev":15,"sample_mean":105,"population_mean":100},"p_value":0.01842209,"z_score":2.357023,"significant":true,"standard_error":2.12132},"meta":{"timestamp":"2026-06-04T18:38:14.611Z","request_id":"f23825a5-c530-48ca-acdb-6ec2fa76a478"},"status":"ok","message":"Z-test","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":"Confidence as a percentage (e.g. 95), margin of error as a fraction or percent. Z-test assumes a known population standard deviation and the normal approximation.","service":"inference-api","formulae":{"ztest":"z = (x̄ − μ₀)/(σ/√n)","confidence":"CI = estimate ± Z·SE","sample_size":"n = Z²·p(1−p)/E²"},"endpoints":{"GET /v1/meta":"This document.","GET /v1/ztest":"One-sample z-test with z-score, p-value and significance.","GET /v1/confidence":"Confidence interval for a mean or a proportion.","GET /v1/samplesize":"Sample size for a proportion at a confidence level and margin of error, with finite-population correction."},"description":"Inferential-statistics calculator: sample-size determination, confidence intervals and the one-sample z-test."},"meta":{"timestamp":"2026-06-04T18:38:14.722Z","request_id":"7f3022db-bc2a-42ae-9e7b-29f82fa7d568"},"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":3000,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":500,"monthly_call_quota":40000,"rps_limit":5,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":1500,"monthly_call_quota":250000,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":4900,"monthly_call_quota":1571000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/inference-api"}