---
title: "Compare Documents (Plain Text PDF)"
method: POST
path: "/document/plaintext"
---

# Compare Documents (Plain Text PDF)

`POST /document/plaintext`

## Request

- Base URL: `https://api.diffchecker.com/public`
- URL: `https://api.diffchecker.com/public/document/plaintext`
- Auth: one of:
  - API key in header `X-Api-Key`
  - API key in query parameter `email`

Compute a plain-text diff between two PDF documents. Supports both multipart/form-data file uploads and JSON with base64-encoded data URLs.

## Query parameters

- `email` string, email
- `input_type` 'json' | 'form'
- `output_type` 'json' | 'html' | 'html_json', required
- `diff_level` 'word' | 'character'

## Headers

- `Diffchecker-Version` '1'

## Request body

- object
  - `left_pdf` string, required: Data URL of the left PDF (data:application/pdf;base64,...).
  - `right_pdf` string, required: Data URL of the right PDF (data:application/pdf;base64,...).

## Response `200`

Diff computed successfully. Same response structure as Text diff.

- union
  - TextDiffJsonResponse
    - `creditsUsed` integer, required: Credits charged for the diff request.
    - `rows` object[], required
      - `end` boolean
      - `start` boolean
      - `insideChanged` boolean
      - `left` DiffSide
        - `chunks` object[]
          - `value` string
          - `type` 'equal' | 'insert' | 'remove'
        - `line` integer
      - `right` DiffSide
        - `chunks` object[]
          - `value` string
          - `type` 'equal' | 'insert' | 'remove'
        - `line` integer
    - `added` integer, required: Number of added chunks.
    - `removed` integer, required: Number of removed chunks.
  - HtmlJsonResponse
    - `creditsUsed` integer, required: Credits charged for the diff request.
    - `html` string, required: HTML markup of the diff table.
    - `css` string, required: CSS styles for the diff table.

## Other responses

- `400`: Validation error, malformed JSON, invalid form-data, or corrupt or password-protected PDF input.
- `401`: Authentication failed. Provide a valid email or API key. Depending on the failure, the response can include more specific error codes.
- `404`: No endpoint matches the request path.
- `405`: The endpoint exists but does not support the request method. The `Allow` response header lists the methods it does support.
- `408`: Request timed out.
- `413`: The request exceeded the active size limit for the caller's authentication method or plan.
- `415`: The request Content-Type is not one this endpoint accepts. `/text` accepts only application/json; the upload endpoints accept application/json and multipart/form-data.
- `429`: Rate limit exceeded. Depending on the throttle, the response may also include `retryAfterSeconds` and a `Retry-After` response header.
- `500`: Unexpected PDF processing failure, or an unexpected server failure.

---

[API](https://skmtc.dev/diffchecker/apis/diffchecker-api.md) · [All operations](https://skmtc.dev/diffchecker/apis/diffchecker-api/llms.txt) · [OpenAPI document](https://skmtc.dev/diffchecker/apis/diffchecker-api/revisions/f2bb895fe9a7?raw)
