Comparison & Quality API
Two endpoints over HTTP. Send two files and get a 0–100 similarity score (SSIM, PSNR, MFCC, WER). Send one and get its quality measured — bitrate, focus, noise, loudness, clipping — with no reference needed. Built for CI pipelines, upload gates, visual-regression checks and automation scripts.
Overview
The DiffALL API runs the same engines as the website. Compare two files of the same type — images, video, audio, subtitles or text — and get back a similarity score from 0 to 100 plus a short verdict. Check one image, video or audio file and get a band per measured dimension, with the weakest one named.
- Auth: an X-API-Key header on every request.
- Cost: free. Each successful call — a comparison or a quality check — counts toward the account’s 20 a day, shared with the website. A call that fails validation does not count.
- Server-side only: no CORS headers are set; call it from your backend or scripts, not the browser.
1. Get an API key
Sign in to DiffALL, then open the API Keys panel on the home page and click + New key. Your key (it looks like dk_live_…) is shown once — copy it immediately. We only ever store a hash, so a lost key can't be recovered; just revoke it and create a new one.
Sign in & create a key →2. Compare two files
Send a multipart/form-data POST with fields file1 and file2. For images, add mode=feature for rotation/lighting-tolerant matching.
Images, subtitles & text — instant result
curl -X POST https://diff-all.com/api/v1/compare \ -H "X-API-Key: dk_live_your_key_here" \ -F file1=@before.png \ -F file2=@after.png
{
"status": "done",
"similarity": 92.4,
"type": "image",
"verdict": "Moderate similarity — files share significant content"
}
Video & audio — asynchronous
These take longer, so the API returns a job_id with HTTP 202. Poll the status_url until status is done.
# 1. start the job
curl -X POST https://diff-all.com/api/v1/compare \
-H "X-API-Key: dk_live_your_key_here" \
-F file1=@a.mp4 -F file2=@b.mp4
# → 202 {"status":"processing","job_id":"<uuid>","status_url":"/api/v1/compare/<uuid>"}
# 2. poll until done
curl https://diff-all.com/api/v1/compare/<uuid> \
-H "X-API-Key: dk_live_your_key_here"
# → {"status":"processing","progress":42} …then…
# → {"status":"done","similarity":88.1,"type":"video","verdict":"…"}
3. Check one file’s quality
Send a multipart/form-data POST with a single field, file1. There is nothing to compare against, so the numbers here are not similarity percentages. The response carries a score from 0 to 100 for the file — the weakest check's own number dragged down by whatever else is weak, then clamped into that check's band, so it can never disagree with the band beside it. Each measured dimension also gets a band — Excellent, Good, Fair or Poor —, its own score from 0 to 100 on that check's scale (always inside its band: 85+ Excellent, 65+ Good, 40+ Fair), and a measurement with units. band at the top is the weakest of them, never an average.
Images — instant result
curl -X POST https://diff-all.com/api/v1/quality \ -H "X-API-Key: dk_live_your_key_here" \ -F file1=@photo.jpg
{
"status": "done",
"type": "quality",
"media": "image",
"band": "Fair",
"headline": "Compression: Visible JPEG blocking when zoomed in.",
"width": 1080, "height": 720, "megapixels": 0.8,
"dimensions": [
{ "key": "compression", "label": "Compression", "band": "Fair", "score": 45,
"finding": "Visible JPEG blocking when zoomed in.",
"fix": "Re-export from the original at a higher quality setting.",
"measurement": "block-edge ratio 2.33 (1.00 = none)" }
]
}
Video & audio — asynchronous
Same shape as a video comparison: HTTP 202 with a status_url, polled at the same /api/v1/compare/<job_id> endpoint.
curl -X POST https://diff-all.com/api/v1/quality \
-H "X-API-Key: dk_live_your_key_here" \
-F file1=@track.mp3
# → 202 {"status":"processing","job_id":"<uuid>","media":"audio",
# "window_seconds":180,"plan_limited":false,
# "status_url":"/api/v1/compare/<uuid>"}
- Video reports bitrate as bits per pixel per frame, focus, noise, compression, exposure, and whether the frame rate is real.
- Audio reports bitrate as bits per sample, clipping, integrated loudness in LUFS, the frequency range actually present, and whether a stereo file carries two channels. The frequency range is the one to watch: a low-bitrate file re-exported at a high one still carries the low one’s content, and this is where it shows.
- window_seconds is how much of the file is read: up to 3 minutes of video or audio.
- band can be null. Every check declines rather than guessing on a file it cannot read — a flat colour, a silent recording — and the headline says why.
- If the file uses a codec this server cannot decode (AV1 is the common one), the report carries undecodable_codec and only what needs no decoder, such as the bitrate.
Endpoints
| Method & path | Description |
|---|---|
| POST /api/v1/compare | Upload file1 + file2. Returns the score (image/subtitle/text) or a job_id (video/audio). |
| POST /api/v1/quality | Upload one file1. Returns the report (image) or a job_id (video/audio). |
| GET /api/v1/compare/<job_id> | Poll any async job — a comparison or a quality check — until status is done. |
Response fields
| Field | Meaning |
|---|---|
| similarity | Comparisons only. The headline score, 0–100 (higher = more similar). |
| band | Quality checks only. The weakest dimension’s band, or null when nothing could be measured. |
| dimensions | Quality checks only. One entry per measured check: key, band, score (0–100, that check only — never compare two checks' scores), finding, fix, measurement, next (what would move this check up a band, in its own units; empty at the top), and — only when the check found a problem — where: boxes as [x, y, w, h] fractions of the picture, a png clipping mask, or seconds for a finding about time (repeated frames, clipped audio). On video, frame is a JPEG of the moment marked and second says which. |
| notes | Quality checks only, and only when there is something to say: facts read out of the container at no cost — variable frame rate, audio/video start offset, rotation flag, non-square pixels, bit depth, missing colour tags, HDR, extra audio tracks. Each is key, text and why; none carries a band or a score. |
| moments | Quality checks only, and only when something was found: places worth a look that a detector cannot tell apart from a deliberate choice, so they carry no band or score. freezes (video: seconds, durations) and dropouts (audio: seconds). |
| type | For a comparison, the detected media type: image, video, audio, subtitle or text. For a quality check, quality, with the medium in media. |
| verdict | A one-line human summary of the score. |
| status | done, processing, queued, or error. |
Status codes
| Code | Meaning |
|---|---|
| 200 | Success (synchronous result, or a poll response). |
| 202 | Async job accepted — poll the status_url. |
| 400 | Bad input (missing file, unsupported type, mismatched types, too long). |
| 401 | Invalid or missing API key. |
| 413 | File too large. |
| 422 | Files could not be compared (e.g. unreadable). |
| 429 | Rate-limited — 3/second and 60/minute per key, or the day’s 20 calls are used. |
Limits
- Comparisons take two files of the same type (two images, two videos, etc.); quality checks take one image, video or audio file.
- Video is capped at 3 minutes and compared in full; audio at 2 minutes (a longer recording, up to 3 minutes, is compared for 2 minutes from
start_s). - Rate limit: 3 requests/second and 60/minute per key.
- 20 successful calls a day per account — comparisons and quality checks together, shared with the website.
Frequently asked questions
How do I compare two images via an API?
Send a multipart POST to /api/v1/compare with fields file1 and file2 plus your X-API-Key header. Images return a 0–100 similarity score immediately.
Does the comparison API have a free tier?
Yes — it is free. Every account gets 20 comparisons or quality checks a day, shared between the website and the API.
What file types does the API support?
Images (JPG, PNG, WebP, GIF), video (MP4, AVI, MOV, MKV), audio (MP3, WAV, FLAC, AAC), subtitles (SRT, VTT), and text/JSON/CSV/XML. Both files in a request must be the same type.
How does the API compare video and audio?
Asynchronously — the POST returns a job_id with HTTP 202, and you poll GET /api/v1/compare/<job_id> until the status is done.
What is the API rate limit?
3 requests per second and 60 per minute per key, and 20 successful calls a day per account.