Image Similarity API | Compare Images, Find Duplicates avatar

Image Similarity API | Compare Images, Find Duplicates

Pricing

from $0.40 / 1,000 comparison results

Go to Apify Store
Image Similarity API | Compare Images, Find Duplicates

Image Similarity API | Compare Images, Find Duplicates

Compare images by visual similarity with a CLIP vision model plus perceptual hashing. Score a source image against up to 500 targets, catch exact and near-duplicates, and get one clean row per comparison. URLs, base64, or file upload. Pay per result, MCP ready for AI agents.

Pricing

from $0.40 / 1,000 comparison results

Rating

5.0

(1)

Developer

John

John

Maintained by Community

Actor stats

1

Bookmarked

1

Total users

1

Monthly active users

19 hours ago

Last modified

Share

🖼️ Image Similarity API | Compare Images and Find Duplicate Photos

Compare images by visual similarity and catch duplicates in one run. The Image Similarity API scores a source image against up to 500 target images using a CLIP vision transformer for semantic similarity plus 64-bit perceptual hashes (pHash and dHash) for exact and near-duplicate detection. Every source-target pair returns one clean dataset row with a cosine similarity score, hash distances, and a plain-English verdict: duplicate, very-similar, related, or different.

Most image comparison tools give you one number and leave you guessing. A cosine score of 0.94 can be the same photo resized, or two different golden retrievers. This API answers both questions at once: the vision model measures what the images mean, and the perceptual hashes prove whether they are the same picture. Deduplicate product catalogs, monitor brand assets, detect re-uploads, and match supplier photos to your catalog, by URL, base64, or file upload.

📋 What this API returns

  • One row per comparison: similarityScore (0 to 1 cosine similarity from the vision model), phashDistance and dhashDistance (0 to 64 Hamming distances), and boolean flags isSimilar and isNearDuplicate
  • A fixed-band verdict for every pair: duplicate, very-similar, related, or different, so downstream automations can branch without tuning thresholds
  • Echoes of your sourceImageId and per-target customId, so results join back to your catalog or database rows
  • Free error rows for targets that fail to download or decode, with clear messages and no charge

🎯 Use cases

  • Duplicate photo detection: find exact and near-duplicate images across product catalogs, photo libraries, and user uploads, including resized, recompressed, and lightly edited copies
  • E-commerce product matching: match supplier or marketplace photos against your catalog to catch relistings and duplicate offers
  • Brand and content monitoring: check whether scraped or reported images are copies of your assets
  • Content moderation: detect re-uploads of previously removed images even after resizing or format changes
  • Visual QA and regression checks: compare rendered screenshots or generated images against approved references
  • AI agent workflows: give an agent a reliable "are these two images the same or similar" tool over MCP

⚙️ Input parameters

ParameterTypeRequiredDescription
sourceImagestringyes*Reference image: public http(s) URL, data:image/...;base64, URI, or raw base64
sourceImageUploadarrayyes*Upload the reference image from your computer instead (takes priority)
targetImagesarrayyesUp to 500 entries: URLs, base64 / data URIs, or objects {url, customId, headers}
comparisonModestringnoboth (default), embedding (semantic only), or phash (duplicate detection only, fastest)
thresholdnumbernoCosine similarity cutoff for isSimilar, default 0.85
phashThresholdintegernoMax Hamming distance for isNearDuplicate, default 8
sourceImageIdstringnoYour identifier for the source, echoed on every row
customIdstringnoRun-level identifier echoed on every row; per-target customId wins
headersobjectnoExtra HTTP headers for downloads (for example a Referer for protected images)
proxyConfigurationobjectnoRoute downloads through Apify Proxy when image hosts block datacenter traffic

*Provide the source through exactly one door: sourceImageUpload beats sourceImage when both are set.

📦 Example output

{
"resultType": "comparison",
"targetIndex": 0,
"sourceImage": "https://example.com/products/master-photo.jpg",
"sourceImageId": "catalog-master-001",
"targetImage": "https://example.com/supplier/photo-web.jpg",
"customId": "sku-8841",
"similarityScore": 0.9484,
"isSimilar": true,
"phashDistance": 2,
"dhashDistance": 0,
"isNearDuplicate": true,
"verdict": "duplicate",
"comparisonMode": "both",
"embeddingModel": "clip-vit-b-32",
"processedAt": "2026-08-09T14:03:22.117000+00:00"
}

A target that could not be fetched produces a free error row instead:

{
"resultType": "error",
"targetIndex": 3,
"targetImage": "https://example.com/missing.jpg",
"errorMessage": "image download returned HTTP 404",
"processedAt": "2026-08-09T14:03:24.902000+00:00"
}

How to read the scores

