Accessible Colors API
accessible-colors.com · Developer Tools
Check WCAG accessibility contrast ratio between foreground and background colors. Validates AA and AAA compliance for text and large text. Free, no API key.
Authentication
No authentication requiredFree to use with no key needed.
Sample Requests
POST
Check contrast
Check if dark gray on white passes WCAG accessibility.
https://accessible-colors.com
Hover any highlighted part to learn what it does
Headers — extra info sent with the request
| Content-Type | application/json |
Request Body — data you're sending
{
"bold": false,
"font_size": 16,
"background": "#ffffff",
"foreground": "#333333"
}
curl -X POST "https://accessible-colors.com/" \
-H "Content-Type: application/json" \
-H "Content-Type: application/json" \
-d '{"bold":false,"font_size":16,"background":"#ffffff","foreground":"#333333"}'import requests
headers = {
"Content-Type": "application/json"
}
data = {
"bold": false,
"font_size": 16,
"background": "#ffffff",
"foreground": "#333333"
}
response = requests.post(
"https://accessible-colors.com/",
headers=headers,
json=data,
)
print(response.json())const url = 'https://accessible-colors.com/';
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"bold": false,
"font_size": 16,
"background": "#ffffff",
"foreground": "#333333"
}),
});
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"bytes"
"encoding/json"
)
func main() {
targetURL := "https://accessible-colors.com/"
jsonData, _ := json.Marshal({"bold":false,"font_size":16,"background":"#ffffff","foreground":"#333333"})
req, _ := http.NewRequest("POST", targetURL, bytes.NewBuffer(jsonData))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://accessible-colors.com/")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Post.new(uri)
req["Content-Type"] = "application/json"
req["Content-Type"] = "application/json"
req.body = "{\"bold\":false,\"font_size\":16,\"background\":\"#ffffff\",\"foreground\":\"#333333\"}"
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://accessible-colors.com/";
$opts = ["http" => [
"method" => "POST",
"header" => implode("\r\n", [
"Content-Type: application/json",
"Content-Type: application/json"
]),
"content" => json_encode({"bold":false,"font_size":16,"background":"#ffffff","foreground":"#333333"}),
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- No API key needed
- POST to https://accessible-colors.com with foreground, background, font_size, bold
- Response includes contrast_ratio and isAccessible flag
- WCAG AA requires 4.5:1 for normal text, 3:1 for large text
- WCAG AAA requires 7:1 for normal text, 4.5:1 for large text