Find Duplicates and Similar Images
GET/api/v1/assets/:asset_id/content/original/duplicates
Find other assets that are copies of this asset's original file. There are two kinds of match:
match | Finds | How | Paging |
|---|---|---|---|
exact (default) | Exact copies: the same file bytes, under any file name | MD5 checksum of the original | 30 per page, in duplicates |
similar | Exact copies and similar images: the same photo resized, re-saved, re-exported, colour-adjusted, mirrored, cropped or edited | A 64-bit perceptual hash (with its mirrored form) and a copy-detection image embedding | similar is not paged: up to 100, most similar first |
Both kinds use the caller's normal scope (their group's assets, or only their own uploads when group asset access is off). Assets in the trash are left out, and the asset itself is never in its own results.
Exact copies
A resized, re-encoded or re-saved file has a different checksum, so it is not an exact copy: use match=similar for those. An asset without a checksum yet (for example, one still being processed) returns an empty duplicates list.
Results come 30 to a page. This call returns page 1; use GET /api/v1/assets/{asset_id}/content/original/duplicates/{page} for the others. The asset itself is counted for paging and then left out, so the page it falls on holds one id fewer.
Example response
{
"id": "99d819953914402babbdeb68337ea6a3",
"name": "example.jpg",
"size": 8836363,
"content_type": "image/jpeg",
"checksum": "5f5f26bd7c0f62c6e02e44c73d09734e",
"total_files": 2,
"total_pages": 1,
"page": 1,
"duplicates": [
"425f6a2a266d45d58d067f7c39a2e4bd",
"a563da2a266d45d58d067b8c39a3d5ad"
]
}
| Key | Value | Description |
|---|---|---|
id | string | File's unique ID, 32 character alphanumeric UUID |
name | string | File name |
size | integer | Size of file in bytes |
checksum | string | MD5 checksum |
content_type | string | MIME type |
duplicates | JSON | List of file ids whose MD5 checksum is the same as the asset id. Defaults to 30 duplicates per page. The actual count returned may vary depending on asset activity at the time the API is called. |
total_files | integer | Number of duplicate files found, not counting the asset itself |
total_pages | integer | Number of pages in result. |
page | integer | Current page of the result. Defaults to 1. |
Similar images (match=similar)
The response keeps every exact-copy field above and adds the ones below. Exact copies stay in duplicates and are never repeated in similar.
{
"phash_available": true,
"embedding_available": true,
"max_distance": 4,
"similar_total": 3,
"similar": [
{
"id": "8f0e1b2c3d4a4e5f8a9b0c1d2e3f4a5b",
"method": "mirror",
"distance": 0,
"score": null,
"similarity": 1.0,
"relationship": null
},
{
"id": "093081e2bc47437eb4e95233ddf6ddff",
"method": "hash",
"distance": 2,
"score": 0.96,
"similarity": 0.97,
"relationship": "child"
},
{
"id": "c6dd202f494c480e8e18429421378078",
"method": "embedding",
"distance": null,
"score": 0.95,
"similarity": 0.95,
"relationship": null
}
]
}
| Key | Value | Description |
|---|---|---|
phash_available | boolean | false when this asset has no perceptual hash: it is not an image, it is an SVG or HEIC file, or it was uploaded before similar-image indexing and its account has not been indexed. It does not mean there are no copies. |
embedding_available | boolean | false when this asset has no image embedding yet, so crops and edited copies are not searched. An image searched without one is queued for indexing, so calling again a minute later usually returns true. |
max_distance | integer | The largest hash distance counted as similar (currently 4). |
similar_total | integer | Number of entries in similar. |
similar | array | Up to 100 similar images, most similar first. Not paged. |
similar[].method | string | How it matched best: hash (resized, re-saved, colour-adjusted), mirror (a flipped copy) or embedding (a crop or an edited copy). An image matched more than one way is listed once, with hash or mirror. |
similar[].distance | integer or null | Hash bits that differ, out of 64 (0 = the hashes are identical). Always even. Set for hash and mirror matches; null for embedding. |
similar[].score | number or null | Embedding similarity (cosine). Always set for embedding matches, and also for a hash or mirror match that the embedding found too; otherwise null. |
similar[].similarity | number | 0 to 1, 2 decimals; the sort order. 1 - distance/64 for hash and mirror matches, the cosine for embedding matches. |
similar[].relationship | string or null | How that asset is already linked to this one in asset relationships: parent, child, related or a custom type. null = no link recorded. |
What is and is not matched. A different photo of the same product or scene is not matched. Crops that cut away up to a fifth of the picture are found; larger crops less often (about half at 50 %), and copies padded to a new shape, placed in a layout or collage, or shown inside a screenshot usually are not. Background-removed cut-outs are found about a quarter of the time. Two different products shot the same way on a plain background, or two graphics made from the same template, can still be listed as similar, mostly as embedding matches. Videos and documents are matched as exact copies only. Only indexed images are compared, on both sides (the asset you check and the candidates): new uploads are indexed when they are processed, older images once their account has been indexed. See the guide Duplicates, Derivatives and Lineage.
Errors
400:matchis notexactorsimilar.404: the asset is not found.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 500
Successful operation
Invalid match value (must be exact or similar)
Unauthorized - Invalid or missing authentication
Forbidden - Insufficient permissions
Asset not found
Internal server error