---
title: "WCAG contrast ratio between two colors — the check the URL-based a11y endpoint can't do"
method: GET
path: "/api/a11y/contrast"
tags: ["Accessibility"]
---

# WCAG contrast ratio between two colors — the check the URL-based a11y endpoint can't do

`GET /api/a11y/contrast`

## Request

- Base URL: `https://api.webbersites.com`
- URL: `https://api.webbersites.com/api/a11y/contrast`
- Auth: API key in header `X-PAYMENT`

WCAG contrast ratio between two colors — the check the URL-based a11y endpoint can't do. Give a foreground and background color (hex or rgb()); returns the exact ratio and AA/AAA pass/fail for normal text, large text, and UI components, with a plain-English verdict. ?fg=&bg=

Price: $0.001 per call, paid in USDC via the x402 protocol (see the x402 security scheme).

## Query parameters

- `fg` string, required
- `bg` string, required

## Response `200`

Success

- object
  - `contrast_ratio` number
  - `passes` object
  - `summary` string

## Other responses

- `402`: Payment required — the response body lists accepted payment methods (amount, asset, network, pay-to address). Retry the request with a signed X-PAYMENT header.

---

[API](https://skmtc.dev/webbersites/apis/webbersites-x402-data-api.md) · [All operations](https://skmtc.dev/webbersites/apis/webbersites-x402-data-api/llms.txt) · [OpenAPI document](https://skmtc.dev/webbersites/apis/webbersites-x402-data-api/revisions/c14a76c67a94?raw)
