---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://mixpeek.com/.well-known/search?q={query}"
  method: GET
  documentation: "https://mixpeek.com/llms.txt"
---

1.  [](/)
2.  [Code examples](/recipes)
3.  Brand Safety & Ad Verification Pipeline

Back to code examples

Compliance

# Brand Safety & Ad Verification Pipeline

Brand safety pipeline for ad networks. Scores video and image creatives against the GARM brand safety floor and suitability categories, which vendors still use after GARM wound down in 2024, before an ad is served.

video

image

text

Production

[Run in Builder](/build?recipe=brand-safety-pipeline)

Python

cURL

import time

from mixpeek import Mixpeek

client \= Mixpeek(api\_key\="YOUR\_API\_KEY", namespace\="brand-safety")

\# 1. A bucket for ad creatives, and a collection whose Gemini step scores each

\#    scene against GARM categories as JSON

bucket \= client.buckets.create(

    bucket\_name\="ad-creatives",

    bucket\_schema\={"properties": {"creative": {"type": "video"}}},

)

collection \= client.collections.create(

    collection\_name\="ad-creatives",

    source\={"type": "bucket", "bucket\_ids": \[bucket\["bucket\_id"\]\]},

    feature\_extractor\={

        "feature\_extractor\_name": "multimodal\_extractor",

        "version": "v1",

        "parameters": {

            "split\_method": "scene",

            "run\_video\_description": True,

            "description\_prompt": "Assess this scene for brand safety.",

            "response\_shape": {

                "type": "object",

                "properties": {

                    "violence": {"type": "number"},

                    "adult": {"type": "number"},

                    "hate": {"type": "number"},

                    "drugs": {"type": "number"},

                },

            },

        },

    },

)

\# 2. Check one creative: upload it, process just that object, wait, read the scores

def check\_creative(creative\_url):

    obj \= client.buckets.upload(

        bucket\["bucket\_id"\],

        blobs\=\[{"property": "creative", "type": "video", "data": creative\_url}\],

    )

    run \= client.collections.trigger(collection\["collection\_id"\], object\_ids\=\[obj\["object\_id"\]\])

    while client.tasks.get(run\["task\_id"\])\["status"\] not in ("COMPLETED", "COMPLETED\_WITH\_ERRORS", "FAILED"):

        time.sleep(10)

    scenes \= client.documents.list(

        collection\["collection\_id"\],

        filters\={"AND": \[{"field": "root\_object\_id", "operator": "eq", "value": obj\["object\_id"\]}\]},

    )

    scores \= \[doc.get("json\_output") or {} for doc in scenes\["results"\]\]

    worst \= max((max(s.values(), default\=0) for s in scores), default\=0)

    return {"safe": worst < 0.15, "scene\_scores": scores}

print(check\_creative("https://cdn.adnetwork.com/creative/12345.mp4"))

### Feature Extractors

Multimodal Extractor

Unified embeddings for video, audio, image, and text: scene/silence chunking, Whisper transcription, thumbnails, and Gemini vision.

### Retriever Stages

## Frequently asked questions

### Is this GARM compliant?

There is no GARM certification to meet: the WFA wound GARM (Global Alliance for Responsible Media) down in August 2024. The pipeline scores each scene against the GARM brand safety floor and suitability categories that platforms and vendors still use, and you can edit that category list.

### Can I integrate this with my DSP/SSP?

Yes. Scan creatives when they are uploaded and the scores are stored with each one, so a pre-bid system reads them by lookup instead of waiting on a scan.

### Does it analyze audio in video creatives?

Yes. Both visual frames and audio tracks are analyzed for brand safety violations.

## Use Cases Using This Recipe

Intermediate

6 min read

### Contextual Page Signals for Ad Placement

One article URL in, five structured signals out: IAB category, entities with salience scores, sentiment, brand safety, keywords.

Five, from a single pass

Signals per URL

[

advertising

](/solutions/advertising)[

ip safety

](/solutions/ip-safety)

Who It's For

Contextual advertising and ad-targeting teams who decide, per article, which creative renders beside it, and who need that decision to be defensible to a brand.

[View Details](/use-cases/contextual-page-signals)

## Related code examples and resources

Pages on the same stages, extractors and patterns.

[

Extractor

### Multimodal Extractor

Unified embeddings for video, audio, image, and text: scene/silence chunking, Whisper transcription, thumbnails, and Gemini vision.

Learn more





](/extractors/multimodal)[

Recipe

### Hierarchical Classification

Assign content to multi-level category hierarchies using embedding-based classification. Define your taxonomy once, then classify new content automatically with confidence scores.

Learn more





](/recipes/hierarchical-classification)[

Recipe

### Automated Video Tagging

Automatically generate descriptive tags for video content using scene analysis, object detection, and taxonomy classification. Each video receives structured labels for scenes, objects, actions, and custom business categories without manual annotation.

Learn more





](/recipes/automated-video-tagging)[

Recipe

### Video Scene Search

Find specific scenes within videos using natural language descriptions. The pipeline detects scene boundaries, generates embeddings for each scene, and enables precise timestamp-level search across an entire video library. Query for visual content, actions, or spoken dialogue.

Learn more





](/recipes/video-scene-search)[

Recipe

### Semantic Multimodal Search

Unified semantic search across all content types. Query by natural language and retrieve relevant video clips, images, audio segments, and documents based on meaning-not keywords or manual tags.

Learn more





](/recipes/semantic-multimodal-search)[

Recipe

### Feature Extraction

Multi-tier feature extraction that decomposes content into searchable components: embeddings, transcripts, detected objects, OCR text, scene boundaries, and more. The foundation for all downstream retrieval and analysis.

Learn more





](/recipes/feature-extraction)