---
title: "Compare Images"
method: POST
path: "/image"
---

# Compare Images

`POST /image`

## Request

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

Compute a visual diff between two images. Supports both multipart/form-data file uploads and JSON with base64-encoded data URLs.

## Query parameters

- `email` string, email
- `input_type` 'json' | 'form', required
- `output_type` 'json' | 'png', required

## Headers

- `Diffchecker-Version` '1'

## Request body

- object
  - `left_image` string, required: Data URL of the left image you want to diff.
  - `right_image` string, required: Data URL of the right image you want to diff.

## Response `200`

Diff computed successfully.

- ImageDiffJsonResponse
  - `creditsUsed` integer, required: Credits charged for the diff request.
  - `dataUrl` string, required: Data URL of the diff image (PNG).
  - `diffPixels` integer, required: Number of pixels that differ.
  - `totalPixels` integer, required: Total number of pixels compared.
  - `misMatchPercentage` number, float, required: Percentage of pixels that differ.
  - `width` integer, required
  - `height` integer, required
  - `originalWidth` integer, required
  - `originalHeight` integer, required
  - `changedWidth` integer, required
  - `changedHeight` integer, required

## Other responses

- `400`: Invalid request data or image content.
- `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.
- `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`: Image comparison failed due to a server-side processing error, 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)
