# WCAG Contrast Ratio Checker

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

Checks the WCAG contrast ratio between a foreground and background color pair, reporting AA and AAA compliance for normal and large text.

## Facts

- Endpoint: GET https://api.gadgethumans.com/color-contrast?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-17
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/wcag-contrast-ratio-checker-01e2c349
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_BWYM7TWj8wrH_0_wQvdBB

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-01e2c349
```

Example prompt: Can you check if white text (#ffffff) on a navy blue background (#003087) passes WCAG AA and AAA contrast standards for both normal and large text?

## When to prefer this

Use this endpoint when you need an instant, deterministic WCAG contrast ratio check without rendering a browser or running a full accessibility audit. Ideal for CI/CD pipelines, design tools, or any agent workflow that needs to validate color accessibility before shipping a UI palette.

## Known failure modes

- Missing fg or bg query parameter returns an error
- Invalid or unrecognized color format may return an error or unexpected ratio
- Very similar colors will return a low ratio and fail all WCAG levels

## How this service works

Check the WCAG contrast ratio between two colours and report AA and AAA pass or fail for normal and large text. Pure CPU, instant. Use before shipping a palette.

## Output

Returns a JSON object indicating the computed contrast ratio and WCAG pass/fail status for AA and AAA levels at both normal and large text sizes, allowing the caller to determine if the color pair is accessible.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "queryParams": {
     "type": "object",
     "required": [
      "fg",
      "bg"
     ],
     "properties": {
      "bg": {
       "type": "string",
       "description": "Background colour"
      },
      "fg": {
       "type": "string",
       "description": "Foreground colour"
      }
     }
    }
   }
  },
  "output": {
   "type": "object",
   "properties": {
    "example": {
     "ok": true
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/wcag-contrast-ratio-checker-01e2c349/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.gadgethumans.com](https://www.zero.xyz/host/api.gadgethumans.com/llms.txt)