SignalRangeMeaning
similarityScore 0.95+semanticNear-identical content
similarityScore 0.85 to 0.95semanticVery similar scenes or subjects
similarityScore 0.75 to 0.85semanticRelated category, visually distinct
phashDistance 0 to 8structuralSame picture: resized, recompressed, or lightly edited
phashDistance 9+structuralNot the same picture, whatever the semantic score says

The two signals together are the point: two photos of different cats score high semantically but far apart on hashes (similar, not duplicates), while a thumbnail of your photo scores close on hashes even after heavy compression (a true duplicate).

💰 Pricing (pay-per-event)

EventWhat it covers
Comparison resultOne scored source-target pair: similarity score, hash distances, and verdict

You pay per comparison actually delivered. Targets that fail to download or decode return error rows for free, and the source image is never billed. A run comparing one source against 100 targets bills exactly 100 events. Current rates are shown on this page's pricing tab; this is one of the lowest-priced image comparison tools on Apify.

🚀 How to get started

  1. Open the Actor and press Try for free: View on Apify Store
  2. Paste a source image URL and a few target URLs (the prefilled example compares a cat photo against a resized copy, a different cat, and a dog)
  3. Press Start and read the results table: one row per target with score, distances, and verdict
  4. Call it from code or schedules via the Apify API, or drop it into your stack with the integrations below

🔌 Use this API from Claude (MCP)

Connect this Actor to Claude Code (free trial), Claude Desktop, or any MCP client through the hosted Apify MCP server:

https://mcp.apify.com/?tools=actors,docs,johnvc/image-similarity-api

Your agent can then call the image-similarity-api tool with a source and targets and get scored rows back, for deduplication steps, catalog matching, or visual QA inside agent workflows. Setup walkthrough:

Full MCP documentation: https://docs.apify.com/platform/integrations/mcp

🔁 Use this API from n8n

Available as an n8n community node, n8n-nodes-image-similarity-api. In n8n: Settings, Community Nodes, install n8n-nodes-image-similarity-api, then use it in any workflow (it also works as an AI Agent tool). The node exposes source and target images, comparison mode, both thresholds, and Simplified, Raw, or Selected Fields output, one clean item per comparison.

💸 Pay per run with crypto (x402)

The Image Similarity API supports agentic payments via the x402 protocol. AI agents and MCP clients can pay for runs in USDC (on Base) with no Apify account or API token needed: point your agent at the Apify MCP server and it can discover, pay for, and run this Actor autonomously. Read the Apify x402 announcement for details.

❓ FAQ

A reverse image search finds where an image appears on the web. This API compares images you already have: your source against your targets, returning similarity scores and duplicate verdicts. For web-wide reverse image search, pair it with the Google Lens API.

What is the difference between similarityScore and phashDistance?

similarityScore comes from a vision model and measures semantic similarity: what the images depict. phashDistance measures structural identity: whether they are the same picture. Two photos of different beaches score high semantically but far apart on hashes; your photo recompressed to half size scores 0 to 8 on hashes even when the semantic score dips.

Can it find duplicates without running the AI model?

Yes. Set comparisonMode to phash and the run skips the vision model entirely, computing only perceptual hashes. That is the fastest and cheapest way to sweep a catalog for exact and near-exact copies.

What image formats are supported?

JPEG, PNG, WebP, GIF, BMP, and TIFF. Animated GIFs contribute their first frame. Images are validated by content, not by file extension, and anything up to 20 MB and 50 megapixels per image is accepted.

How many images can I compare in one run?

Up to 500 targets per run against one source. For bigger jobs, split the target list across runs; results carry your customId values so you can merge them downstream.

Can I compare images that are not publicly hosted?

Yes, three ways: upload the source straight from your computer, send base64 / data URIs from code (the platform caps run input at 9 MB, which fits about 6 MB of image data), or pass headers such as an Authorization or Referer header for images behind access rules.

Do failed downloads cost anything?

No. A target that cannot be downloaded or decoded produces an error row with a clear message and is never charged. You pay only for delivered comparisons.

Why do two different photos of the same product score above 0.9?

The vision model measures semantic similarity, and two studio shots of the same product are semantically near-identical. Check isNearDuplicate when the question is "is this literally my image": the hash flags catch copies, not lookalikes.

Can AI agents use this Actor?

Yes. It is MCP-ready through the hosted Apify MCP server, and agents without an Apify account can pay per run in USDC via the x402 protocol. The input schema is written so agent frameworks and Claude Code (free trial) can call it without human help.

How fast is it?

The vision model is baked into the Actor image, so there is no model download at run time. Typical runs compare a few dozen targets in well under a minute, dominated by image download time; duplicate-detection-only mode is faster still.

🌐 About Alpha OSINT

This Actor is part of Alpha OSINT, toolset of financial and operations data sources and APIs. For support or requests for this actor, please start a ticket directly on our support page.

Ready-to-run examples that show this API solving a specific problem. Each opens its own setup so you can run it on your account in one click.

Last Updated: 2026.08.16