Document Diff API

Last Revised: September 18th, 2024

Usage

POST https://api.diffchecker.com/public/pdf

Parameters

NameTypeInRequiredDescription
input_typestringquerySpecifies the request content-type. Value must be one of 'json' or 'form'. Default is 'form'. - json: application/json - form: multipart/form-data
output_typestringquerySpecifies the type of output you receive in the response body. Value must be one of 'json', 'html', or 'html_json'. - json: (Content-Type: application/json) Row metadata generated from PDF-text diff computation - html: (Content-Type: text/html) Same html/css you see on Diffchecker site for PDF-text diffs - html_json: (Content-Type: application/json) Same html/css you see on Diffchecker site for PDF-text diffs, but split up and embedded in JSON
diff_levelstringquerySpecifies whether you want to diff by word or character. Value must be one of 'word' or 'character'. Default is 'word'. Should only be used with PDF-text diff related output types.
left_pdffile or stringbodyIf input_type=json: string containing data url of left pdf you want to diff If input_type=form: Left pdf file you want to diff. File extension must be .pdf
right_pdffile or stringbodyIf input_type=json: string containing data url of right pdf you want to diff If input_type=form: Right pdf file you want to diff. File extension must be .pdf

Examples

curl --location --request POST 'https://api.diffchecker.com/public/pdf?output_type=json&email=YOUR_EMAIL' \
  --form 'left_pdf=@"/Users/user_name/Documents/example-1.pdf"' \
  --form 'right_pdf=@"/Users/user_name/Documents/example-2.pdf"'

JSON Responses

output_type=json

Same structure as Text diff response with output_type=json

output_type=html_json

Same structure as Text diff response with output_type=html_json