Compare Text

Compute a diff between two text strings with configurable output formats.

post/text

Request

  • Base URL: https://api.diffchecker.com/public
  • URL: https://api.diffchecker.com/public/text
  • 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' required

Specifies the type of output you receive in the response body.

  • json: Row metadata generated from diff computation (Content-Type: application/json)
  • html: Same HTML/CSS you see on the Diffchecker site (Content-Type: text/html)
  • html_json: Same HTML/CSS you see on the Diffchecker site, but split up and embedded in JSON (Content-Type: application/json)
diff_level'word' | 'character'

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

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

leftstring required

Left text you want to diff.

rightstring required

Right text you want to diff.

Response

Diff computed successfully.

OR

Changes

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