# WCAG Contrast Ratio Checker

> WCAG Contrast Ratio Checker is a paid API for AI agents from api.webbersites.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-10).

Calculates the WCAG contrast ratio between a foreground and background color, returning the exact ratio and AA/AAA pass/fail verdicts for normal text, large text, and UI components.

## Facts

- Endpoint: GET https://api.webbersites.com/api/a11y/contrast?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/wcag-contrast-ratio-checker-a2570dc4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_M8L7QLgX54_dRBdfhdcGV

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 wcag-contrast-ratio-checker-a2570dc4
```

Example prompt: What's the WCAG contrast ratio between foreground color #1a1a2e and background color #f0f4f8 — does it pass AA and AAA for normal text, large text, and UI components?

## When to prefer this

Use this endpoint when you need the precise WCAG contrast ratio computation between two specific colors, including separate AA/AAA verdicts for normal text, large text, and UI components. Prefer this over general URL-based accessibility checkers that cannot accept arbitrary color pairs as input.

## Known failure modes

- Missing fg or bg parameter returns a 400 error
- Invalid color format (not hex or rgb()) returns a parsing error
- Malformed hex codes (e.g. wrong length) may return an error or unexpected result
- Network timeout if the service is temporarily unavailable

## How this service works

WebberSites – Branding, Web Design, Photography, Marketing Strategy - Youngstown Ohio

## Output

Returns the exact numeric contrast ratio (e.g. 7.43:1), plus pass/fail status for WCAG AA and AAA levels across three contexts — normal text, large text, and UI components — along with a plain-English summary verdict.

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "fg",
      "bg"
     ],
     "properties": {
      "bg": {
       "type": "string",
       "description": "Background color — hex or rgb()"
      },
      "fg": {
       "type": "string",
       "description": "Foreground/text color — hex (#111 or #111111) or rgb()"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "passes": {
       "type": "object"
      },
      "summary": {
       "type": "string"
      },
      "contrast_ratio": {
       "type": "number"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "passes": {
   "large_text": {
    "AA": true,
    "AAA": true
   },
   "normal_text": {
    "AA": true,
    "AAA": false
   }
  },
  "summary": "Good — passes AA for normal text and AAA for large text.",
  "background": "#ffffff",
  "foreground": "#767676",
  "ratio_string": "4.54:1",
  "contrast_ratio": 4.54
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/wcag-contrast-ratio-checker-a2570dc4/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)
