DEV Community

Custodia-Admin
Custodia-Admin

Posted on • Originally published at pagebolt.dev

Run axe-core Accessibility Audits via REST API — No Browser Setup Required

Run axe-core Accessibility Audits via REST API — No Browser Setup Required

Your website has WCAG 2.1 violations. You don't know because running accessibility audits requires either hiring auditors (expensive, slow) or running axe-core locally (infrastructure overhead).

PageBolt's /audit endpoint runs accessibility checks on any URL via REST API. No browser setup. No infrastructure. One API call.

The Accessibility Audit Problem

Manual auditing (hiring professionals):

  • Cost: $5,000–15,000 per audit
  • Timeline: 4–6 weeks
  • Scope: Single snapshot in time
  • ROI: By the time report arrives, code changed

Self-hosted axe-core (running locally):

  • Setup: Browser management, Node.js dependencies
  • Scaling: Infrastructure for concurrent audits
  • Maintenance: axe-core updates, Chromium patches
  • Time: 5–10 seconds per URL (fresh browser startup)

API-based auditing (PageBolt /audit):

  • Cost: $0.01–0.05 per audit at scale
  • Timeline: <1 second per URL
  • Scope: Audit on every deploy, every staging push, continuously
  • ROI: Catch violations before they reach production

The API Solution

One curl command:

curl -X POST https://api.pagebolt.dev/v1/audit \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://yoursite.com/product/123",
    "options": {
      "standards": ["wcag2aa", "wcag21aa"],
      "include_violations": true
    }
  }'
Enter fullscreen mode Exit fullscreen mode

Response:

{
  "url": "https://yoursite.com/product/123",
  "standards": ["wcag2aa", "wcag21aa"],
  "violations": {
    "critical": [
      {
        "id": "color-contrast",
        "description": "Elements must have sufficient color contrast (Level AA)",
        "impact": "critical",
        "elements": 3,
        "wcag_ref": "WCAG 2.1 1.4.3 Contrast (Minimum)",
        "remediation": "Increase contrast ratio to at least 4.5:1 for normal text",
        "html_snippets": [
          "<button class=\"btn-secondary\">Click me</button>"
        ]
      }
    ],
    "serious": [
      {
        "id": "duplicate-id",
        "description": "IDs must be unique",
        "impact": "serious",
        "elements": 2,
        "wcag_ref": "WCAG 2.1 4.1.1 Parsing"
      }
    ],
    "moderate": [
      {
        "id": "list-structure",
        "description": "Lists should be semantically marked",
        "impact": "moderate",
        "elements": 5
      }
    ],
    "minor": []
  },
  "audit_time_ms": 2847,
  "passed": false
}
Enter fullscreen mode Exit fullscreen mode

That's it. Structured violations with WCAG references, impact levels, and remediation guidance.

Real-World Examples

CI/CD Deploy Gate

Fail the deploy if critical violations exist:

#!/bin/bash

RESPONSE=$(curl -s -X POST https://api.pagebolt.dev/v1/audit \
  -H "Authorization: Bearer $PAGEBOLT_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"url\": \"https://staging.example.com\"}")

CRITICAL=$(echo $RESPONSE | jq '.violations.critical | length')

if [ "$CRITICAL" -gt 0 ]; then
  echo "❌ Deploy blocked: $CRITICAL critical accessibility violations"
  exit 1
fi

echo "✅ Accessibility check passed"
Enter fullscreen mode Exit fullscreen mode

Continuous Compliance Monitoring

Daily audit of your own site + competitors:

for url in "https://yoursite.com" "https://competitor.com"; do
  curl -X POST https://api.pagebolt.dev/v1/audit \
    -H "Authorization: Bearer $PAGEBOLT_KEY" \
    -H "Content-Type: application/json" \
    -d "{\"url\": \"$url\"}" \
    | jq '.violations | keys[] as $level | {level: $level, count: (.[$level] | length)}'
done
Enter fullscreen mode Exit fullscreen mode

Bulk Page Audits

Audit 100 pages from your product in parallel:

pages=$(curl -s https://api.example.com/sitemap.json | jq -r '.pages[]')

parallel -j 10 'curl -s -X POST https://api.pagebolt.dev/v1/audit \
  -H "Authorization: Bearer $PAGEBOLT_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"url\": \"{}\"}" | jq ".violations.critical | length"' ::: $pages

# Count total violations
echo "Total critical violations: $(echo $results | awk '{s+=$1} END {print s}')"
Enter fullscreen mode Exit fullscreen mode

Response Format Breakdown

Every audit response includes:

  • critical — Failures that make site unusable (keyboard navigation, screen readers)
  • serious — Failures that significantly impact accessibility
  • moderate — Issues that reduce usability
  • minor — Small accessibility improvements

Each violation includes:

  • WCAG reference — Exact rule that failed (e.g., "WCAG 2.1 1.4.3")
  • Remediation — How to fix it
  • HTML snippet — Which element failed
  • Impact level — How serious

Why PageBolt Audits vs Self-Hosted axe-core

Factor axe-core Self-Hosted PageBolt /audit API
Setup time 30 min (Node, Chrome, dependencies) 5 min (API key)
Per-URL latency 5–10s (fresh browser) <1s (API call)
Infrastructure cost $50–300/month Pay-per-audit ($0.01–0.05)
Maintenance burden High (updates, patches) None
Scaling Complex (concurrent browsers) Automatic
100 URLs/day cost ~$100/month infrastructure ~$1/month API
1,000 URLs/day cost ~$300/month infrastructure ~$10/month API

Standards Supported

  • WCAG 2.0 Level A — Minimum accessibility standard
  • WCAG 2.1 Level AA — Legally required in most jurisdictions
  • WCAG 2.1 Level AAA — Enhanced accessibility (rarely required)
  • Section 508 — US federal website compliance

Next Steps

  1. Get API key (50 free audits/month): pagebolt.dev/pricing
  2. Read the audit docs: pagebolt.dev/docs/audit
  3. Test it:
   curl https://api.pagebolt.dev/v1/audit -d '{"url": "https://example.com"}'
Enter fullscreen mode Exit fullscreen mode
  1. Add to CI/CD — Include deploy gate in your pipeline

Try free — 50 audits/month, no credit card required.

Top comments (0)