Fare

API docs

Base URL: https://api.fare.dev. Also available as Markdown and OpenAPI.

Authentication

Send your key in the X-API-Key header (or Authorization: Bearer <key>). Keys start with fare_live_. Fare is in private beta; keys are issued by invitation.

Free beta plan: 500 successful calls per calendar month (UTC), 2 requests per second. Failed calls are not counted.

PDF/UA validator POST /v1/pdf/validate

Send the PDF as the raw request body, up to 50 MB. Optional query parameter profile: ua1 (PDF/UA-1), ua2 (PDF/UA-2), or omit it to use the part the file claims in its metadata.

curl -X POST "https://api.fare.dev/v1/pdf/validate?profile=ua1" \
  -H "X-API-Key: $FARE_KEY" -H "Content-Type: application/pdf" \
  --data-binary @report.pdf
{
  "profile": "PDF/UA-1",
  "compliant": false,
  "failed_rules": ["7.1-t03", "7.3-t01"],
  "violations": [
    {"rule": "7.1-t03", "message": "Content is neither tagged nor marked as an Artifact."},
    {"rule": "7.3-t01", "message": "Figure has no Alt or ActualText."}
  ],
  "rule_set": "veraPDF validation profiles"
}

Rule IDs match the veraPDF validation profiles, so results compare directly with veraPDF. Repeats of one rule are capped at 50 per report.

PDF/UA remediator POST /v1/pdf/remediate

Send the PDF as the raw request body, up to 50 MB. Untagged documents are tagged (headings, paragraphs, lists, tables, figures, links, reading order, headers and footers as artifacts); tagged documents are repaired in place. Document-level fixes (language, title, metadata, Unicode maps) apply to both. Page drawing is never changed.

Optional query parameters: lang (detected when omitted), title (from metadata or the first heading when omitted) and format: pdf (default) or json.

curl -X POST "https://api.fare.dev/v1/pdf/remediate?lang=en" \
  -H "X-API-Key: $FARE_KEY" -H "Content-Type: application/pdf" \
  --data-binary @agenda.pdf -o agenda-accessible.pdf -D -

PDF responses carry Fare-Compliant, Fare-Remaining-Rules (rule IDs still failing, such as 7.3-t01 for figures that need alt text) and Fare-Review-Items. With format=json you get compliant, remaining_rules, violations_before/after, fixes, review, outline and pdf_base64.

Automatic remediation cannot judge meaning: review the review items (alt text, guessed headings and table headers) before publishing.

Email-security grade GET /v1/email-grade

Query parameters: domain (required) and selector (optional DKIM selector; otherwise common selectors are probed).

curl "https://api.fare.dev/v1/email-grade?domain=example.com" -H "X-API-Key: $FARE_KEY"

Returns grade (A–F), score (0–100: SPF 30, DMARC 50, DKIM 20), spf, dmarc and dkim checks with a status each, mx, accepts_mail, and fixes in priority order.

Errors

Errors are JSON: {"error": {"code": "…", "message": "…"}}.

Error codes
StatusCodeMeaning
400invalid_domain, invalid_selector, invalid_profile, invalid_format, invalid_lang, not_pdfBad input
401missing_key, invalid_keyNo key, unknown key or revoked key
413—PDF larger than 50 MB
422unreadable_pdfThe file could not be parsed as a PDF
429rate_limited, quota_exceededPer-second limit or monthly quota reached
502dns_failedA DNS lookup failed; retry shortly
504timeoutValidation (60 s) or remediation (120 s) took too long