# Outlier Detection (IQR & Z-Score)

> Outlier Detection (IQR & Z-Score) is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Flags outliers in a numeric series using IQR (Tukey fences) or z-score method, returning outlier values, their indices, and the thresholds applied.

## Facts

- Endpoint: POST https://agent402.tools/api/outliers
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/outlier-detection-iqr-z-score-94cc5ae5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_rxlfm7oQo6mb3dErIWRa9

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 outlier-detection-iqr-z-score-94cc5ae5 -d '<json body>'
```

Example prompt: Flag any outliers in this list of daily temperatures using the IQR method with a 1.5 multiplier: [72, 74, 71, 300, 73, 70, 68, 72, 999, 74, 71].

## When to prefer this

Choose this endpoint when you need a quick, stateless outlier check on a numeric series without setting up a local stats library. Prefer IQR mode for skewed or non-Gaussian data; prefer zscore mode when the data is approximately normal. Ideal for data cleaning pipelines, anomaly alerting, or pre-processing steps inside an AI agent workflow.

## Known failure modes

- Fewer than 4 values provided — returns validation error
- Array exceeds 10,000 elements — returns size limit error
- Non-numeric values in array — returns type error
- Invalid method string (not 'iqr' or 'zscore') — returns parameter error
- Empty array — returns validation error

## How this service works

Flag outliers in a numeric series using either the IQR rule (Tukey fences at 1.5·IQR - robust, default) or z-score (|z| > threshold - assumes normality). Returns the outlier values + their indices + the thresholds used so you can decide whether to trust them.

## Output

Returns the outlier values, their zero-based indices in the input array, and the computed fence or threshold values (e.g., lower/upper Tukey fences for IQR, or z-score cutoff) so the caller can understand why each point was flagged.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "method": {
   "type": "string",
   "description": "\"iqr\" (default) or \"zscore\""
  },
  "values": {
   "type": "array",
   "description": "Numeric series (max 10000, at least 4 values)"
  },
  "threshold": {
   "type": "number",
   "description": "IQR multiplier (default 1.5) or z-score cutoff (default 3)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "n": 10,
  "method": "iqr",
  "outliers": [
   {
    "index": 9,
    "value": 100
   }
  ],
  "threshold": 1.5,
  "lowerBound": -4.625,
  "upperBound": 14.375,
  "outlierCount": 1
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/outlier-detection-iqr-z-score-94cc5ae5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
