PDF accessibility checker API
Send a PDF to POST /v1/accessibility/checks and get back how many machine-checkable PDF/UA criteria it meets. Each failed topic comes with its pages and the steps to fix it in the source file.
# Key from switchfile.io/dashboard/keys. Waits up to 30 s for the result; # a slower check answers 202, then fetch links.self. curl "https://api.switchfile.io/v1/accessibility/checks?wait=true" \ -H "Authorization: Bearer $SWITCHFILE_API_KEY" \ -F file=@report.pdf -F profile=auto
# The PDF is fetched from a public URL. report_pdf adds # the report as an accessible PDF (English). curl "https://api.switchfile.io/v1/accessibility/checks?wait=true" \ -H "Authorization: Bearer $SWITCHFILE_API_KEY" -H "Content-Type: application/json" \ -d '{"url": "https://example.com/annual-report.pdf", "report_pdf": "en"}'
// npm i switchfile import Switchfile from "switchfile"; const switchfile = new Switchfile({ apiKey: process.env.SWITCHFILE_API_KEY }); const check = await switchfile.accessibilityChecks.create("report.pdf", { wait: true }); console.log(check.result.summary, check.result.topics);
# pip install switchfile-sdk import os import switchfile switchfile.configure(api_key=os.environ["SWITCHFILE_API_KEY"]) check = switchfile.AccessibilityCheck.create("report.pdf", wait=True) print(check["result"]["summary"], check["result"]["topics"])
What comes back
Shortened answer with example values. Every field is in the API reference.
{
"object": "accessibility_check",
"status": "finished",
"credits": 1,
"result": {
"summary": "104 of 110 machine-checkable criteria met; manual review needed",
"criteria": { "applied": 110, "met": 104, "failed": 6 },
"manual_review_needed": true,
"complete": true,
"profile": "ua1",
"pages": 12,
"topics": [{
"id": "tab-order",
"title": "Tab order does not follow the document structure",
"failed_checks": 3,
"pages": [2, 5, 9],
"explanation": "ā¦",
"fix": { "word": ["ā¦"], "indesign": ["ā¦"], "acrobat": ["ā¦"] }
}],
"report_json_url": "https://ā¦"
}
}What the check covers
PDF/UA-1 and PDF/UA-2
Only what software can check
Your file stays as it is
Up to 25 MB and 500 pages
Topics in the report
Each topic has a page with the rule behind it, an example and the fix. The API returns the same steps in fix.
Pricing
Free
20
checks and conversions together, free API key
Credit pack
ā¬7
500 credits, one-time, no subscription
Monthly
ā¬4
500 credits a month, cancel at any time
A check uses 1 credit per started minute, at least 1. Most checks take a few seconds. Failed checks use no credits. Creating the report as PDF counts towards the same billed time.
A check that is done within a minute costs ā¬0.0043 to ā¬0.014, depending on the plan or pack.
See all pricesSDKs and integrations
Questions
About checking PDFs through the API.
Does a clean result mean the PDF is accessible?
No. The API reports the machine-checkable criteria of PDF/UA. It is not a statement that a file meets legal requirements, and a person who knows the content still has to review it.
How do I check many PDFs?
Send one request per file. Without wait the request answers at once with 202; fetch links.self with ?wait=true later. Checks send no webhooks. An Idempotency-Key header makes a retry after a timeout safe.
How long do you keep the PDF and the report?
Both are deleted 24 hours after the check, at the time in expires_at. DELETE /v1/accessibility/checks/{id} removes them earlier.
Can I try it without code?
Yes. The checker on our website sends your PDF to the same server-side check and shows the report as a page.