Skip to content

Deals

Request

Metrics that describe the path from a matched bid opportunity (biddable) to a delivered impression (win) for private marketplace deals. The data is stored in UTC timezone and is available by hour.

NOTE: this dataset requires the use of filter organization_id with exactly 1 value, and deal_id with at least 1 value.

Fields

FieldTime WindowsRollups
Dimensions
agg_timestampcurrent_day, last_X_hours, last_X_days, yesterday, month_to_dateby_hour, by_day, by_week, by_month
deal_external_id
AnyAny
deal_group_id
AnyAny
deal_group_name
AnyAny
deal_id
AnyAny
deal_name
AnyAny
deal_price_type
AnyAny
deal_publisher_id
Deal Publisher ID
AnyAny
exchange_id
AnyAny
exchange_name
AnyAny
Metrics
bid_rate
AnyAny
biddables
AnyAny
bids
AnyAny
matches
AnyAny
win_rate
AnyAny
wins
AnyAny

Pageable

Yes

Time Windows

current_day, last_X_hours, last_X_days, yesterday, month_to_date

Rollups

all, by_hour, by_day, by_week, by_month

Data Retention / Lookback Window

1 year

Security
Auth0(Required scopes: offline_access)
Bodyapplication/jsonrequired
One of:
end_timestring or null, (date-time)
fieldsArray of strings, non-empty, uniquerequired
filtersArray of objects, non-emptyrequired
full_entitiesArray of strings or null, non-empty, unique
max_resultsinteger or null, >= 1

Maximum number of results to return. Only applicable for streaming responses. No limit if absent or null.

orderArray of objects
paginationobject or null

Streaming response if absent or null, Paginated response otherwise

rollupstringrequired
start_timestring, (date-time)
time_windowstring
time_zonestring

Only in supported datasets: campaign, UTC or a time zone name defined in https://www.iana.org/time-zones

curl -i -X POST \
  https://api.mediamath.com/reporting/v2/deals \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "fields": [
      "campaign_id",
      "impressions"
    ],
    "filters": [
      {
        "field": "organization_id",
        "op": "=",
        "value": 123456
      },
      {
        "field": "agency_id",
        "value": [
          123456,
          789012
        ]
      },
      {
        "field": "advertiser_id",
        "value": 123456
      },
      {
        "field": "campaign_name",
        "op": "=~",
        "value": "Test Campaign"
      }
    ],
    "order": [
      {
        "desc": false,
        "field": "agg_timestamp",
        "nulls_last": true
      }
    ],
    "pagination": {
      "page_index": 0,
      "page_size": 100
    },
    "rollup": "by_hour",
    "time_window": "current_day"
  }'

Responses

JSON for Paginated, JSONL for Streaming

Body
metaobject
resultsArray of objects
Response
{ "meta": { "items_count": 3, "page_index": 0, "status": "OK", "total_items_count": 3, "total_pages": 1 }, "results": [ { … }, { … }, { … } ] }