Statistics
Retrieve the statistics of your applications
Get statistics
GET
https://api.ogury.io/reporting/v1/stats
This endpoint allows you to get your statistics.
Query Parameters
Headers
{
"info": "Additionals information available here",
"fromDate": "2020-09-30",
"toDate": "2020-10-02",
"applications": [
12345,
23456,
34567
],
"applicationInfos": [
{
"apiKey": 12345,
"platform": "ANDROID"
},
{
"apiKey": 23456,
"platform": "iOS"
},
{
"apiKey": 34567,
"platform": "ANDROID"
}
],
"aggregationDescription": "day,ad_unit_id",
"aggregation": {
"2020-09-30": {
"aggregation": {
"12345_default": {
"stats": {
"impressions": 2488036,
"revenue": 28938.08,
"requests": 3510954,
"ecpm": 11.63
}
},
"23456_default": {
"stats": {
"impressions": 1306279,
"revenue": 14882.52,
"requests": 2092813,
"ecpm": 11.39
}
}
}
},
"2020-10-01": {
"aggregation": {
"12345_default": {
"stats": {
"impressions": 1355770,
"revenue": 13314.8,
"requests": 3648636,
"ecpm": 9.82
}
},
"23456_default": {
"stats": {
"impressions": 697663,
"revenue": 6632.94,
"requests": 1843377,
"ecpm": 9.51
}
}
}
},
"2020-10-02": {
"aggregation": {
"12345_default": {
"stats": {
"impressions": 336664,
"revenue": 3848.27,
"requests": 3942938,
"ecpm": 11.43
}
},
"23456_default": {
"stats": {
"impressions": 138516,
"revenue": 1596.62,
"requests": 1605168,
"ecpm": 11.53
}
}
}
}
}
}
// When giving a "to_date" parameter, the parameter "from_date" becomes mandatory
{"error":"ERROR_FROM_DATE_MANDATORY"}
// The parameter "from_date" must be set before to parameter "to_date"
{"error":"ERROR_FROM_DATE_AFTER_TO_DATE"}
// The parameter "from_date" has to be in format "YYYY-MM-DD"
{"error":"ERROR_INVALID_FROM_DATE_FORMAT"}
// The parameter "to_date" has to be in format "YYYY-MM-DD"
{"error":"ERROR_INVALID_TO_DATE_FORMAT"}
// Fill type has to be "standard" or "premium"
{"error":"ERROR_INVALID_FILL_TYPE"}
// You can use a maximum of 3 aggregations
{"error":"ERROR_TOO_MANY_AGGREGATIONS"}
// You can use only one date aggregation (day, week or month)
{"error":"ERROR_TOO_MANY_DATE_AGGREGATIONS"}
// The app key must be a numeric value
{"error": "ERROR_INVALID_APP_KEY"}
{
"timestamp": 1603730666689,
"status": 401,
"error": "Unauthorized",
"message": "Access Denied",
"path": "/v1/stats"
}
{
"timestamp": 1604407287424,
"status": 404,
"error": "Not Found",
"message": "No message available",
"path": "/v1/statsx"
}
{
"timestamp": 1604407435802,
"status": 405,
"error": "Method Not Allowed",
"exception": "org.springframework.web.HttpRequestMethodNotSupportedException",
"message": "Request method 'POST' not supported",
"path": "/v1/stats"
}
{
"timestamp": 1604407103532,
"status": 500,
"error": "Internal Server Error",
"exception": "java.lang.RuntimeException",
"message": "org.springframework.web.client.ResourceAccessException: I/O error ...",
"path": "/v1/stats"
}
Examples
Retrieve the statistics for the previous month to now
curl -H 'Content-Type: application/json' \
-H 'x-auth-apikey: MY_API_KEY' \
-H 'x-auth-secret: MY_API_SECRET' \
'https://api.ogury.io/reporting/v1/stats?group_by=month'
Retrieve the statistics for a specific month
curl -H 'Content-Type: application/json' \
-H 'x-auth-apikey: MY_API_KEY' \
-H 'x-auth-secret: MY_API_SECRET' \
'https://api.ogury.io/reporting/v1/stats?from_date=2020-09-01&to_date=2020-09-01&group_by=month'
For the group by month, the from_date is truncated to the beginning of the month and the to_date is set to the end of the month.
In this example, to_date is modified by 2020-09-30.
Retrieve the statistics by day, ad_unit_id, and country
curl -H 'Content-Type: application/json' \
-H 'x-auth-apikey: MY_API_KEY' \
-H 'x-auth-secret: MY_API_SECRET' \
'https://api.ogury.io/reporting/v1/stats?from_date=2020-09-01&to_date=2020-09-30&group_by=day,ad_unit_id,country'
The application route gives you the details of your ad_unit.
If you want to re-group them by type, you can use the /applications to retrieve the details about the ad_unit and re-group them by application and ad_unit type.
Last updated