# Saylor Innovations WCAG Contrast Ratio Calculator

> Saylor Innovations WCAG Contrast Ratio Calculator is a paid API for AI agents from saylorinnovations.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-12-02).

Calculates the WCAG contrast ratio between two sRGB colors and returns luminance values plus AA/AAA compliance flags for normal and large text

## Facts

- Endpoint: GET https://saylorinnovations.com/api/accessibility/contrast?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-12-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/saylor-innovations-wcag-contrast-ratio-calculator-8f05f270
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Cuf8lMx0_3tX7rXv7JYE0

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 saylor-innovations-wcag-contrast-ratio-calculator-8f05f270
```

Example prompt: Can you check if white text (255,255,255) on a dark navy background (10,25,70) passes WCAG AA and AAA contrast requirements for normal-sized text?

## When to prefer this

Use this endpoint when you need a quick, standards-based WCAG contrast ratio calculation for a pair of sRGB colors without standing up your own luminance math. It is ideal for accessibility auditing pipelines, design tools, or agent workflows that need to verify AA/AAA compliance flags in a single lightweight call. Prefer this over manual calculation or general-purpose color libraries when you want authoritative WCAG flags returned directly as structured JSON.

## Known failure modes

- Missing foreground or background query parameter returns an error
- Malformed RGB string (e.g. non-numeric values or wrong number of components) causes a parsing error
- RGB values outside 0–255 range may produce unexpected results
- Network timeout or service unavailability returns a non-200 response

## How this service works

WCAG contrast ratio calculator for two sRGB colors - luminance, ratio and AA/AAA flags

## Output

Returns the foreground and background RGB arrays, the computed WCAG contrast ratio (1–21), boolean flags for AA and AAA compliance at both normal and large text sizes, the formula used, and a scope note describing what the calculation covers and its limitations.

## 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",
    "queryParams"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "foreground",
      "background"
     ],
     "properties": {
      "background": {
       "type": "string",
       "description": "required RGB such as 255,255,255 (query)"
      },
      "foreground": {
       "type": "string",
       "description": "required RGB such as 0,0,0 (query)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "json"
    },
    "example": {
     "type": "object",
     "required": [
      "foreground_rgb",
      "background_rgb",
      "contrast_ratio",
      "aa_normal",
      "aaa_normal",
      "scope_note"
     ],
     "properties": {
      "formula": {
       "type": "string",
       "description": "Formula used for the calculation"
      },
      "aa_large": {
       "type": "boolean",
       "description": "Aa large"
      },
      "aa_normal": {
       "type": "boolean",
       "description": "Aa normal"
      },
      "aaa_large": {
       "type": "boolean",
       "description": "Aaa large"
      },
      "aaa_normal": {
       "type": "boolean",
       "description": "Aaa normal"
      },
      "scope_note": {
       "type": "string",
       "description": "What this data covers and what it leaves out"
      },
      "background_rgb": {
       "type": "array",
       "items": {
        "type": "number"
       },
       "description": "Background rgb"
      },
      "contrast_ratio": {
       "type": "number",
       "description": "WCAG contrast ratio from 1 to 21"
      },
      "foreground_rgb": {
       "type": "array",
       "items": {
        "type": "number"
       },
       "description": "Foreground rgb"
      }
     },
     "description": "Output fields observed in live endpoint responses; optionality and values can vary by record.",
     "additionalProperties": true
    },
    "description": {
     "type": "string"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/saylor-innovations-wcag-contrast-ratio-calculator-8f05f270/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from saylorinnovations.com](https://www.zero.xyz/host/saylorinnovations.com/llms.txt)
