---
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.  [Templates](/templates)
3.  Contextual Ad Targeting

Back to Templates

Ad Tech & Media

# Contextual Ad Targeting

## Match ads to content by semantic context rather than user tracking. Retrieves the most contextually aligned content segments for a given ad message, enabling privacy-safe contextual targeting.

2 stages

[Read Docs](https://mixpeek.com/docs/retrieval/retrievers)

[Integrate Now](/start)

Use in Studio

No credit card to start · Build from $25/mo

OverviewAPIRelated

### Pipeline Stages

1

contextual\_search

filter

`feature_search`

View parameters

{
  "searches": \[
    {
      "feature\_uri": "mixpeek://text\_extractor@v1/multilingual\_e5\_large\_instruct\_v1",
      "query": {
        "input\_mode": "text",
        "value": "{{INPUT.ad\_message}}"
      },
      "top\_k": 100
    },
    {
      "feature\_uri": "mixpeek://image\_extractor@v1/google\_siglip\_base\_v1",
      "query": {
        "input\_mode": "text",
        "value": "{{INPUT.ad\_message}}"
      },
      "top\_k": 50
    }
  \],
  "final\_top\_k": 25,
  "fusion": "rrf"
}

2

iab\_classification

apply

`taxonomy_enrich`

View parameters

{
  "taxonomy\_id": "{{INPUT.iab\_taxonomy\_id}}",
  "output\_field": "metadata.iab\_categories",
  "top\_k": 3
}

### Input Schema

`ad_message`

text

required

The ad message, product description, or campaign theme to match against content

e.g. `luxury SUV with advanced safety features`

`iab_taxonomy_id`

text

required

The taxonomy\_id of the IAB taxonomy already configured in this namespace, used to classify matched content

e.g. `iab_content_taxonomy_v3`

#### Use Cases

*   Cookie-free contextual ad placement
*   Content-to-ad relevance scoring
*   Publisher monetization optimization
*   Brand safety + relevance pairing

#### Requirements

*   Collection must have text and image embeddings indexed
*   IAB taxonomy must be configured in namespace

#### Tags

contextual-targeting

adtech

iab

privacy-safe

advertising

#### Ready to use this template?

Clone it into your namespace and start querying in minutes.

Use in Studio