Web accessibility isn't optional anymore. With regulations like the ADA, EAA (European Accessibility Act), and WCAG 2.1 guidelines becoming enforceable, every website needs to meet baseline accessibility standards. But manually checking every page is impractical — that's where automated accessibility testing comes in.
In this guide, we'll show you how to use the ToolCenter Accessibility API to programmatically scan any URL for WCAG violations, integrate it into your CI/CD pipeline, and catch accessibility issues before they reach production.
Why Automate Accessibility Testing?
Manual accessibility audits are expensive ($5,000–$25,000 per audit) and only capture a snapshot in time. Every new deployment can introduce regressions. Automated testing catches the low-hanging fruit — typically 30–50% of accessibility issues — continuously and at zero marginal cost.
Common issues that automated tools catch:
- Missing alt text on images (WCAG 1.1.1)
- Form inputs without labels (WCAG 1.3.1)
- Missing page language attribute (WCAG 3.1.1)
- Skipped heading levels (WCAG 1.3.1)
- Disabled zoom on mobile (WCAG 1.4.4)
- Empty links and buttons (WCAG 4.1.2)
- Duplicate IDs (WCAG 4.1.1)
- Missing ARIA landmarks (WCAG 1.3.1)
Getting Started with the Accessibility API
First, grab your free API key from the ToolCenter dashboard. The Accessibility API analyzes any public URL and returns a detailed WCAG compliance report.
Basic Request
curl -X POST https://api.toolcenter.dev/v1/accessibility \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}'
Response
{
"url": "https://example.com",
"score": 85,
"grade": "B",
"total_issues": 3,
"summary": {
"errors": 0,
"warnings": 2,
"notices": 1
},
"landmarks": {
"main": 1,
"nav": 1
},
"issues": [
{
"type": "warning",
"rule": "generic-link-text",
"wcag": "2.4.4",
"message": "Links with generic text",
"selector": "a",
"count": 1
}
]
}
The API checks 15+ WCAG rules across categories like perceivable, operable, understandable, and robust. Each issue includes the WCAG criterion reference, severity level, and affected element count.
Understanding the Score
The accessibility score (0–100) translates to a letter grade:
| Score | Grade | Meaning |
|---|---|---|
| 90–100 | A | Excellent — minimal issues |
| 80–89 | B | Good — minor improvements needed |
| 70–79 | C | Fair — several issues to address |
| 50–69 | D | Poor — significant barriers exist |
| 0–49 | F | Failing — critical accessibility problems |
Errors are weighted most heavily (−10 points each), warnings moderately (−5 points), and notices lightly (−2 points).
Integrating with CI/CD
The real power of automated accessibility testing is running it on every deployment. Here's how to add it to a GitHub Actions workflow:
GitHub Actions Example
name: Accessibility Check
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
a11y:
runs-on: ubuntu-latest
steps:
- name: Check accessibility
run: |
RESULT=$(curl -s -X POST https://api.toolcenter.dev/v1/accessibility \
-H "Authorization: Bearer ${{ secrets.TOOLCENTER_API_KEY }}" \
-H "Content-Type: application/json" \
-d '{"url": "https://staging.yoursite.com"}')
SCORE=$(echo $RESULT | jq '.score')
ERRORS=$(echo $RESULT | jq '.summary.errors')
echo "Accessibility Score: $SCORE"
echo "Errors: $ERRORS"
if [ $SCORE -lt 70 ]; then
echo "::error::Score $SCORE below threshold (70)"
echo $RESULT | jq '.issues[]'
exit 1
fi
This workflow runs on every push and PR, failing the build if the accessibility score drops below 70.
Node.js Integration
Using the ToolCenter SDK, you can build more sophisticated monitoring:
import ToolCenter from 'toolcenter';
const tc = new ToolCenter('YOUR_API_KEY');
async function auditPages(urls) {
const results = [];
for (const url of urls) {
const result = await tc.accessibility({ url });
results.push({
url,
score: result.score,
grade: result.grade,
errors: result.summary.errors,
warnings: result.summary.warnings
});
if (result.summary.errors > 0) {
console.warn(`Warning: ${url} has ${result.summary.errors} errors`);
result.issues
.filter(i => i.type === 'error')
.forEach(i => console.warn(` [${i.wcag}] ${i.message} (${i.count}x)`));
}
}
const avgScore = results.reduce((sum, r) => sum + r.score, 0) / results.length;
console.log(`\nAverage accessibility score: ${avgScore.toFixed(1)}`);
return results;
}
auditPages([
'https://yoursite.com',
'https://yoursite.com/pricing',
'https://yoursite.com/contact',
'https://yoursite.com/docs',
]);
What the API Checks
The ToolCenter Accessibility API runs 15+ automated checks based on WCAG 2.1 guidelines:
Perceivable (WCAG 1.x)
- img-alt (1.1.1) — Images without alt attributes
- svg-title (1.1.1) — SVGs without accessible names
- form-labels (1.3.1) — Inputs missing labels
- table-headers (1.3.1) — Tables without header cells
- heading-hierarchy (1.3.1) — Skipped heading levels
- zoom-disabled (1.4.4) — Viewport disables zoom
- autoplay-media (1.4.2) — Auto-playing audio/video
Operable (WCAG 2.x)
- keyboard-access (2.1.1) — Click handlers without keyboard support
- skip-navigation (2.4.1) — Missing skip nav link
- page-title (2.4.2) — Missing or empty title
- empty-links (2.4.4) — Links without discernible text
- generic-link-text (2.4.4) — “Click here” style link text
- tabindex-positive (2.4.3) — Positive tabindex values
Understandable (WCAG 3.x)
- html-lang (3.1.1) — Missing language attribute
Robust (WCAG 4.x)
- duplicate-id (4.1.1) — Duplicate ID attributes
- empty-button (4.1.2) — Buttons without text
Best Practices
- Set a minimum score threshold — Start at 70 and gradually increase to 90
- Monitor key pages — Homepage, signup, checkout, and documentation are priorities
- Track trends over time — Store scores in a database and alert on regressions
- Combine with manual testing — Automated tools catch ~30–50% of issues; screen reader testing catches the rest
- Fix errors first — Errors have the biggest impact on real users
Conclusion
Automated accessibility testing is the first line of defense for inclusive web development. With the ToolCenter Accessibility API, you can integrate WCAG compliance checks into any workflow — CI/CD pipelines, monitoring dashboards, or scheduled audits — in minutes.
The API is available on the free tier with 100 requests/month. Get your API key and start scanning today.