图片对比 API:批量比较图片相似度并返回 JSON
John
一次 API 调用把源图片与最多 500 张目标图片逐一对比,返回 similarityScore、phashDistance、重复判定和你自己的 ID 字段,方便直接写入系统。支持 MCP 调用。
Input
Output fields
Sign up on Apify or log in
The Image Similarity API | Compare Images, Find Duplicates Actor is ready to run with the inputs already set for "图片对比 API:批量比较图片相似度并返回 JSON". Sign up or log in and you'll land in Apify Console with a copy of this exact task.
Start the "图片对比 API:批量比较图片相似度并返回 JSON" task
The Image Similarity API | Compare Images, Find Duplicates Actor will start running based on the input automatically. You can also change all the input fields, like source image, target images, and more, to match your specific use case.
Receive the "图片对比 API:批量比较图片相似度并返回 JSON" output
Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as target index, target image, similarity score, and more.
Integrate into your workflow
The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also run the "图片对比 API:批量比较图片相似度并返回 JSON" task via API.

每张目标图片对应一行,里面有相似度分数 similarityScore、感知哈希距离 phashDistance、判定结果 verdict,以及你自己传入的 customId。这个编号会原样带回,比如商品编号,方便和数据库里的记录对上。结果可以导出为 JSON、CSV 或 Excel。
源图片放在 sourceImage,目标图片放在 targetImages,每一项都是带链接和自定义编号的对象,示例里是 sku-8841 等三个商品编号。源图片的编号 master-001 会出现在每一行。比较模式用语义加重复检测,相似度阈值 0.85 决定是否标记为相似。
通过该任务在 Apify API 上的运行端点发起运行,或者使用 Python、Node 版的 apify-client,运行结束后读取数据集的 JSON。每行都带着你的 customId,可以直接按商品编号写回自己的系统。
在 Apify 控制台打开任务,点 Actions,然后 Schedule,填入 0 */6 * * *,即每六小时运行一次。运行结束后,webhook 可以把结果直接 POST 到你自己的服务,也可以接进 n8n 或 Make 的流程。
添加 https://mcp.apify.com/?tools=actors,docs,johnvc/image-similarity-api 作为 MCP 服务器后,Claude 或任何其他 MCP 客户端都能调用这个图片对比工具。在对话里说明要拿哪张源图片对比哪些目标图片,助手会自己填好参数并运行任务,再把每张图的相似度分数和重复判定整理给你看,不用写一行代码。
按结果收费:每交付一条对比结果计一次事件,源图片不计费,下载或解码失败的目标返回免费的错误行。一次对比多少张目标图,就计多少次事件。当前费率请看 Actor 页面上的定价标签。
反向图片搜索是在网上找一张图出现在哪里,图片对比 API 只比较你提供的图片。两者可以配合:先用反向搜索找候选链接,再用「批量查找重复图片,用感知哈希检测近似重复」确认哪些真的重复。