MediaLayer

Image matching

Image Similarity API

Compare two images by URL and get a similarity score, a confidence label, and a match decision in a structured JSON response. The MediaLayer image similarity API drops into your moderation, dedupe, or audit workflow as a single POST — no upload pipeline, no embedding store, no SDK to maintain.

How the image matching API works

Send a POST request with source_url and target_url. MediaLayer downloads each URL, extracts visual features from both images, and compares them. The response is a predictable JSON envelope: a continuous similarity_score in [0, 1], a confidence label (high, medium, low, or none), and a match boolean you can use directly in business logic.

Most duplicate image detection work is not about pixel-equal matches. The same photo gets re-encoded as JPEG, resized, watermarked, lightly cropped, or color-shifted before it lands back in your platform — and a byte-level hash misses every one of those variations. Comparing visual features instead of raw bytes handles those near-duplicate images: compression artifacts, scale changes, and minor edits do not fool the matcher.

The endpoint is stateless and idempotent. There is no warm-up, no embedding index to maintain on your side, and no model versioning to track. If the URL is reachable and the file is a supported image format (JPEG, PNG, WebP), you get a result back in a few hundred milliseconds.

For production integrations, treat similarity_scoreas the source of truth and pick your own threshold against your data. The match boolean uses a default cutoff that works well for general duplicate image detection, but every corpus has its own distribution — a tighter threshold is right for stock-photo dedupe, a looser one for adversarial near duplicate image detection. Log scores during your pilot, plot the histogram, and pick the threshold that fits the cost of a false positive in your workflow.

Image similarity API example

Two URLs in. One JSON envelope out. Same request shape across image, video, and audio so a single integration covers the full surface.

REQUEST
POST /image/match
{
  "source_url": "https://example.com/source.jpg",
  "target_url": "https://example.com/candidate.jpg"
}
RESPONSE
{
  "match": true,
  "confidence": "high",
  "similarity_score": 0.94,
  "processing_time_ms": 38,
  "media_type": "image",
  "matched_segments": []
}

The similarity_score is continuous in [0, 1], so you can tune your own match threshold against your dataset. The confidence label maps to coarse buckets for cases where you want a human-readable signal alongside the raw number — useful for audit logs, support workflows, and anywhere a downstream system speaks in qualitative levels rather than floats.

Use cases for image similarity matching

Marketplace listing dedupe

Catch sellers reusing the same product photos across multiple accounts, even after compression or cropping.

UGC moderation

Surface re-uploaded harmful imagery that has been re-encoded or lightly edited to evade hash-based filters.

Ad creative audit

Verify that a campaign's images are not being recycled across competing buyers or formats.

Stock library cleanup

Collapse near-duplicate image detection candidates before they reach your storage tier.

Catalog reconciliation

Match supplier images to existing products without manual review or one-off scripts.

A hosted image matching API beats a DIY pipeline

Building duplicate image detection in-house means standing up perceptual-hashing or feature-extraction pipelines, managing model weights, and handling format edge cases (HEIC, animated PNGs, corrupt JPEGs, transparent backgrounds). It also means versioning the index alongside whatever image set you are deduping against, and keeping all of that running while the rest of your product evolves.

MediaLayer abstracts that work behind a JSON request. You send two URLs, you get back a similarity score. There is no infrastructure to scale, no GPU pool to keep warm, and no library to upgrade inside your monolith. Engineering hours go back into the part of the system that is actually specific to your product.

Start matching images by URL

Free plan to start on RapidAPI. Scale as your volume grows.