Skip to main content

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:

matchFindsHowPaging
exact (default)Exact copies: the same file bytes, under any file nameMD5 checksum of the original30 per page, in duplicates
similarExact copies and similar images: the same photo resized, re-saved, re-exported, colour-adjusted, mirrored, cropped or editedA 64-bit perceptual hash (with its mirrored form) and a copy-detection image embeddingsimilar 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"
]
}
KeyValueDescription
idstringFile's unique ID, 32 character alphanumeric UUID
namestringFile name
sizeintegerSize of file in bytes
checksumstringMD5 checksum
content_typestringMIME type
duplicatesJSONList 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_filesintegerNumber of duplicate files found, not counting the asset itself
total_pagesintegerNumber of pages in result.
pageintegerCurrent 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
}
]
}
KeyValueDescription
phash_availablebooleanfalse 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_availablebooleanfalse 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_distanceintegerThe largest hash distance counted as similar (currently 4).
similar_totalintegerNumber of entries in similar.
similararrayUp to 100 similar images, most similar first. Not paged.
similar[].methodstringHow 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[].distanceinteger or nullHash bits that differ, out of 64 (0 = the hashes are identical). Always even. Set for hash and mirror matches; null for embedding.
similar[].scorenumber or nullEmbedding similarity (cosine). Always set for embedding matches, and also for a hash or mirror match that the embedding found too; otherwise null.
similar[].similaritynumber0 to 1, 2 decimals; the sort order. 1 - distance/64 for hash and mirror matches, the cosine for embedding matches.
similar[].relationshipstring or nullHow 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: match is not exact or similar.
  • 404: the asset is not found.

Request​

Responses​

Successful operation