Heading Analysis

Heading Analysis

This API uses machine learning models and inspects whether the text below each heading is related to the heading content or not. It covers the following Issue IDs:

Issue ID: cr_heading_unrelated

Definition

The content immediately following a heading identified by machine learning is possibly unrelated to the topic or purpose.

User Impact

Blind screen reader users rely on headings to navigate page content. When headings are misleading and do not reflect the topic or purpose, users can become disoriented and have difficulty navigating the page. Users with learning differences may also have difficulty understanding page content when headings are unrelated to content.

Recommendation

Provide clear and descriptive headings that accurately describe the immediatley following content.

Success Criterion

2.4.6 Headings and Labels (Level AA)

Related Success Criteria (if applicable):

1.3.1 Info and Relationships (Level A)

More details can be found at Understanding Success Criterion 2.4.6.

Request
URI
POST
https://{api_host}/http://{server-ip}:{port}//crest/api/operable/heading-analysis
COPY
Request Body
request_body of type(s) application/json
Required
{
    "url": "string",
    "reporttype": 0
}
string
url
Required

A URL to check WCAG violations on. It should be a valid URL.

integer
reporttype
Optional

reporttype is either xpath(value: 3) or css selector(value: 4)

Responses
200

The Success response contains categories that aggregate all the Error and Alert related issues.

Returns heading_analysis_success_response of type(s) application/json
{
    "categories": {
        "alert": {
            "count": 0,
            "description": "string",
            "items": {
                "cr_heading_unrelated": {
                    "count": 0,
                    "description": "string",
                    "id": "string",
                    "level": "string",
                    "xpaths": []
                }
            }
        }
    },
    "statistics": {
        "allitemcount": 0,
        "pageurl": "string",
        "time": "number",
        "totalelements": 0
    },
    "status": {
        "httpstatuscode": 0,
        "success": "string"
    }
}
categories
Required

categories

statistics
Required

statistics

status
Required

status


400

Bad Request, missing something, or the request body wasn't correct.

Returns failure_response of type(s) application/json
{
    "status": {
        "error": "string",
        "success": "string"
    }
}
status
Required

status