MediaMath Platform API
- Add and View Targeting
(Legacy) List Targets
(Legacy) Create a Target
(Legacy) Get a Target
(Legacy) Update a Target
(Legacy) Delete a Target
(Legacy) Update a Target
List targets
Create a Target
Get a Target
Update a Target
Delete a Target
List Target paths
Contextual Segments CPM estimates
Get Frequently Used Contextual Segments
Frequently Used Audience Segments
Audience Segments CPM Estimate
List Technology Target Values
List Contextual Segments
List Path Audience Segments
Add and View Targeting
Campaigns API (xx.xx.xx)
Download OpenAPI description
Overview
Languages
Servers
Live Server
https://api.mediamath.com/api/v3.0/
Query
Number of elements in the collection to retrieve
Example: page_limit=100
Index of the first element in the collection to retrieve
Example: page_offset=0
The field to sort by. You can use any field name in ascending or descending order. For ascending order, use the field name directly, e.g., id
. For descending order, prefix the field name with a hyphen (-
), e.g., -id
.
Example: sort_by=id, -id, name, -name
Query search for filtering. This parameter can be used to filter results based on various fields.
q=name=:{search}*
to find all results with names starting with "search".q=status==true
to find all active entities.q=id>=1000
to find all entities with id greater than or equal to 1000.q=id==(1,2,3)
find specific entities by ID.
- Live Server
https://api.mediamath.com/api/v3.0/target-path
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://api.mediamath.com/api/v3.0/target-path?page_limit=100&page_offset=0&sort_by=id%2C+-id%2C+name%2C+-name&q=string' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
Response
application/json
{ "data": [ { … } ], "meta": { "status": "success", "count": 10, "total_count": 100, "offset": 0, "next_page": "string", "prev_page": "string" } }
- Live Server
https://api.mediamath.com/api/v3.0/targeting
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://api.mediamath.com/api/v3.0/targeting \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"strategy_id": [
0
],
"targeting": {
"audience": {
"include": [
{
"operator": "AND",
"audience_segment_ids": [
0
]
}
],
"exclude": [
{
"operator": "AND",
"audience_segment_ids": [
0
]
}
]
},
"contextual": {
"include": [
{
"code": "string",
"operator": "AND",
"target_value_ids": [
0
]
}
],
"exclude": [
{
"code": "string",
"operator": "AND",
"target_value_ids": [
0
]
}
]
},
"my_data": {
"include": {
"pixel_bundle_ids": [
0
],
"operator": "AND"
},
"exclude": {
"pixel_bundle_ids": [
0
]
}
},
"location": {
"include": [
{
"code": "string",
"operator": "AND",
"target_value_ids": [
0
]
}
],
"exclude": [
{
"code": "string",
"operator": "AND",
"target_value_ids": [
0
]
}
]
},
"technology": {
"include": [
{
"code": "string",
"operator": "AND",
"target_value_ids": [
0
]
}
],
"exclude": [
{
"code": "string",
"operator": "AND",
"target_value_ids": [
0
]
}
]
},
"day_parts": [
{
"user_time": true,
"start_hour": 1,
"end_hour": 5,
"days": [
"M",
"T",
"W",
"S",
"U"
]
}
]
}
}'
Response
application/json
{ "data": { "location": [ … ] }, "meta": { "status": "string", "count": 0 }, "errors": [ null ] }
- Live Server
https://api.mediamath.com/api/v3.0/contextual_segments/cpm_estimate
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
'https://api.mediamath.com/api/v3.0/contextual_segments/cpm_estimate?extended=true' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"currency_code": "USD",
"include": [
{
"code": "string",
"operator": "AND",
"segments": [
{
"targeting_segment_id": 0,
"user_cpm": 0
}
]
}
],
"exclude": {
"code": "string",
"operator": "AND",
"segments": [
{
"targeting_segment_id": 0,
"user_cpm": 0
}
]
}
}'
Response
application/json
{ "data": { "cpm": { … }, "segments": [ … ] }, "meta": { "status": "success" } }