Perceptual Hash

Computes average, perceptual, difference and wavelet hashes for near-duplicate detection.

POST /v1/image/perceptual-hash $0.005 per call

Specification

Endpoint
POST /v1/image/perceptual-hash
Price
$0.005 per call · tier basic_data
Payment
x402 on X Layer (chain 196) · settled in USDG or USDT0 · schemes exact, aggr_deferred
Data source
Local sandboxed processing of the uploaded image
Timeout
60 seconds
Max request
20 MB
Version
1.0.0

Calling it

The first call returns a 402 with the payment challenge. Retry with a signed authorisation in the X-PAYMENT header — see the payment guide for the exact shape.

curl -i -X POST "https://api.dana-edu.pp.ua/v1/image/perceptual-hash" \
  -H "content-type: application/json" \
  -d '{ ... }'

Response

Real output, captured by running this endpoint at build time — not written by hand. Volatile fields such as timestamps are elided. Captured 2026-07-30.

{
  "average_hash": "0f0f0f0ff0f0f3ff",
  "perceptual_hash": "ae1193ee311999e6",
  "difference_hash": "5a5a5a5a27272727",
  "wavelet_hash": "00000000f0f0f0f3",
  "colour_hash": "03003018000",
  "hash_size": 8,
  "hash_bits": 64,
  "dimensions": {
    "width": 64,
    "height": 64
  },
  "usage": "compare two hashes by Hamming distance. 0 means visually identical; under 5 on a 64-bit hash usually means the same image at different size or quality; above 10 usually means different images.",
  "note": "Perceptual hashes are for similarity, NOT integrity. Use /v1/files/checksum for a cryptographic digest."
}

Every response is wrapped in the same envelope: data plus warnings, sources, confidence, informational_only and a measured processing_ms. See the envelope reference.

Related endpoints