{"openapi":"3.1.0","info":{"title":"Statistics Calculator API","version":"1.0.0","description":"Descriptive-statistics maths as an API, computed locally and deterministically. The descriptive endpoint summarises a list of numbers — the count, sum, mean, median, mode, minimum, maximum and range, the population and sample variance and standard deviation, and the quartiles Q1/Q2/Q3 with the interquartile range by Tukey's method. The correlation endpoint computes the Pearson correlation coefficient r between two equal-length series — from −1 (perfect inverse) through 0 (none) to +1 (perfect direct) — along with R² and the covariance. The regression endpoint fits a least-squares line y = a + b·x, returning the slope, intercept and R², the equation, and an optional prediction for a given x. Data is accepted as a JSON array or a comma-separated list. Everything is computed locally and deterministically, so it is instant and private. Ideal for data-analysis, dashboard, research and education app developers, reporting and BI tools, and spreadsheet replacements. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is descriptive statistics; for probability distributions and combinatorics use a probability API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/statistics-api","description":"oanor gateway"}],"tags":[{"name":"Statistics"},{"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/correlation":{"get":{"operationId":"get_v1_correlation","tags":["Statistics"],"summary":"Pearson correlation","description":"","parameters":[{"name":"x","in":"query","required":true,"description":"First series","schema":{"type":"string"},"example":"1,2,3,4,5"},{"name":"y","in":"query","required":true,"description":"Second series (same length)","schema":{"type":"string"},"example":"2,4,5,4,5"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Pearson r = Σ(x−x̄)(y−ȳ) / √(Σ(x−x̄)²·Σ(y−ȳ)²), ranging from −1 (perfect inverse) to +1 (perfect direct).","inputs":{"count":5},"pearson_r":0.774597,"r_squared":0.6,"covariance_sample":1.5,"covariance_population":1.2},"meta":{"timestamp":"2026-06-04T18:38:14.865Z","request_id":"f9b0d955-cf09-4362-9e70-5e7eba06e272"},"status":"ok","message":"Pearson correlation","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/descriptive":{"get":{"operationId":"get_v1_descriptive","tags":["Statistics"],"summary":"Descriptive statistics","description":"","parameters":[{"name":"data","in":"query","required":true,"description":"Numbers (JSON array or comma-separated)","schema":{"type":"string"},"example":"2,4,4,4,5,5,7,9"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"q1":4,"q3":6,"iqr":2,"max":9,"min":2,"sum":40,"mean":5,"mode":[4],"note":"Population divides by n, sample by n−1. Quartiles by Tukey's method. Mode is null when all values are unique.","range":7,"inputs":{"count":8},"median":4.5,"q2_median":4.5,"stddev_sample":2.13809,"variance_sample":4.571429,"stddev_population":2,"variance_population":4},"meta":{"timestamp":"2026-06-04T18:38:14.976Z","request_id":"d7340679-d55e-4b90-aefd-7d0497d416eb"},"status":"ok","message":"Descriptive stats","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/regression":{"get":{"operationId":"get_v1_regression","tags":["Statistics"],"summary":"Linear regression","description":"","parameters":[{"name":"x","in":"query","required":true,"description":"Independent series","schema":{"type":"string"},"example":"1,2,3,4,5"},{"name":"y","in":"query","required":true,"description":"Dependent series","schema":{"type":"string"},"example":"2,4,5,4,5"},{"name":"predict_x","in":"query","required":false,"description":"Predict y at this x","schema":{"type":"string"},"example":"6"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Least-squares line y = a + b·x with b = Σ(x−x̄)(y−ȳ)/Σ(x−x̄)². Pass 'predict_x' to predict y.","slope":0.6,"inputs":{"count":5},"equation":"y = 2.2 + 0.6x","intercept":2.2,"r_squared":0.6,"predicted_y":5.8},"meta":{"timestamp":"2026-06-04T18:38:15.090Z","request_id":"67e890e0-d913-41b0-b08e-8e5575beca73"},"status":"ok","message":"Linear regression","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":"Data as a JSON array or comma-separated list. Quartiles use Tukey's method. For x/y endpoints the two lists must be the same length.","service":"statistics-api","formulae":{"variance":"population /n, sample /(n−1)","regression":"slope = Σ(x−x̄)(y−ȳ)/Σ(x−x̄)²,  intercept = ȳ − slope·x̄","correlation":"r = Σ(x−x̄)(y−ȳ) / √(Σ(x−x̄)²·Σ(y−ȳ)²)"},"endpoints":{"GET /v1/meta":"This document.","GET /v1/regression":"Least-squares linear regression (slope, intercept, R²) with optional prediction.","GET /v1/correlation":"Pearson correlation and covariance between two equal-length series.","GET /v1/descriptive":"Mean, median, mode, variance, standard deviation and quartiles for a list of numbers."},"description":"Descriptive-statistics calculator: summary statistics for a dataset, Pearson correlation, and simple linear regression."},"meta":{"timestamp":"2026-06-04T18:38:15.170Z","request_id":"98503cb4-4f91-49ff-8bbb-ee3bd2f08e36"},"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":700,"monthly_call_quota":40000,"rps_limit":5,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":1900,"monthly_call_quota":250000,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":5900,"monthly_call_quota":1500000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/statistics-api"}