Skip to main content

How to get the raw Axe Core and W3C Validator results via the Rocket Validator API

by Jaime Iniesta
Partial screenshot of a raw check result in JSON format

Rocket Validator is a site-wide accessibility and HTML validation service. It automatically scans your website and checks each internal web page found using two checkers: Axe Core for finding accessibility issues, and the W3C Validator Nu for HTML validation.

Both validators provide a JSON output with the check results, containing every detail about the issues found. Rocket Validator processes these raw results to provide a more concise and user-friendly report, group the issues by kind and severity, and apply the muting rules you may have configured.

However, there are cases where you may need to access the raw results directly, for example when integrating Rocket Validator with other services, or when you need to process the results in a way that is not supported by the standard report.

That’s why we’ve just released the new Raw Checks API endpoint that allows you to access the raw results of the checks in their original format.

What additional information do raw checks provide?

In the case of results from the W3C Validator Nu checker, for the HTML validation, there’s not much difference between the raw and the processed results, and the difference is mostly due to how the information is structured in the JSON output, and minimal differences in how the severity of the issues is calculated.

On the other hand, the Axe Core results provide much more information in their raw results. While in the processed results we only show the results of the violations list in the results, in the raw results you can also find the list of incomplete checks (those that could not be determined as pass or fail), the inapplicable checks for those rules that couldn’t find a matching element in the page to test for, and the passes list with all the checks that passed.

How to use the raw checks API endpoint

If you want to access the raw results of the checks, you need to tell Rocket Validator to keep these raw results in the report, otherwise the raw results are deleted after processing.

To enable raw result storing in the report, you can pass a boolean flag in the create report request for each kind of check: store_raw_html_checks and / or store_raw_a11y_checks.

For example, the following request will enable raw Axe Core results storing for the report:

{
    "data": {
        "attributes": {
            "starting_url": "https://dummy.rocketvalidator.com",
            "store_raw_a11y_checks": true
        }
    }
}

Finally, once the report has been run, you can access the raw results of the checks by calling the new raw checks API endpoint with the web page ID. For example, to get the raw Axe Core results for a web page, you would call:

GET /api/v1/reports/{{REPORT_ID}}/web_pages/{{WEB_PAGE_ID}}/raw_a11y_check

You can consult the documentation to read more about the new Raw Checks API endpoint.

Credit cost for raw checks

The new Raw Checks API endpoint is available for users with an Enterprise, Agency or Pro plan.

Enabling the storage of raw checks will increase the number of credits consumed by the report at the cost of 1 credit per stored raw check.

For example, running a report with HTML and accessibility checks on 10 web pages will normally consume 20 credits (10 HTML checks and 10 accessibility checks). If you enable the storage of raw checks on this report, we’ll charge an additional 20 credits (10 stored HTML raw checks and 10 stored accessibility raw checks).

Consider not storing raw checks unless you need them, or only storing the kind of raw checks you need (HTML and / or accessibility).

Ready to validate your sites?
Start your trial today.