# WCAG Checker: axe-core accessibility audit for pages and sites (`examsens.ai/wcag-checker`) Actor

Check your pages against WCAG 2.0, 2.1 or 2.2 before a release or an accessibility review. It runs axe-core in headless Chrome and lists each failure by success criterion, with the element, its HTML and how to fix it, plus the items a person still has to review.

- **URL**: https://apify.com/examsens.ai/wcag-checker.md
- **Developed by:** [Ed Rayyis](https://apify.com/examsens.ai) (community)
- **Categories:** Developer tools, SEO tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.50 / 1,000 page checkeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## WCAG Checker: axe-core accessibility audit for pages and sites

Give it a list of pages, or a site to crawl, and it tests each page against the Web Content Accessibility Guidelines (WCAG) in headless Chrome with axe-core, the open source accessibility rules engine. Pick WCAG 2.0, 2.1 or 2.2, at Level A, AA or AAA.

Every failure comes grouped under its WCAG success criterion, with the criterion number, name and level, the impact rating, the CSS selector of the element, its HTML, and what to change. Checks that axe-core could not decide on its own are listed for manual review. Each site gets a summary row, and the run can save a readable HTML report.

### Use it for

- Checking a landing page, a campaign page or a whole site for accessibility failures before it goes live.
- Running the same audit every week on your key pages and watching the failure count move.
- Giving a developer a list of exact elements to fix, each with its selector, its HTML and the change to make.

### Sample

Input, one page with the defaults (WCAG 2.2, Level AA):

```json
{ "startUrls": [{ "url": "https://www.w3.org/WAI/demos/bad/before/home.html" }] }
```

That page is the W3C's deliberately inaccessible demo site. The run returned one page row and one summary row. The page row reports 6 failed rules on 46 elements, with 2 critical and 4 serious. The criteria that failed are 1.1.1, 1.4.3, 2.4.4, 2.5.8, 3.1.1 and 4.1.2. Under 1.1.1 Non-text Content, 33 images have no alt attribute. The first one comes back as:

```json
{
  "selector": "img[src$=\"border_left_top.gif\"]",
  "html": "<img src=\"./img/border_left_top.gif\" width=\"10px\" height=\"10px\">",
  "howToFix": "Fix any of the following: Element does not have an alt attribute ..."
}
```

### What it checks, and what it cannot

axe-core tests the parts of WCAG a program can test. With WCAG 2.2 Level AA selected, axe-core 4.13.0 runs 63 rules that cover 20 of the 55 success criteria at Level A and AA. The other criteria need a person: whether alt text describes the image, whether captions match the audio, whether a page works with a keyboard from start to finish.

axe-core finds on average 57% of WCAG issues automatically \[1]. A page with no automated failures can still fail WCAG. Use this actor to find and track the failures a machine can see, then have a person review the rest. It does not certify conformance.

### Input

- Pages or sites (required)
- WCAG version: 2.0, 2.1 or 2.2 (default 2.2)
- Conformance level: A, AA or AAA (default AA). AA includes A, and AAA includes both. axe-core has three AAA rules: one for 1.4.6 Contrast (Enhanced), one for 2.4.9 Link Purpose (Link Only), and one that checks 2.2.4 Interruptions and 3.2.5 Change on Request together.
- Crawl the site (default off). Follows links from each start page to pages on the same site, skipping files such as PDF and images.
- Maximum pages per site (default 20) and maximum crawl depth (default 2)
- Exclude URLs: regular expressions for crawled links to skip
- Respect robots.txt (default on). Applies to crawled links. Pages you list are always tested.
- Include items needing manual review (default on)
- Include best practices (default off). Adds the 27 axe-core best practice rules, kept apart from the WCAG failures.
- Device: desktop (1366 by 900) or mobile (iPhone 13 profile)
- One row per failing element (default off), for a flat CSV or Excel export
- Elements listed per rule (default 10). The full count is always given.
- HTML report (default on)
- Wait until, wait for selector, extra delay (default 1,000 ms), page timeout (default 30 seconds), pages at once (default 3)

### Output

One dataset row per page (`type: page`):

- `url`, `finalUrl`, `status`, `title`, `crawlDepth`, `standard`, `device`
- `violationCount`: failed rules, `failedElementCount`: failing elements
- `criteriaFailed`: the success criterion numbers that failed, such as `1.4.3`
- `impactCounts`: failed rules by axe-core impact (critical, serious, moderate, minor)
- `criteria`: one entry per failed success criterion with `criterion`, `name`, `level`, a link to the W3C Understanding page, and its `rules`. Each rule has `ruleId`, `impact`, `help`, `helpUrl`, `elementCount` and `elements`, and each element has `selector`, `html` and `howToFix`.
- `manualReview`: checks axe-core could not decide, with the criteria they relate to and the elements involved
- `bestPractice`: best practice failures, when that option is on
- `passedRuleCount`, `axeVersion`, `checkedAt`

One summary row per site (`type: summary`): pages tested, pages with failures, pages not tested, failing elements, impact counts, the criteria that failed, the ten criteria failing on the most pages, the manual review count and the link to the HTML report.

With one row per failing element on, each listed element also gets a row (`type: issue`) with the page, criterion, level, impact, issue, selector, HTML and how to fix.

A page that cannot be tested gets `ok: false` and an `error`: an address that is not a web address, a host that does not resolve, a page that answers with an HTTP error such as 404, or a file that is not HTML. The run carries on with the next page.

The HTML report is saved as `report.html` in the run's key value store and opens in any browser. The dataset has three views: Pages, Site summary, and Issues.

### Pricing

Pay per event: one event per page tested. Pages that cannot be tested are not charged. The run stops when it reaches the maximum charge you set.

### Scope and conduct

Only public pages are opened. The actor does not log in, fill in forms or collect personal data. Each page opens in a fresh browser context with no cookies carried over. No proxies are used. Test sites you are allowed to test.

axe-core 4.13.0 is included unchanged under the Mozilla Public License 2.0 \[2], and its license file ships with the actor.

### Related actors

From the same account, for checking a website:

- [Lighthouse Audit: bulk speed, SEO and accessibility scores](https://apify.com/examsens.ai/lighthouse-audit)
- [Site Audit: on page SEO and broken link checks](https://apify.com/examsens.ai/site-audit)
- [Color Palette Extractor: web pages and images to hex palettes](https://apify.com/examsens.ai/color-palette-extractor)

### Support

Questions and problems: the Issues tab on this page.

### References

1. dequelabs/axe-core | README | github.com. https://github.com/dequelabs/axe-core

2. dequelabs/axe-core | LICENSE, Mozilla Public License 2.0 | github.com. https://github.com/dequelabs/axe-core/blob/develop/LICENSE

# Actor input Schema

## `startUrls` (type: `array`):

Pages to test. With crawling on, each one is also a starting point for finding more pages on the same site.

## `wcagVersion` (type: `string`):

The version of the Web Content Accessibility Guidelines to test against.

## `conformanceLevel` (type: `string`):

AA includes A, and AAA includes A and AA.

## `crawl` (type: `boolean`):

Follow links from each start page to other pages on the same site, up to the page and depth limits below.

## `maxPagesPerSite` (type: `integer`):

Crawling stops adding pages for a site once this many are queued, start pages included. Each page tested is one billable event.

## `maxCrawlDepth` (type: `integer`):

How many clicks away from a start page the crawl may go. 1 tests the pages linked from the start page.

## `excludePatterns` (type: `array`):

Crawled links that match any of these are skipped, for example /tag/ or ?page=

## `respectRobotsTxt` (type: `boolean`):

Skip crawled links that the robots.txt file of the site disallows. Start pages you list are always tested.

## `includeManualReview` (type: `boolean`):

List the checks axe-core could not decide on its own, such as text over a background image.

## `includeBestPractices` (type: `boolean`):

Also run the axe-core best practice rules. They are not WCAG success criteria and are listed apart from the WCAG failures.

## `device` (type: `string`):

Desktop uses a 1366 by 900 window. Mobile uses an iPhone 13 profile (390 by 664 CSS pixels, phone user agent, touch).

## `issueRows` (type: `boolean`):

Also add a dataset row for every failing element listed, for a flat CSV or Excel export.

## `maxElementsPerRule` (type: `integer`):

How many failing elements to list for each rule on a page. The full count is always given.

## `htmlReport` (type: `boolean`):

Save a readable report of the whole run as report.html in the key value store. Its link is in each summary row.

## `waitUntil` (type: `string`):

When the page counts as loaded before testing starts.

## `waitForSelector` (type: `string`):

Optional CSS selector to wait for before testing, for pages that build their content with JavaScript.

## `delayMs` (type: `integer`):

Wait this long after loading before testing.

## `timeoutSecs` (type: `integer`):

Give up on a page that does not load within this time.

## `maxConcurrency` (type: `integer`):

How many pages to test in parallel.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.w3.org/WAI/"
    }
  ],
  "wcagVersion": "2.2",
  "conformanceLevel": "AA",
  "crawl": false,
  "maxPagesPerSite": 20,
  "maxCrawlDepth": 2,
  "respectRobotsTxt": true,
  "includeManualReview": true,
  "includeBestPractices": false,
  "device": "desktop",
  "issueRows": false,
  "maxElementsPerRule": 10,
  "htmlReport": true,
  "waitUntil": "load",
  "delayMs": 1000,
  "timeoutSecs": 30,
  "maxConcurrency": 3
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `report` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "startUrls": [
        {
            "url": "https://www.w3.org/WAI/"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("examsens.ai/wcag-checker").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "startUrls": [{ "url": "https://www.w3.org/WAI/" }] }

# Run the Actor and wait for it to finish
run = client.actor("examsens.ai/wcag-checker").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrls": [
    {
      "url": "https://www.w3.org/WAI/"
    }
  ]
}' |
apify call examsens.ai/wcag-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,examsens.ai/wcag-checker"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/NfL8y88YkRWOifn3s/builds/xQxMwTriGyY2Qqrp0/openapi.json
