{"_id":"564f0978234efc0d006e186e","editedParams":true,"editedParams2":true,"project":"564621e00c30fb2100ba3814","__v":23,"parentDoc":null,"category":{"_id":"56859e9c009a8d0d00797130","__v":3,"pages":["5685a737009a8d0d0079713a","56885d7a73922d1700d7cb69","56892949ff344617001e7bb2"],"project":"564621e00c30fb2100ba3814","version":"564621e10c30fb2100ba3817","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-12-31T21:31:08.683Z","from_sync":false,"order":7,"slug":"reporting-api","title":"Reporting API"},"user":"56499dade2efd717002afc83","version":{"_id":"564621e10c30fb2100ba3817","__v":14,"project":"564621e00c30fb2100ba3814","createdAt":"2015-11-13T17:46:09.275Z","releaseDate":"2015-11-13T17:46:09.275Z","categories":["564621e10c30fb2100ba3818","564624cf0c30fb2100ba3822","564628d69f3f550d00fa3db6","564dafeeda00e82b00ed601d","564daff8fc36dc3700882b95","564db0ccda00e82b00ed601f","564dcf87d3320b0d0028ca10","5661a6e436398e0d00f79566","568585153703ed1700e420b0","56858767d96a760d00545da6","56858d693703ed1700e420b2","56858d8d22c41b0d00e4666c","56859e9c009a8d0d00797130","5685a6453703ed1700e420d3"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-11-20T11:52:24.811Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"code":"curl \"http://api-v2.mobfox.com/publisher/report?apikey=YOUR_API_KEY&period=yesterday&tz=Etc/UTC&group=sub_id,inventory_id,country_code&timegroup=day&totals=total_impressions,total_served,total_requests,total_clicks,total_earnings&f:inventory_id=142413,166527&f:country_code=AL,IN,US\"","language":"curl"}]},"method":"get","results":{"codes":[{"code":"{\n  \"columns\": [\n    \"day\",\n    \"sub_id\",\n    \"inventory_id\",\n    \"country_code\",\n    \"total_impressions\",\n    \"total_served\",\n    \"total_requests\",\n    \"total_clicks\",\n    \"total_earnings\"\n  ],\n  \"results\": [\n    [\n      \"2017-01-14\",\n      \"142413\",\n      142413,\n      \"IN\",\n      3,\n      3,\n      24,\n      2,\n      0.0004368\n    ],\n    [\n      \"2017-01-14\",\n      \"130019751\",\n      142413,\n      \"AL\",\n      4299,\n      4372,\n      14044195,\n      26,\n      0.5490055789436032\n    ],\n    [\n      \"2017-01-14\",\n      \"130019751\",\n      142413,\n      \"IN\",\n      9320,\n      20330,\n      273053,\n      33,\n      3.123056282474127\n    ],\n    [\n      \"2017-01-14\",\n      \"130019751\",\n      142413,\n      \"US\",\n      369031,\n      577867,\n      3095916,\n      296,\n      374.9578569949265\n    ],\n    [\n      \"2017-01-14\",\n      \"130019751\",\n      166527,\n      \"AL\",\n      2262,\n      2340,\n      13903800,\n      11,\n      0.2931829206021852\n    ],\n    [\n      \"2017-01-14\",\n      \"130019751\",\n      166527,\n      \"IN\",\n      3914,\n      5258,\n      182279,\n      13,\n      0.8786287672440308\n    ],\n    [\n      \"2017-01-14\",\n      \"130019751\",\n      166527,\n      \"US\",\n      27818,\n      40093,\n      1346799,\n      26,\n      27.196964068998902\n    ]\n  ],\n  \"rowcount\": 7,\n  \"currentness\": [\n    \"2016-04-30 12:00:00\",\n    \"2017-01-15 03:00:00\"\n  ]\n}\n\n/* The columns field specifies the structure of each of the results. The rowcount field indicates how many rows were returned. The currentness field indicates what the last aggregated timestamp of the MobFox analytics database currently is. */","language":"json","status":200,"name":""},{"name":"","code":"{\n  \"code\": 401,\n  \"message\": \"api key unknown\"\n}","language":"json","status":401},{"status":400,"language":"json","code":"{\n  \"code\": 400,\n  \"message\": \"invalid group field(s): country_code_\"\n}"}]},"settings":"56871d3743a8590d00983adb","auth":"required","params":[{"_id":"56885ae36ac8f90d0043c4d1","ref":"","in":"query","required":true,"desc":"The API key for your account. We recommend using the HTTP request header **X-MOBFOX-APIKEY** instead, for additional security. The API key is required for this endpoint. Your API key can be found on this page: https://account.mobfox.com/www/cp/edit_profile.php<br><br>","default":"","type":"string","name":"apikey"},{"_id":"56885ae36ac8f90d0043c4d0","ref":"","in":"query","required":true,"desc":"**Supported values are:**<br> **today**<br> **yesterday**<br> **week_to_day**<br> **month_to_day**<br> **last_month**<br> <br> Instead of **period**, the combination of **from/to** can also be used. If neither **period nor from/to** are specified, the period defaults to the last fully passed calendar day of the specified timezone tz.<br><br>","default":"yesterday","type":"string","name":"period"},{"_id":"56885b5ca448420d002a257e","ref":"","in":"query","required":true,"desc":"The start date of the report interval, in format **YYYY-MM-DD HH:MI:SS**. Time is optional and is interpreted as **00:00:00** when missing. **The start date is inclusive**. Instead of from/to, period can also be used. If neither period nor from/to are specified, the period defaults to the last fully passed calendar day of the specified timezone tz. <br><br>","default":"2018-01-01 00:00:00","type":"datetime","name":"from"},{"_id":"56885b5ca448420d002a257d","ref":"","in":"query","required":true,"desc":"The end date of the report interval, in format **YYYY-MM-DD HH:MI:SS**. Time is optional and is interpreted as **23:59:59** when missing. **The end date is inclusive**. Instead of from/to, period can also be used. If neither period nor from/to are specified, the period defaults to the last fully passed calendar day of the specified timezone tz.<br><br>","default":"2018-02-01 00:00:00","type":"datetime","name":"to"},{"_id":"56885b7fb0ee6d0d00d4b1bb","ref":"","in":"query","required":false,"desc":"The time zone for period/from/to date(time) values. [Supported time zone values are listed here](http://www.php.net/manual/en/timezones.php). Exceptions to this list are the aliases *CET, EET, EST, Factory, GMT, HST, MET, MST, UCT, UTC, WET, Zulu which are not supported!* We recommend using geographical time zones (eg. **Europe/London**) instead of offset-based time zones (eg. Etc/GMT-2) in order to implicitly account for daylight saving time changes. If **tz** is not specified, **Etc/UTC** is used as default.<br><br>","default":"Etc/UTC","type":"string","name":"tz"},{"_id":"56885b7fb0ee6d0d00d4b1ba","ref":"","in":"query","required":false,"desc":"A list of dimensions to group/breakdown by. The list is delimited by comma characters (\",\"). By default, the data is grouped by the **timegroup**. Supported values are **documented below** (scroll down).<br><br>","default":"","type":"string","name":"group"},{"_id":"56885bbfe1f9a00d00350ac9","ref":"","in":"query","required":false,"desc":"A list of totals to calculate. The list is delimited by comma characters (\",\"). Supported values are **documented below** (scroll down).<br><br>","default":"","type":"string","name":"totals"},{"_id":"56885bbfe1f9a00d00350ac8","ref":"","in":"query","required":false,"desc":"The granularity of the time group.<br><br> **Supported values are:**<br> **month**<br> **week**<br> **day**<br> **hour**: hour granularity is only supported for periods of up to 72 hours (3 days)<br> **interval**: sums totals for the whole timeframe provided in **period** or **from/to**<br> <br> The default time granularity is interval. <br> <br>","default":"interval","type":"string","name":"timegroup"},{"_id":"56885bbfe1f9a00d00350ac7","ref":"","in":"query","required":false,"desc":"A dimension field and value to filter by. This parameter can be repeated for each field you want to filter, eg. **f:inventory_id=65&f:country_code=GB**. All fields supported by the parameter group can also be filtered. The syntax for requiring or excluding empty values is ** &f:inventory_id=*EMPTY* or &f:inventory_id=*!EMPTY* **, respectively. Currently, only equality filters are supported. By default, no filters are applied.<br><br>","default":"","type":"string","name":"f"},{"_id":"56885ceb73922d1700d7cb68","ref":"","in":"query","required":false,"desc":"An API option and its corresponding value.<br> <br>  **Supported options are:**<br>  **o:include_legacy_publisher_id=true**: Will add the legacy publisher_id in response should you need it.<br> <br>","default":"","type":"string","name":"o"}],"url":"/publisher/report"},"isReference":false,"order":2,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Publisher Reporting API Overview\"\n}\n[/block]\nThe MobFox Publisher Reporting API allows you pull data regarding your MobFox Publisher Platform activity. This API requires an **API key**, which can be found in your MobFox account by navigating to [My Account -> Account Information](https://account.mobfox.com/www/cp/edit_profile.php).\n\nIt provides a near real-time report with metrics such as **impressions, clicks, and earnings** for your MobFox publisher account. Optionally, you can get statistics broken down by certain certain attributes like country or inventory, and filter data to only certain values for these attributes.\n[block:api-header]\n{\n  \"title\": \"Group\"\n}\n[/block]\nBelow you'll find all values you can use in the **group** parameter.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Limitations\",\n  \"body\": \"In order to keep the resulting amount of rows at an acceptable number, **we limit the amount of groups to 3 per reporting api call**.\\n\\nThough not all dimensions add to the cardinality the same way, so these groups count as one group:\\n- inventory_id, sub_id\\n\\nPlease keep in mind if you send the parameter \\\"o:include_legacy_publisher_id\\\" with value \\\"true\\\" in your request, it counts as one additional group!\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Value\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"inventory_id\",\n    \"1-0\": \"sub_id\",\n    \"2-0\": \"country_code\",\n    \"3-0\": \"device_os\",\n    \"4-0\": \"device_type\",\n    \"4-1\": \"Possible values:\\n- PHONE\\n- TABLET\\n- DESKTOP\\n- ...\",\n    \"5-0\": \"ex_demand_partner_id\",\n    \"5-1\": \"ID of the demand source who bought your traffic.\",\n    \"6-0\": \"ex_adomain\",\n    \"6-1\": \"Advertiser domain of the advertiser who bought your traffic.\",\n    \"7-0\": \"ex_iurl\",\n    \"7-1\": \"The \\\"iurl\\\" is the preview URL of the creative that was placed in your apps.\\n\\nThis URL is provided by the demand source.\",\n    \"8-0\": \"ex_crid\",\n    \"8-1\": \"The ID of the creative shown in your apps.\\n\\nEach ex_crid has its own preview URL (ex_iurl).\",\n    \"9-0\": \"ex_buyerseat\",\n    \"9-1\": \"The advertiser ID who bought your traffic.\",\n    \"10-0\": \"request_type\",\n    \"10-1\": \"Possible values:\\n- banner\\n- video\\n- native\",\n    \"1-1\": \"The ID that you sent to MobFox when you made the ad request. \\n\\nMake sure that it does not contain spaces.\",\n    \"0-1\": \"The ID of your MobFox inventory.\",\n    \"2-1\": \"Possible values:\\n- US\\n- IL\\n- AT\\n- DE\\n- ...\",\n    \"3-1\": \"Possible values:\\n- iOS\\n- Android\\n- webOS\\n- Windows Phone OS\\n- ...\",\n    \"11-0\": \"ad_source\",\n    \"11-1\": \"The source of the ad.\\nPossible values:\\n- exchange\\n- stack\\n- autopilot\\n- null (not available)\"\n  },\n  \"cols\": 2,\n  \"rows\": 12\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Totals\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Value\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"total_requests\",\n    \"1-0\": \"total_served\",\n    \"2-0\": \"total_impressions\",\n    \"3-0\": \"total_clicks\",\n    \"4-0\": \"total_earnings\",\n    \"5-0\": \"fill_rate\",\n    \"6-0\": \"render_rate\",\n    \"7-0\": \"ctr\",\n    \"0-1\": \"Total ad request you made to MobFox SSP.\",\n    \"1-1\": \"Total ads MobFox SSP served to your inventory.\",\n    \"2-1\": \"Total impressions MobFox SSP measured for your inventory.\",\n    \"3-1\": \"Total clicks MobFox SSP measured for your inventory.\",\n    \"4-1\": \"Total money you earned on MobFox SSP.\",\n    \"5-1\": \"Calculated value for your convenience.\\n\\nfill_rate = total_served / total_requests * 100\",\n    \"6-1\": \"render_rate = total_impressions / total_served * 100\",\n    \"7-1\": \"CTR = total_clicks / total_impressions * 100\",\n    \"8-0\": \"ecpm\",\n    \"8-1\": \"ecpm = total_earnings / total_impressions * 1000\"\n  },\n  \"cols\": 2,\n  \"rows\": 9\n}\n[/block]","excerpt":"","slug":"reporting-api-publisher","type":"endpoint","title":"Reporting API - Publisher"}

