---
title: "Contextual Segments CPM estimates"
method: POST
path: "/contextual_segments/cpm_estimate"
tags: ["Targeting"]
---

# Contextual Segments CPM estimates

`POST /contextual_segments/cpm_estimate`

## Request

- Base URL: `https://api.mediamath.com/api/v3.0`
- URL: `https://api.mediamath.com/api/v3.0/contextual_segments/cpm_estimate`
- Auth: OAuth 2
  - Authorization code: `https://auth.mediamath.com/authorize`
  - Token URL: `https://auth.mediamath.com/oauth/token` scopes: `offline_access`, `manage:services`
- TypeScript: <https://skmtc.dev/mediamath/apis/campaigns-api/docs/contextual_segments/cpm_estimate/post.ts> (a function with typed inputs; its response is checked against the schema)

Get CPM estimates for contextual segments

## Query parameters

- `extended` boolean

## Request body

- object
  - `currency_code` string, required
  - `include` object[]
    - `code` string
    - `operator` 'AND' | 'OR'
    - `segments` object[]
      - `targeting_segment_id` integer
      - `user_cpm` number, double: if provided value will be used instead of segment cpm (value in USD).
  - `exclude` object
    - `code` string
    - `operator` 'AND' | 'OR'
    - `segments` object[]
      - `targeting_segment_id` integer
      - `user_cpm` number, double: if provided value will be used instead of segment cpm

## Response `200`

CPM estimate response

- object
  - `data` object
    - `cpm` object
      - `currency_code` string
      - `value` number, double, required
      - `includes_taxed_segments` boolean
      - `contextual_cpm_min` number, double, required
      - `contextual_cpm_max` number, double, required
    - `segments` ContextualSegmentShort[]: available only when extended
      - `id` integer
      - `name` string
      - `full_path` string
      - `cpm` number, double
      - `user_cpm` number, double, nullable
      - `segment_objective_name` string
      - `uniques` integer, nullable
  - `meta` object
    - `status` string

## Other responses

- `400`: Error response
- `401`: Error response
- `403`: Error response

---

[API](https://skmtc.dev/mediamath/apis/campaigns-api.md) - [All operations](https://skmtc.dev/mediamath/apis/campaigns-api/llms.txt) - [OpenAPI document](https://skmtc.dev/mediamath/apis/campaigns-api/revisions/408743891def?raw)
