---
title: Check WCAG Color Contrast API
slug: color-contrast-checker
url: https://apyhub.com/creightonnick0/service/color-contrast-checker
provider: nick creighton
categories: [Developer Tools]
tags: [wcag, accessibility, color-contrast, design-tokens, ui-testing]
auth: api_key
---

# Check WCAG Color Contrast API

Compare foreground and background colors and get WCAG 2.1 contrast ratio, AA/AAA pass-fail, luminance, and a recommendation.

## Endpoints

| Method | Path | Description | Atoms |
| --- | --- | --- | --- |
| POST | `` | What it does Checks the contrast between a foreground color and a background color, using the two i… | 10 |

## About

## What it does
Color Contrast Checker compares a foreground and background color and returns the WCAG 2.1 contrast result for that pair. Send a foreground color in `fg` and a background color in `bg`; each can be provided as a hex value, `rgb()` value, or CSS color name.

The response includes the original `fg` and `bg` values, `contrast_ratio`, `contrast_ratio_display`, `overall_level`, and a `passes` object with AA/AAA results for normal and large text. You also get `fg_luminance`, `bg_luminance`, and a `recommendation` string to help you adjust a color combination that fails.

Use Color Contrast Checker when you need to validate design tokens, review brand palettes, or check text colors before shipping a UI. It gives you a quick accessibility signal for buttons, labels, alerts, and any other foreground/background pairing where readability matters.

## Usage

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/creightonnick0/service/color-contrast-checker
