deterministic
no-api-key
num
numbers
statistics

Statistics calculator: mean, median, standard deviation, quartiles and percentiles

Statistics calculator for a numeric array in one call: count, sum, mean, median, mode, variance and standard deviation honouring ddof (default 1, the sample form; 0 gives the population form) plus always-population *_population fields, min, max, range, the quartiles and interquartile range, skewness, kurtosis, and any requested percentiles. Percentiles use a named interpolation method so the result is reproducible rather than implementation-defined.

Output (data): n, sum (number|null), mean (number|null), median (number|null), mode ([] or null, null when every value is distinct), ddof (integer), variance (number|null: n-ddof divisor, null when n <= ddof), stdev (number|null, null when n <= ddof), variance_population (number|null), stdev_population (number|null), min, max, range (number|null), q1 (number|null), q3 (number|null), iqr (number|null), skewness (number|null, null when n < 3 or the variance is 0), kurtosis_excess (number|null, null when n < 4 or the variance is 0), percentiles {<p>: number|null}, method, outliers_tukey []. Any computed number is null when the result is not finite, i.e. overflows the double range (e.g. values=1e308,1e308)

Deterministic: identical input returns identical output, so the response is served with Cache-Control: private, max-age=31536000, immutable (the paying client may cache it indefinitely; shared caches must not, because the response is paid).

Price: $0.05 USDC per call (x402, Base). Route contract version 1.0.0. Docs: https://api.duoleads.com/docs#num-stats

get/v1/num/stats

Request

  • Base URL: https://api.duoleads.com
  • URL: https://api.duoleads.com/v1/num/stats
  • Auth: none declared

Query parameters

valuesstring required

Comma-separated finite numbers, at most 500 values. Accepted: comma-separated finite numbers.

percentilesstring

Comma-separated percentiles 0-100, at most 20. Default 25,50,75. Accepted: numbers between 0 and 100.

method'linear' | 'nearest' | 'lower' | 'higher' | 'midpoint'

Percentile interpolation (NumPy/R names): linear (default), nearest, lower, higher, midpoint. Accepted: linear, nearest, lower, higher, midpoint.

ddofinteger

Delta degrees of freedom for variance/stdev: 1 (default, sample, n-1) or 0 (population, n). The *_population fields are always population. Accepted: integer 0-1.

Response

Paid and settled. data is route-specific; a route that judges its input returns 200 with data.valid: false for a bad value.

okunknown required
route'/v1/num/stats' required
version'1.0.0' required

Changes

No recorded changes to this operation across all 1 revision of this API.