{"openapi":"3.1.0","info":{"title":"Perceptual Image Hash API","version":"1.0.0","description":"Fingerprint images for near-duplicate detection and similarity. Compute the three classic perceptual hashes — aHash (average), dHash (difference) and pHash (DCT-based) — as 64-bit hex values for any image (by URL or base64), then compare two images to get the Hamming distance and a 0-100 similarity score per algorithm, with a likely-same flag. Unlike a cryptographic hash, perceptual hashes stay close when images are resized, recompressed or lightly edited — so you can spot duplicates, find re-uploads, cluster similar pictures and power reverse-image matching. Fully local (no third-party service), nothing stored. Supports PNG, JPEG, BMP, TIFF and GIF. Live. 3 endpoints. Distinct from basic image-info/resize and from string-similarity tools.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/imghash-api","description":"oanor gateway"}],"tags":[{"name":"Hash"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/compare":{"get":{"operationId":"get_v1_compare","tags":["Hash"],"summary":"Compare two images","description":"","parameters":[{"name":"url1","in":"query","required":true,"description":"First image URL","schema":{"type":"string"},"example":"https://raw.githubusercontent.com/ianare/exif-samples/master/jpg/gps/DSCN0010.jpg"},{"name":"url2","in":"query","required":true,"description":"Second image URL","schema":{"type":"string"},"example":"https://raw.githubusercontent.com/ianare/exif-samples/master/jpg/gps/DSCN0010.jpg"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"hashes":{"image1":{"ahash":"fcfffff310100000","dhash":"313c156666e4e584","phash":"4edbd88c49eaf808"},"image2":{"ahash":"fcfffff310100000","dhash":"313c156666e4e584","phash":"4edbd88c49eaf808"}},"comparison":{"ahash":{"distance":0,"similarity":100},"dhash":{"distance":0,"similarity":100},"phash":{"distance":0,"similarity":100}},"likely_same":true,"average_similarity":100},"meta":{"timestamp":"2026-06-02T16:52:01.433Z","request_id":"63dd58de-3f23-4e04-83bd-8fc695338515"},"status":"ok","message":"Compare two images","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/hash":{"get":{"operationId":"get_v1_hash","tags":["Hash"],"summary":"Perceptual hash of an image","description":"","parameters":[{"name":"url","in":"query","required":true,"description":"Image URL (or use image= base64)","schema":{"type":"string"},"example":"https://raw.githubusercontent.com/ianare/exif-samples/master/jpg/gps/DSCN0010.jpg"},{"name":"algorithm","in":"query","required":false,"description":"ahash|dhash|phash|all","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"ahash":"fcfffff310100000","dhash":"313c156666e4e584","phash":"4edbd88c49eaf808"},"meta":{"timestamp":"2026-06-02T16:52:01.770Z","request_id":"dd81ac2e-8957-40fc-9c3e-81db1bf08e79"},"status":"ok","message":"Perceptual hash of an image","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"auth":"none upstream; this gateway requires x-api-key","name":"Perceptual Image Hash API","note":"Compute aHash, dHash and pHash (64-bit, hex) for an image — /v1/hash?url= or ?image= (base64), optional ?algorithm=ahash|dhash|phash|all. Compare two images via /v1/compare?url1=&url2= → Hamming distance and similarity % per algorithm, with a likely_same flag. For near-duplicate detection and reverse-image matching. Distinct from image-api and similarity-api (strings). Live, nothing stored.","source":"Local hashing (Jimp) — no key, no upstream","endpoints":3},"meta":{"timestamp":"2026-06-02T16:52:01.867Z","request_id":"bc2a4926-c87d-445f-9cfd-1dac892a7924"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":1560,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":740,"monthly_call_quota":31000,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2700,"monthly_call_quota":188000,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":6300,"monthly_call_quota":960000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/imghash-api"}