MediaLayer

Use case

Creative audit API for ad-tech

Use cases6 min read

Reused ad creatives, recycled placements, and copy-pasted campaign assets are everywhere — and they're hard to catch by hand. This article walks through a practical pattern for ad-tech creative audit using the MediaLayer matching APIs.

What creative audit actually has to catch

  • Reused creatives across advertisersThe same image or video shows up under different campaign IDs and advertiser accounts, often with a re-encode or watermark.
  • Recycled campaign assetsOld creatives quietly resurface in new campaigns with cropped frames, swapped logos, or new audio.
  • Brand-safety review at scaleReviewers triage thousands of placements per day. Without similarity grouping, near-duplicates get reviewed independently and decisions diverge.
  • Audio bumpers and music reuseBranded audio, jingles, and music beds get reused across spots. Audio fingerprinting flags overlap with offset-aligned segments instead of guessing.

The matching primitives

MediaLayer wraps image, video, and audio similarity behind one JSON request shape. POST two URLs to /image/match, /video/match, or /audio/match and you get back a similarity score, a confidence label, and (for video and audio) aligned matched segments. Same envelope, three media types — fits a creative-audit pipeline that has to cover banner ads, video pre-rolls, and audio bumpers from the same call site.

RESPONSE · CREATIVE MATCH
{
  "match": true,
  "confidence": "high",
  "similarity_score": 0.91,
  "processing_time_ms": 1640,
  "media_type": "video",
  "matched_segments": [
    { "source_start": 0.0, "source_end": 14.8, "target_start": 2.3, "target_end": 17.1, "score": 0.93 }
  ]
}

A practical creative-audit pipeline

The simplest pattern: when a new placement enters the system, compare its creative against your reference library and route into clear, review, or block lanes based on similarity.

PYTHON · CREATIVE-AUDIT DISPATCHER
import requests

API_HOST = "medialayer-image-audio-video-matching-api.p.rapidapi.com"
HEADERS = {
    "x-rapidapi-key": "YOUR_RAPIDAPI_KEY",
    "x-rapidapi-host": API_HOST,
    "Content-Type": "application/json",
}

PATH_BY_TYPE = {
    "image": "/image/match",
    "video": "/video/match",
    "audio": "/audio/match",
}

def audit_creative(media_type: str, placement_url: str, references: list[str]):
    path = PATH_BY_TYPE[media_type]
    best_score = 0.0
    best_ref = None

    for ref_url in references:
        r = requests.post(
            f"https://{API_HOST}{path}",
            json={"source_url": placement_url, "target_url": ref_url},
            headers=HEADERS,
            timeout=60,
        )
        r.raise_for_status()
        data = r.json()
        if data["similarity_score"] > best_score:
            best_score = data["similarity_score"]
            best_ref = ref_url

    if best_score >= 0.95:
        lane = "auto-block"
    elif best_score >= 0.80:
        lane = "review"
    else:
        lane = "pass"

    return {"lane": lane, "best_ref": best_ref, "score": best_score}

Cluster before you review

Without similarity grouping, near-duplicate placements show up as separate rows in the brand-safety queue. With it, reviewers see a cluster: 'these 12 placements share 92%+ similarity', and one decision applies to all of them. That changes review throughput from O(placements) to O(clusters).

When a creative library outgrows pairwise

Pairwise comparison is fine when the reference library is small. Once it's in the tens of thousands of creatives — common for DSPs and creative-management platforms — pairwise calls become the wrong access pattern.

Enterprise media search ingests the creative catalog into a similarity index. Each new placement runs as a one-to-many lookup that returns top-K matches with scores in a single call. Public usage stays on RapidAPI; enterprise direct API access is available after onboarding.

Production checklist

  • Server-side keysx-rapidapi-key never belongs in browser or mobile clients. Call from the audit service.
  • Public reference URLsURL validation rejects private, loopback, and cloud-metadata addresses. Reference creatives need to be publicly reachable, or they need to live on the enterprise direct surface with private deployment.
  • Bound concurrencyBound the per-placement fan-out so a single placement doesn't burst against your RapidAPI plan's per-second limit.
  • Use overlap duration on video and audioDon't act on the boolean match alone — use matched_segments to get total overlap seconds and route based on duration as well as score.

Ready to wire it in?

Subscribe on RapidAPI to call the public API on your own key, or talk to MediaLayer AI Labs about enterprise direct API access.