The DeskMetrics Analytics API is a way for you to automate your interaction with the Analytics System. With the API, you can have access to most of the raw data that is used to produce the charts and reports you see on your application Dashboard.
Warning
This API is to READ data from your Analytics applications. This should not be mistaken for our Webservice API used to SEND data to your Analytics applications.
The DeskMetrics Analytics API is RESTful and HTTP-Based, meaning that the communication is made through normal HTTP requests.
Note
You asked for it, and we’ve made it public and documented! Although you have access to basic data in our Analytics server, it was not initially built for public access. Therefore, you may find some of the responses and requests unfriendly. We are currently building a new API that will be more human readable and public oriented. It will also support OAuth! In the meantime, feel free to use what has been made available.
Authentication is needed in order to use the DeskMetrics’ Analytics Export Data API, and for this an Analytics account is needed. The credentials used for accessing the API are the same used to access the Analytics Control Panel - your email and password.
The authentication method used for user credentials is HTTP Basic Access Authentication (encrypted over HTTPS). It is important to note that you will provide your credentials every time a request is made. No sessions are used.
More information on HTTP Basic Authentication can be found at: http://en.wikipedia.org/wiki/HTTP_authentication
The base server address is: https://analytics.deskmetrics.com
All the requests provided use GET, thus, you need to provide their parameters as part of the URL.
When providing the date ranges in the url, please note the correct format, followed by an example:
YYYYMMDD
YYYY: year
MM: month
DD: day
api/chart/usages/overview/4c8f0cb0924b8d55af000000/20110702/20110801/None/day/
The enconding of the URL string should be standard URL-encoding, provided by most programming libraries.
The HTTP status code returned by a successful API request is 200 OK. If something goes wrong, other codes will be returned.
All responses are sent JSON-encoded. The specific responses are described in the documentation method in each section.
Returns the number of executions on a given time range and total.
/api/chart/usages/overview/{appID}/{startDate}/{endDate}/None/day/
Currently you must inform your Application ID and a date range, even if you want the total amount.
The attributes you will be using usually are:
| Attribute | Description |
|---|---|
| lastperiod | Total Executions on last period |
| avg | Average per period |
| totalall | Total (alltime) Executions |
| total | Total Executions on given period |
curl -u user@mail.com:password \
https://analytics.deskmetrics.com/api/chart/usages/overview/{appID}/{startDate}/{endDate}/None/day/
{
"lastperiod": "2,382",
"avg": "110",
"int": {
"perioddiff": 44.122586062132655,
"lastperiod": 2382,
"totalall": 9034,
"totalcurrentversion": 0.0,
"avg": 110,
"alldays": 187,
"total": 3433,
"allcurrentversiondays": 0.0,
"days": 31,
"monthavg": 1505
},
"days": "31",
"monthavg": "1,505",
"perioddiff": "44.12",
"totalall": "9,034",
"totalcurrentversion": "0.00",
"total": "3,433",
"alldays": "187",
"allcurrentversiondays": "0.00"
}
Returns the number of installations on a given time and total.
/api/chart/installs/overview/{appID}/{startDate}/{endDate}/None/day/
Currently you must inform your Application ID and a date range, even if you want the total amount.
The attributes you will be using usually are:
| Attribute | Description |
|---|---|
| lastperiod | Total Installations on last period |
| avg | Average per period |
| totalall | Total (alltime) Installation |
| total | Total Installations on given period |
curl -u user@mail.com:password \
https://analytics.deskmetrics.com/api/chart/installs/overview/{appID}/{startDate}/{endDate}/None/day/
{
"lastperiod": "275",
"avg": "8",
"int": {
"perioddiff": -0.0,
"lastperiod": 275,
"totalall": 1366,
"totalcurrentversion": 0.0,
"avg": 8,
"alldays": 187,
"total": 275,
"allcurrentversiondays": 0.0,
"days": 31,
"monthavg": 227
},
"days": "31",
"monthavg": "227",
"perioddiff": "-0.00",
"totalall": "1,366",
"totalcurrentversion": "0.00",
"total": "275",
"alldays": "187",
"allcurrentversiondays": "0.00"
}
Returns the number of uninstallations on a given time and total.
/api/chart/uninstalls/overview/{appID}/{startDate}/{endDate}/None/day/
Currently you must inform your Application ID and a date range, even if you want the total amount.
The attributes you will be using usually are:
| Attribute | Description |
|---|---|
| lastperiod | Total Uninstallations on last period |
| avg | Average per period |
| totalall | Total (alltime) Uninstallation |
| total | Total Uninstallations on given period |
curl -u user@mail.com:password \
https://analytics.deskmetrics.com/api/chart/uninstalls/overview/{appID}/{startDate}/{endDate}/None/day/
{
"lastperiod": "479",
"avg": "17",
"int": {
"perioddiff": 13.152400835073067,
"lastperiod": 479,
"totalall": 1488,
"totalcurrentversion": 0.0,
"avg": 17,
"alldays": 187,
"total": 542,
"allcurrentversiondays": 0.0,
"days": 31,
"monthavg": 248
},
"days": "31",
"monthavg": "248",
"perioddiff": "13.15",
"totalall": "1,488",
"totalcurrentversion": "0.00",
"total": "542",
"alldays": "187",
"allcurrentversiondays": "0.00"
}
Returns the number of new users on a given time and total.
/api/chart/new-vs-returning/new/overview/{appID}/{startDate}/{endDate}/None/day/
Currently you must inform your Application ID and a date range, even if you want the total amount.
The attributes you will be using usually are:
| Attribute | Description |
|---|---|
| lastperiod | Total New Users on last period |
| avg | Average per period |
| totalall | Total (alltime) New Users |
| total | Total New Users on given period |
curl -u user@mail.com:password \
https://analytics.deskmetrics.com/api/chart/new-vs-returning/new/overview/{appID}/{startDate}/{endDate}/None/day/
{
"lastperiod": "2,003",
"avg": "72",
"int": {
"perioddiff": 12.081877184223671,
"lastperiod": 2003,
"totalall": 6275,
"totalcurrentversion": 0.0,
"avg": 72,
"alldays": 187,
"total": 2245,
"allcurrentversiondays": 0.0,
"days": 31,
"monthavg": 1045
},
"days": "31",
"monthavg": "1,045",
"perioddiff": "12.08",
"totalall": "6,275",
"totalcurrentversion": "0.00",
"total": "2,245",
"alldays": "187",
"allcurrentversiondays": "0.00"
}
Returns the number of returning users on a given time and total.
/api/chart/new-vs-returning/returning/overview/{appID}/{startDate}/{endDate}/None/day/
Currently you must inform your Application ID and a date range, even if you want the total amount.
The attributes you will be using usually are:
| Attribute | Description |
|---|---|
| lastperiod | Total Returning Users on last period |
| avg | Average per period |
| totalall | Total (alltime) Returning Users |
| total | Total Returning Users on given period |
curl -u user@mail.com:password \
https://analytics.deskmetrics.com/api/chart/new-vs-returning/returning/overview/{appID}/{startDate}/{endDate}/None/day/
{
"lastperiod": "846",
"avg": "30",
"int": {
"perioddiff": 11.229314420803789,
"lastperiod": 846,
"totalall": 2759,
"totalcurrentversion": 0.0,
"avg": 30,
"alldays": 187,
"total": 941,
"allcurrentversiondays": 0.0,
"days": 31,
"monthavg": 459
},
"days": "31",
"monthavg": "459",
"perioddiff": "11.23",
"totalall": "2,759",
"totalcurrentversion": "0.00",
"total": "941",
"alldays": "187",
"allcurrentversiondays": "0.00"
}
Returns the Bounced Users - number of users who installed and didn’t execute - on a given time and total.
/api/chart/bounce-rate/install/overview/{appID}/{startDate}/{endDate}/None/day/
Currently you must inform your Application ID and a date range, even if you want the total amount.
The attributes you will be using usually are:
| Attribute | Description |
|---|---|
| lastperiod | Total Bounced Users on last period |
| avg | Average per period |
| totalall | Total (alltime) Bounced Users |
| total | Total Bounced Users on given period |
curl -u user@mail.com:password \
https://analytics.deskmetrics.com/api/chart/bounce-rate/install/overview/{appID}/{startDate}/{endDate}/None/day/
{
"lastperiod": "29",
"avg": "2",
"int": {
"perioddiff": 137.93103448275863,
"lastperiod": 29,
"totalall": 165,
"totalcurrentversion": 0.0,
"avg": 2,
"alldays": 187,
"total": 69,
"allcurrentversiondays": 0.0,
"days": 31,
"monthavg": 27
},
"days": "31",
"monthavg": "27",
"perioddiff": "137.93",
"totalall": "165",
"totalcurrentversion": "0.00",
"total": "69",
"alldays": "187",
"allcurrentversiondays": "0.00"
}
Returns a list with the Top Countries in terms of executions in a given date range. This list also includes its percentage against the global set and the unique executions value.
/api/countries/top/{appID}/{startDate}/{endDate}/None/day/
Currently you must inform your Application ID and a date range.
The attributes you will be using usually are:
| Attribute | Description |
|---|---|
| count | Total Executions for the country on given period |
| code | Code for the country |
| country | Country |
| percent | Percentage of Executions for the country on period |
| unique | Total Unique Executions for the country on period |
curl -u user@mail.com:password \
https://analytics.deskmetrics.com/api/countries/top/{appID}/{startDate}/{endDate}/None/day/
[
{
"count": 1876,
"code": "BR",
"url": "\/application\/4c8f0cb0924b8d55af000000\/geolocation\/cities\/BR\/",
"country": "Brazil",
"percent": 49.303547963206306,
"unique": 1260
},
{
"count": 430,
"code": "FR",
"url": "\/application\/4c8f0cb0924b8d55af000000\/geolocation\/cities\/FR\/",
"country": "France",
"percent": 11.300919842312746,
"unique": 326
},
{
"count": 27,
"code": "AR",
"url": "\/application\/4c8f0cb0924b8d55af000000\/geolocation\/cities\/AR\/",
"country": "Argentina",
"percent": 0.70959264126149801,
"unique": 21
}
]
Returns a list with statistical data about your logging resources on a given time period.
/api/logs/{appID}/{startDate}/{endDate}/None/day/
Currently you must inform your Application ID and a date range.
The attributes you will be using usually are:
| Attribute | Description |
|---|---|
| count | Total Executions of the Log |
| message | Log message |
| unique | Total Unique Executions of the Log |
| last | Time of Last Received Log |
curl -u user@mail.com:password \
https://analytics.deskmetrics.com/api/logs/{appID}/{startDate}/{endDate}/None/day/
[
{
"count": 1088,
"message": "Hello World!",
"unique": 907,
"last": "2011-07-01 15:26:17"
}
]