API for developers
Web agencies and technical teams use the WCAG.win API to run accessibility checks from their own software – for example to stop accessibility errors before a site goes live. The API returns JSON with Vietnamese issue names and a link to the full report.
API keys
API keys are available on paid plans. The account owner creates a key on the account page, section "API keys". A key is shown only once when it is created; WCAG.win only stores its hash. Each account can have up to 5 active keys; revoke a leaked key on the account page straight away.
Send the key in a header on every request:
Authorization: Bearer wcag_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Only call the API from servers or continuous integration (CI). Never put a key in code that runs in your users' browsers.
Limits
| Plan | Page scans / 24 hours | Website scans / 24 hours |
|---|---|---|
| Self-check | 100 | 5 |
| Monitor | 300 | 5 |
| DRD Audit | 100 | 5 |
| Basic annual | 200 | 5 |
| Advanced annual, DRD Complete annual | 500 | 5 |
Limits apply to the whole account. Website scans only work for websites whose ownership has been verified, up to the page limit of your plan.
Scan one page
Start a scan
curl -X POST https://wcag.win/api/v1/quet \
-H "Authorization: Bearer $WCAG_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.org/contact/"}'
Returns the scan id (HTTP 202). Optional dungLaiPhut (0–60, default 5): reuse a public result for the same address scanned within that many minutes; set 0 to always scan afresh.
{ "id": "ab12cd34ef56", "dungLai": false, "trangThai": "cho",
"kiemTra": "https://wcag.win/api/v1/quet/ab12cd34ef56",
"baoCao": "https://wcag.win/ket-qua/ab12cd34ef56/" }
Get the result
Poll every 10–15 seconds until trangThai is xong (done), bi_chan (the site blocks scanners) or loi (error). A page usually finishes in 1–3 minutes.
curl https://wcag.win/api/v1/quet/ab12cd34ef56 -H "Authorization: Bearer $WCAG_KEY"
{ "id": "ab12cd34ef56", "url": "https://example.org/contact/", "trangThai": "xong", "diem": 72,
"soLoiMay": 5, "soRobot": 2,
"loiMay": [ { "luat": "color-contrast", "ten": "Chữ không đủ tương phản với nền", "muc": "serious", "soCho": 12, "tieuChi": ["1.4.3"] } ],
"robot": [ { "ma": "khong-vien", "ten": "Không thấy viền focus khi dùng bàn phím", "muc": "serious", "tieuChi": ["2.4.7"] } ],
"baoCao": "https://wcag.win/ket-qua/ab12cd34ef56/" }
Field names are Vietnamese: diem score, loiMay automated (axe-core) issues with the rule id in luat, robot keyboard/robot issues, tieuChi WCAG success criteria, soCho number of places. muc: critical, serious, moderate, minor. diem is a reference score from 0 to 100, not a conformance certificate.
Scan a whole website
curl -X POST https://wcag.win/api/v1/quet-web \
-H "Authorization: Bearer $WCAG_KEY" -H "Content-Type: application/json" \
-d '{"host": "example.org"}'
curl https://wcag.win/api/v1/quet-web/SCAN_ID -H "Authorization: Bearer $WCAG_KEY"
The result has trangThai (tim finding pages → dang scanning → xong done), soTrang pages, soXong pages done, the average diem, site-wide loiMay and robot (with the number of pages affected), the list of pages in trang and the report link.
Error codes
Errors return JSON {"loi": "message in Vietnamese", "ma": "code"}. Use the stable ma code in your software.
| HTTP | ma | Meaning |
|---|---|---|
| 401 | khoa-sai | Missing, wrong or revoked key |
| 403 | het-goi | The paid plan has expired |
| 400 | url-sai, json-sai | Invalid address, or the body is not JSON |
| 404 | khong-co, web-chua-xac-minh | No such scan, or the website is not verified |
| 409 | dang-quet | The website already has a scan running |
| 429 | het-luot | The 24-hour limit has been used up |
GitHub Action: stop accessibility errors before going live
Add the step below to your GitHub Actions workflow after deploying to staging. It scans the pages, writes a results table into the run summary and fails when a page scores below the threshold or has issues at or above the chosen severity. Store the key under Settings → Secrets as WCAG_KHOA.
- name: Accessibility check (WCAG.win)
uses: ./.github/actions/wcag-win
with:
khoa-api: ${{ secrets.WCAG_KHOA }}
cac-trang: |
https://staging.example.org/
https://staging.example.org/contact/
diem-toi-thieu: 90
chan-tu-muc: serious # critical | serious | moderate | minor | none
Setup: download action.yml and kiem.mjs (they only need the Node.js already on GitHub runners, no packages to install) and put them in .github/actions/wcag-win/ in your repository. Inputs: khoa-api API key, cac-trang pages (one per line), diem-toi-thieu minimum score, chan-tu-muc lowest severity that fails the step. The summary it writes is in Vietnamese.
Browser extension
The "WCAG.win – Kiểm nhanh" extension for Chrome and Edge runs the automated checks right on the page you have open (including pages behind a login and intranet pages), lists issues in Vietnamese and highlights where each issue is on the page. It sends nothing about the page anywhere. Its release on the extension stores will be announced later.