Compare Documents (Rich Text)

Compute a rich-text diff between two PDFs with polygon geometry and optional visual object comparisons. Supports multipart/form-data uploads and JSON with base64-encoded data URLs.

post/document/richtext

Request

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

Query parameters

emailstring email

Your email address. Required if not using an API key.

output_type'json' | 'html' | 'html_json' | 'pdf' required

Specifies the response format.

  • json: Structured rich-text payload with polygons + page metadata (Content-Type: application/json)
  • html: Self-contained HTML (Content-Type: text/html)
  • html_json: HTML/CSS parts in JSON (Content-Type: application/json)
  • pdf: Binary PDF export with rich-text highlights (Content-Type: application/pdf)
input_type'json' | 'form'

Specifies the request content-type.

  • form: multipart/form-data (default)
  • json: application/json
diff_level'word' | 'character'

Specifies whether to diff by word or character. Default is word.

page_image_scalenumber

Rendering scale used for page image generation and geometry alignment. Allowed range is 0.25 to 4. For non-pdf outputs, explicit values above a document-safe runtime maximum return 400.

show_moves'true' | 'false'

Include move detection in the diff. Default is true.

compare_font_family'true' | 'false'

Compare font family style changes. Default is false.

compare_font_size'true' | 'false'

Compare font size style changes. Default is false.

compare_font_color'true' | 'false'

Compare text color style changes. Default is false.

compare_regular_images'true' | 'false'

Compare raster image changes. Images are compared by their own pixels where possible, so content drawn over an image isn't reported as an image change. Default is false.

compare_vector_graphics'true' | 'false'

Compare vector graphic changes. Default is false.

compare_form_xobjects'true' | 'false'

Compare form XObject changes. Default is false.

compare_shading_objects'true' | 'false'

Compare shading object changes. Default is false.

pdf_layout'split-view' | 'alternating' | 'left-document' | 'right-document'

Layout used when output_type=pdf.

  • split-view (default)
  • alternating
  • left-document
  • right-document

Headers

Diffchecker-Version'1'

API version to serve the request with. Defaults to the newest version, currently 1, when omitted. An unsupported version is rejected with 400 UNSUPPORTED_API_VERSION. See Versioning and Deprecation in the getting started guide.

Request body

left_pdfstring required

Data URL of the left PDF (data:application/pdf;base64,...).

right_pdfstring required

Data URL of the right PDF (data:application/pdf;base64,...).

Response

Rich-text diff computed successfully.

OR

Changes

No recorded changes to this operation across all 1 revision of this API.