{"uid":"cap_BWYM7TWj8wrH_0_wQvdBB","slug":"wcag-contrast-ratio-checker-01e2c349","name":"WCAG Contrast Ratio Checker","description":"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.","url":"https://api.gadgethumans.com/color-contrast?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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}}}}},"responseSchema":{"type":"json","example":{"ok":true}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_xJcld289xfMBOjbr8XJoX","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Checks the WCAG contrast ratio between a foreground and background color pair, reporting AA and AAA compliance for normal and large text.","exampleAgentPrompt":"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?","exampleUseCases":[{"title":"Pre-launch palette accessibility audit","prompt":"Before we ship our new design system, check if our primary text color #1a1a1a on our brand background #f5f0eb passes WCAG AA and AAA for both normal and large text."},{"title":"Dark mode color validation","prompt":"I'm building a dark mode — does light grey text (#e0e0e0) on a dark charcoal background (#212121) meet WCAG AAA contrast requirements for normal-sized text?"},{"title":"Button text accessibility check","prompt":"Check whether my call-to-action button — white text on an orange background (#e65c00) — passes WCAG AA contrast for normal text so it's accessible to visually impaired users."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-17T00:36:37.452Z","isFirstParty":false,"canonicalSlug":"wcag-contrast-ratio-checker-01e2c349"}