# Descriptive Statistics & Correlation API

> Descriptive Statistics & Correlation API is a paid API for AI agents from api.webbersites.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Computes exact descriptive statistics (count, sum, mean, median, stddev, percentiles) and Pearson correlation with linear regression over numeric arrays or datastore collections, using Kahan summation for accuracy.

## Facts

- Endpoint: POST https://api.webbersites.com/api/calc/stats
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/descriptive-statistics-correlation-api-ab31052b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Y-Y3LP-HHBXBjwkuGjH-8

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability descriptive-statistics-correlation-api-ab31052b -d '<json body>'
```

Example prompt: Can you calculate the exact descriptive stats — count, mean, median, standard deviation, and 25th/75th percentiles — for these 500 sales figures: [12.4, 88.3, 45.0, ...]? Also give me the Pearson correlation and linear regression between the sales and the corresponding ad-spend values I'll pass as x and y arrays.

## When to prefer this

Prefer this endpoint when exact numerical accuracy matters (LLMs cannot reliably sum or average large arrays), when you need full descriptive stats in one call, when computing correlation or regression between two variables, or when you want to run stats directly on a stored datastore collection without re-uploading data.

## Known failure modes

- Array exceeds 100k values — request rejected
- Mismatched x/y array lengths — correlation cannot be computed
- Invalid field name for object array or collection — field not found error
- Collection not found or wallet identity not authorized — 401/404
- Malformed JSON body — 400 bad request
- Payment not included or insufficient — 402 payment required

## How this service works

Exact descriptive statistics — LLMs cannot reliably sum 200 numbers; this can. POST {values:[…]} for count/sum/mean/median/stddev/percentiles; {x:[],y:[]} for Pearson correlation + linear regression; {rows:[…], field} for object arrays — or {collection, field?} to run stats DIRECTLY ON YOUR DATASTORE collection (the paying wallet is the identity; reading extends its life 30 days). Up to 100k values, Kahan-summed.

## Output

Returns exact descriptive statistics including count, sum, mean, median, standard deviation, and percentiles for value arrays; Pearson correlation coefficient and linear regression slope/intercept for paired x/y arrays; supports up to 100k values with Kahan summation to prevent floating-point drift.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "properties": {
      "x": {
       "type": "array",
       "description": "with y: correlation + regression"
      },
      "y": {
       "type": "array"
      },
      "rows": {
       "type": "array",
       "description": "objects — with field/fields to pick columns"
      },
      "field": {
       "type": "string"
      },
      "values": {
       "type": "array",
       "description": "numbers to describe"
      },
      "collection": {
       "type": "string",
       "description": "run stats on YOUR datastore collection instead of posting data"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "max": {
       "type": "number"
      },
      "min": {
       "type": "number"
      },
      "sum": {
       "type": "number"
      },
      "mean": {
       "type": "number"
      },
      "count": {
       "type": "number"
      },
      "median": {
       "type": "number"
      },
      "stddev": {
       "type": "number"
      },
      "variance": {
       "type": "number"
      },
      "pearson_r": {
       "type": "number"
      },
      "regression": {
       "type": "object"
      },
      "percentiles": {
       "type": "object"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "sum": 67.5,
  "mean": 13.5,
  "count": 5,
  "median": 13.9,
  "stddev": 1.41,
  "percentiles": {
   "p25": 12.5,
   "p75": 14.1,
   "p95": 15
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/descriptive-statistics-correlation-api-ab31052b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.webbersites.com](https://www.zero.xyz/host/api.webbersites.com/llms.txt)
