# PDF accessibility checker API

> Check PDFs against the machine-checkable criteria of PDF/UA through an API and get a JSON report with pages and fixes. Free API key, 20 files a day.

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.

```bash
# 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
```

```bash
# 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"}'
```

```js
// 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);
```

```python
# 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"])
```

[Get a free API key](https://switchfile.io/signup). [Try the checker in the browser](https://switchfile.io/pdf-accessibility-checker).

## What comes back

```json
{
  "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://…"
  }
}
```

Shortened answer with example values.

- summary is the sentence for people, criteria holds the numbers behind it.
- topics lists the failed topics with the most failed checks first, each with up to 100 affected pages and the fix steps.
- report_json_url is the full report with every finding; report_pdf_url is the report as an accessible PDF when you ask for it.

## What the check covers

- **PDF/UA-1 and PDF/UA-2**: profile=auto checks against PDF/UA-2 when the file declares it and against PDF/UA-1 otherwise. ua1 or ua2 sets the part yourself.
- **Only what software can check**: Software can tell whether the file is tagged and has a title and a language, whether figures carry alternative text, and how tables and lists are tagged. Whether alt text is meaningful or the reading order makes sense needs a person, so manual_review_needed is true in every result.
- **Your file stays as it is**: The check reads the PDF and writes a report. It does not repair or change the file; the report says how to fix each problem at the source.
- **Up to 25 MB and 500 pages**: A longer or very complex PDF fails with INPUT_TOO_LARGE. When a check hits its time limit, complete is false and the counts cover the part that was checked.

In jobs under /v2 the same check runs as the task accessibility/check. That way a job can convert a Word file to PDF and check the PDF in one go.

## Topics in the report

- [Character encoding failed: characters without Unicode mapping](https://switchfile.io/pdf-accessibility-checker/errors/character-encoding-failed)
- [Content is neither tagged nor marked as artifact](https://switchfile.io/pdf-accessibility-checker/errors/pdf-content-not-tagged)
- [Custom tags are not mapped, or standard tags are remapped](https://switchfile.io/pdf-accessibility-checker/errors/role-mapping-non-standard-tags)
- [Document language is missing or invalid](https://switchfile.io/pdf-accessibility-checker/errors/pdf-language-not-set)
- [Figure or formula has no alternative text](https://switchfile.io/pdf-accessibility-checker/errors/pdf-alt-text-missing)
- [Fonts are not embedded or are faulty](https://switchfile.io/pdf-accessibility-checker/errors/fonts-not-embedded)
- [Heading structure is incorrect](https://switchfile.io/pdf-accessibility-checker/errors/pdf-heading-levels)
- [Links are not tagged or have no description](https://switchfile.io/pdf-accessibility-checker/errors/links-not-tagged)
- [List structure is invalid](https://switchfile.io/pdf-accessibility-checker/errors/pdf-list-structure)
- [PDF document title missing or not displayed](https://switchfile.io/pdf-accessibility-checker/errors/pdf-title-missing)
- [PDF is not tagged or the structure tree is incomplete](https://switchfile.io/pdf-accessibility-checker/errors/pdf-not-tagged)
- [PDF/UA identifier is missing or wrong](https://switchfile.io/pdf-accessibility-checker/errors/pdfua-identifier-missing)
- [Tab order failed: pages with annotations need /Tabs /S](https://switchfile.io/pdf-accessibility-checker/errors/tab-order-failed)
- [Table structure is invalid or header cells are not assigned](https://switchfile.io/pdf-accessibility-checker/errors/pdf-table-structure)
- [Tagged annotations failed: comments and other annotations without tags](https://switchfile.io/pdf-accessibility-checker/errors/tagged-annotations-failed)
- [Tagged form fields failed: form fields without tag or description](https://switchfile.io/pdf-accessibility-checker/errors/tagged-form-fields-failed)

## Pricing

- Free: 20 files/day, checks and conversions together, free API key
- Credit pack: from €7, 500 credits, one-time, no subscription
- Monthly: from €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.
[Pricing](https://switchfile.io/pricing)

## Questions

### 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.
