OpenMediation provides an API for publishers to retrieve monetization statistics data directly in CSV format. To access the API, you need to have a publisher account and obtain the API accessing token from Account -> Key -> Reporting API Key shown below. Contact your account manager if you have any questions.
Authentication
You must include the Token as the “token=” query parameter, or using the authentication header "Authorization: Token ".
If the authentication fails, the authentication server responds with an HTTP error code and a message in the body. For example:
401 “Access token required.”
401 “Invalid token.”
Request Format
To retrieve statistics data from the OpenMediation, use the following GET request:
https://sdk.adtimingapi.com/report/v2
Query parameters
Parameter | Type | Description | Required |
---|---|---|---|
token | String | The API authentication key, retrieved from the dashboard. | No (you may use the Authentication header instead)︎︎ |
format | String | The format of the response. The value is CSV or JSON, The default is JSON | Yes |
encoding | String | The Charset name like GBK or UTF-8 | No |
start | String | The start time of data set, date format ‘yyyy-MM-dd’.
Unable to query data from 30 days ago. |
Yes |
end | String | The end time of the data set, date format: ‘yyyy-MM-dd’.
The time interval between start and end should not be more than 7 days. |
Yes |
appKey | String | A comma-separated list of appKeys by which to filter results. | No |
metrics | String | A comma-separated list that defines the columns of available fields:
availabilityCheck and availabilityResponse only valid in placement and above dimensions |
No |
breakdowns | String | A comma-separated list that expands the rows, splitting data by the following fields:
|
No |
timeDimension | String | A value that splits data by time resolution. Supported options include:
|
Yes |
adnId | Integer | Supported Ad Network, default All Data | No |
Ad Network
Ad Network | adnId |
---|---|
AdTiming | 0 |
AdMob | 1 |
2 | |
UnityAds | 3 |
Vungle | 4 |
Tencent Ads | 5 |
AdColony | 6 |
AppLovin | 7 |
MoPub | 8 |
Tapjoy | 10 |
Chartboost | 11 |
Pangle | 12 |
Mintegral | 14 |
ironSource | 15 |
Helium | 17 |
Following is an example request, complete with parameters:
- Instance dimension example
curl 'https://sdk.adtimingapi.com/report/v2?format=csv&appKey=REPLACE_WITH_YOUR_APPKEY&breakdowns=app,placement,country,adNetwork,instance&metrics=requestCount,filledCount,apiRequest,apiFilled,imprCount,clickCount,apiImpr,apiClick,revenue&start=2020-10-13&end=2020-10-13&timeDimension=day&token=REPLACE_WITH_YOUR_TOKEN' --output stats.csv
- Scene dimension example
https://sdk.adtimingapi.com/report/v2?format=json&appKey=REPLACE_WITH_YOUR_APPKEY&breakdowns=app,placement,scene&metrics=imprCount,clickCount&start=2020-10-13&end=2020-10-13&timeDimension=day&token=REPLACE_WITH_YOUR_TOKEN
Note:
Splitting data across multiple dimensions causes the CSV to grow exponentially, which might cause some large data sets to time-out. The request times out if the server takes more than 60 seconds to process the request.
Request status codes
The endpoint returns the following status codes indicating the result of the request:
Code | Description |
---|---|
200 | The request succeeded. |
400 | Param error The start time format error, the date format like ‘yyyy-MM-dd’. The end time format error, the date format like ‘yyyy-MM-dd’. The end time cannot be less than the beginning time. The query time range is over 7 days. Unable to query data from a month ago. Format required. Invalid type. timeDimension required. Format is unsupported charset. Invalid time dimension. Scene and instance are mutually exclusive. Invalid metric ‘%s’ in metrices. Invalid breakdown ‘%s’ in breakdowns. Invalid metric ‘%s’ in metrices.When breakdown contains the scene, the metrics can only be imprCount and clickCount. Invalid metric ‘%s’ in metrices.AvailabilityCheck and AvailabilityResponse Only valid in placement and above dimensions Invalid app key. Invalid adnId. |
401 | The Token is missing from the request or invalid. Access token required. Invalid token. |
403 | Users account has been disapproved. |
500 | The request failed for an unknown reason. |
503 | The service is unavailable. |
Response
Parameter | Type | Description |
---|---|---|
day | String | Date format ‘yyyyMMdd’ |
hour | String | Date format ‘HH’ |
appKey | String | OM app key |
appId | String | OM app id |
appName | String | App Name |
platform | String | Platform name like ‘iOS’ or ‘Android’ |
placementId | Integer | OM placement ID. |
placementName | String | OM placement name |
adNetwork | Integer | OM adNetwork ID |
instanceId | Integer | OM instance ID |
instanceName | String | OM instance name |
sceneId | Integer | OM scene ID |
sceneName | String | OM scene name |
availabilityCheck | Integer | SDK availabilityCheck count |
availabilityResponse | Integer | SDK availabilityResponse count |
requestCount | Integer | SDK request count |
filledCount | Integer | SDK filled count |
apiRequest | Integer | API request count |
apiFilled | Integer | API filled count |
imprCount | Integer | Impression count |
clickCount | Integer | Click count |
apiImpr | Integer | API Impression count |
apiClick | Integer | API Click count |
revenue | Double | Publisher Revenue |
- Response example – Placement JSON format
[
{
"day": "2020-10-13",
"hour": "10",
"appKey": "dfsdjdfljalsdjf",
"appId": "WfCUt0HTIOzo4NRoJ8p37Rx2bo5nvRHl",
"appName": "test",
"platform": "iOS",
"placementId": 101,
"placementName": "test",
"availabilityCheck": 34543,
"availabilityResponse": 10000,
"requestCount": 34543,
"filledCount": 10000,
"apiRequest": 30000,
"apifilled": 8000,
"imprCount": 4500,
"clickCount": 1000,
"apiImpr": 4000,
"apiClick": 900,
"revenue": 1005.35
},
...
]
- Response example – Instance JSON format
[
{
"day": "2020-10-13",
"hour": "10",
"appKey": "dfsdjdfljalsdjf",
"appId": "WfCUt0HTIOzo4NRoJ8p37Rx2bo5nvRHl",
"appName": "test",
"platform": "iOS",
"placementId": 101,
"placementName": "test",
"adNetwork": 0, /*Adtiming*/
"instanceId": 12321,
"instanceName": "test_instance",
"requestCount": 34543,
"filledCount": 10000,
"apiRequest": 30000,
"apifilled": 8000,
"imprCount": 4500,
"clickCount": 1000,
"apiImpr": 4000,
"apiClick": 900,
"revenue": 1005.35
},
...
]
- Response example – Scene JSON format
[
{
"day": "2020-06-20",
"hour": "10",
"appKey": "dfsdjdfljalsdjf",
"appId": "WfCUt0HTIOzo4NRoJ8p37Rx2bo5nvRHl",
"appName": "test",
"platform": "iOS",
"placementId": 101,
"placementName": "test",
"sceneId": 123123,
"sceneName": "Test-Scene",
"imprCount": 4500,
"clickCount": 1000
},
...
]
Comments
Article is closed for comments.