getReporting API - Publisher


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Query Params

apikey:
required
string
The API key for your account. We recommend using the HTTP request header **X-MOBFOX-APIKEY** instead, for additional security. The API key is required for this endpoint. Your API key can be found on this page: https://account.mobfox.com/www/cp/edit_profile.php<br><br>
period:
required
stringyesterday
**Supported values are:**<br> **today**<br> **yesterday**<br> **week_to_day**<br> **month_to_day**<br> **last_month**<br> <br> Instead of **period**, the combination of **from/to** can also be used. If neither **period nor from/to** are specified, the period defaults to the last fully passed calendar day of the specified timezone tz.<br><br>
from:
required
datetime2018-01-01 00:00:00
The start date of the report interval, in format **YYYY-MM-DD HH:MI:SS**. Time is optional and is interpreted as **00:00:00** when missing. **The start date is inclusive**. Instead of from/to, period can also be used. If neither period nor from/to are specified, the period defaults to the last fully passed calendar day of the specified timezone tz. <br><br>
to:
required
datetime2018-02-01 00:00:00
The end date of the report interval, in format **YYYY-MM-DD HH:MI:SS**. Time is optional and is interpreted as **23:59:59** when missing. **The end date is inclusive**. Instead of from/to, period can also be used. If neither period nor from/to are specified, the period defaults to the last fully passed calendar day of the specified timezone tz.<br><br>
tz:
stringEtc/UTC
The time zone for period/from/to date(time) values. [Supported time zone values are listed here](http://www.php.net/manual/en/timezones.php). Exceptions to this list are the aliases *CET, EET, EST, Factory, GMT, HST, MET, MST, UCT, UTC, WET, Zulu which are not supported!* We recommend using geographical time zones (eg. **Europe/London**) instead of offset-based time zones (eg. Etc/GMT-2) in order to implicitly account for daylight saving time changes. If **tz** is not specified, **Etc/UTC** is used as default.<br><br>
group:
string
A list of dimensions to group/breakdown by. The list is delimited by comma characters (","). By default, the data is grouped by the **timegroup**. Supported values are **documented below** (scroll down).<br><br>
totals:
string
A list of totals to calculate. The list is delimited by comma characters (","). Supported values are **documented below** (scroll down).<br><br>
timegroup:
stringinterval
The granularity of the time group.<br><br> **Supported values are:**<br> **month**<br> **week**<br> **day**<br> **hour**: hour granularity is only supported for periods of up to 72 hours (3 days)<br> **interval**: sums totals for the whole timeframe provided in **period** or **from/to**<br> <br> The default time granularity is interval. <br> <br>
f:
string
A dimension field and value to filter by. This parameter can be repeated for each field you want to filter, eg. **f:inventory_id=65&f:country_code=GB**. All fields supported by the parameter group can also be filtered. The syntax for requiring or excluding empty values is ** &f:inventory_id=*EMPTY* or &f:inventory_id=*!EMPTY* **, respectively. Currently, only equality filters are supported. By default, no filters are applied.<br><br>
o:
string
An API option and its corresponding value.<br> <br> **Supported options are:**<br> **o:include_legacy_publisher_id=true**: Will add the legacy publisher_id in response should you need it.<br> <br>

Examples


Result Format


Documentation

[block:api-header] { "type": "basic", "title": "Publisher Reporting API Overview" } [/block] The MobFox Publisher Reporting API allows you pull data regarding your MobFox Publisher Platform activity. This API requires an **API key**, which can be found in your MobFox account by navigating to [My Account -> Account Information](https://account.mobfox.com/www/cp/edit_profile.php). It provides a near real-time report with metrics such as **impressions, clicks, and earnings** for your MobFox publisher account. Optionally, you can get statistics broken down by certain certain attributes like country or inventory, and filter data to only certain values for these attributes. [block:api-header] { "title": "Group" } [/block] Below you'll find all values you can use in the **group** parameter. [block:callout] { "type": "warning", "title": "Limitations", "body": "In order to keep the resulting amount of rows at an acceptable number, **we limit the amount of groups to 3 per reporting api call**.\n\nThough not all dimensions add to the cardinality the same way, so these groups count as one group:\n- inventory_id, sub_id\n\nPlease keep in mind if you send the parameter \"o:include_legacy_publisher_id\" with value \"true\" in your request, it counts as one additional group!" } [/block] [block:parameters] { "data": { "h-0": "Value", "h-1": "Description", "0-0": "inventory_id", "1-0": "sub_id", "2-0": "country_code", "3-0": "device_os", "4-0": "device_type", "4-1": "Possible values:\n- PHONE\n- TABLET\n- DESKTOP\n- ...", "5-0": "ex_demand_partner_id", "5-1": "ID of the demand source who bought your traffic.", "6-0": "ex_adomain", "6-1": "Advertiser domain of the advertiser who bought your traffic.", "7-0": "ex_iurl", "7-1": "The \"iurl\" is the preview URL of the creative that was placed in your apps.\n\nThis URL is provided by the demand source.", "8-0": "ex_crid", "8-1": "The ID of the creative shown in your apps.\n\nEach ex_crid has its own preview URL (ex_iurl).", "9-0": "ex_buyerseat", "9-1": "The advertiser ID who bought your traffic.", "10-0": "request_type", "10-1": "Possible values:\n- banner\n- video\n- native", "1-1": "The ID that you sent to MobFox when you made the ad request. \n\nMake sure that it does not contain spaces.", "0-1": "The ID of your MobFox inventory.", "2-1": "Possible values:\n- US\n- IL\n- AT\n- DE\n- ...", "3-1": "Possible values:\n- iOS\n- Android\n- webOS\n- Windows Phone OS\n- ...", "11-0": "ad_source", "11-1": "The source of the ad.\nPossible values:\n- exchange\n- stack\n- autopilot\n- null (not available)" }, "cols": 2, "rows": 12 } [/block] [block:api-header] { "title": "Totals" } [/block] [block:parameters] { "data": { "h-0": "Value", "h-1": "Description", "0-0": "total_requests", "1-0": "total_served", "2-0": "total_impressions", "3-0": "total_clicks", "4-0": "total_earnings", "5-0": "fill_rate", "6-0": "render_rate", "7-0": "ctr", "0-1": "Total ad request you made to MobFox SSP.", "1-1": "Total ads MobFox SSP served to your inventory.", "2-1": "Total impressions MobFox SSP measured for your inventory.", "3-1": "Total clicks MobFox SSP measured for your inventory.", "4-1": "Total money you earned on MobFox SSP.", "5-1": "Calculated value for your convenience.\n\nfill_rate = total_served / total_requests * 100", "6-1": "render_rate = total_impressions / total_served * 100", "7-1": "CTR = total_clicks / total_impressions * 100", "8-0": "ecpm", "8-1": "ecpm = total_earnings / total_impressions * 1000" }, "cols": 2, "rows": 9 } [/block]

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}