Countly Documentation

Countly Resources

Here you'll find comprehensive guides to help you start working with Countly as quickly as possible.

Suggest Edits

Introduction

 

This document (please see navigation on the left hand side) lists all API methods, and details the authentication mechanism. Countly API uses HTTP and a RESTful endpoint structure. Request and response payloads are formatted as JSON.

Suggest Edits

/api-key

Retrieve user's API_KEY

 
gethttps://try.count.ly/api-key
curl --request GET \
  --url https://try.count.ly/api-key
var request = require("request");

var options = { method: 'GET', url: 'https://try.count.ly/api-key' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/api-key")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/api-key");

xhr.send(data);
import requests

url = "https://try.count.ly/api-key"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

9a4d196c01d3ca82876c0398ab776e5e
Unauthorized
 

Retrieve user's API_KEY by using authentication credentials as username and password through Basic Authentication

Suggest Edits

/o/users/all

Retrieve information about all users

 
gethttps://try.count.ly/o/users/all?api_key=api_key
curl --request GET \
  --url 'https://try.count.ly/o/users/all?api_key=api_key'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o/users/all',
  qs: { api_key: 'api_key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o/users/all?api_key=api_key")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o/users/all?api_key=api_key");

xhr.send(data);
import requests

url = "https://try.count.ly/o/users/all"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
    "542bacc5a8e4641667000001": {
        "_id": "542bacc5a8e4641667000001",
        "api_key": "9a4d196c01d3ca82876c0398ab774e5e",
        "full_name": "Test Test",
        "username": "test",
        "email": "test@domain.com",
        "global_admin": true,
        "is_current_user": true
    },
    "542bacc6b3bced1a67000001": {
        "_id": "542bacc6b3bced1a67000001",
        "api_key": "d735fa946dd0a5bbf85b816da66cf5f8",
        "full_name": "Name Surname",
        "username": "test1",
        "email": "test@domain.com.test",
        "global_admin": false,
        "is_current_user": false
    }
}
{"result":"User does not exist"}

Path Params

api_key
string
required

Admin API_KEY

Query Params

callback
string

(optional) name of callback function for JSONP output

 

Retrieve information about all users.
This request require API_KEY of a user who is global administrator

Suggest Edits

/o/users/me

Retrieve information about user

 
gethttps://try.count.ly/o/users/me?api_key=api_key
curl --request GET \
  --url 'https://try.count.ly/o/users/me?api_key=api_key'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o/users/me',
  qs: { api_key: 'api_key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o/users/me?api_key=api_key")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o/users/me?api_key=api_key");

xhr.send(data);
import requests

url = "https://try.count.ly/o/users/me"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
    "_id": "542bacc5a8e4641667000001",
    "api_key": "9a4d196c01d3ca82876c0398ab774e5e",
    "email": "test@domain.com",
    "full_name": "Test Test",
    "global_admin": true,
    "in_user_hash": "e06f722c5295bf8bd4149a54d3303102c398b45f",
    "in_user_id": "26ede5cdbfa68a55a9c51ea207ec74fd",
    "username": "test"
}
{"result": "User does not exist"}

Path Params

api_key
string
required

User API_KEY

Query Params

callback
string

(optional) name of callback function for JSONP output

 

Retrieve information about user, who is the owner of the API_KEY

Suggest Edits

/o/apps/all

Retrieve information about all apps

 
gethttps://try.count.ly/o/apps/all?api_key=api_key
curl --request GET \
  --url 'https://try.count.ly/o/apps/all?api_key=api_key'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o/apps/all',
  qs: { api_key: 'api_key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o/apps/all?api_key=api_key")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o/apps/all?api_key=api_key");

xhr.send(data);
import requests

url = "https://try.count.ly/o/apps/all"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
    "admin_of": {
        "542bad58b3bced1a67000003": {
            "_id": "542bad58b3bced1a67000003",
            "category": "6",
            "country": "TR",
            "key": "7a52e705d83401780ec487879c6b1b6ebb9f34b0",
            "name": "Test",
            "timezone": "Europe/Istanbul"
        }
    },
    "user_of": {
        "542bad58b3bced1a67000003": {
            "_id": "542bad58b3bced1a67000003",
            "category": "6",
            "country": "TR",
            "key": "7a52e705d83401780ec487879c6b1b6ebb9f34b0",
            "name": "Test",
            "timezone": "Europe/Istanbul"
        }
    }
}
{"result":"User does not exist"}

Path Params

api_key
string
required

Admin API_KEY

Query Params

callback
string

(optional) name of callback function for JSONP output

 

Retrieve information about all users. This request require API_KEY of a user who is global administrator

Suggest Edits

/o/apps/mine

Retrieve information about user's apps

 
gethttps://try.count.ly/o/apps/mine?api_key=api_key
curl --request GET \
  --url 'https://try.count.ly/o/apps/mine?api_key=api_key'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o/apps/mine',
  qs: { api_key: 'api_key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o/apps/mine?api_key=api_key")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o/apps/mine?api_key=api_key");

xhr.send(data);
import requests

url = "https://try.count.ly/o/apps/mine"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
    "admin_of": {
        "542bad58b3bced1a67000003": {
            "_id": "542bad58b3bced1a67000003",
            "category": "6",
            "country": "TR",
            "key": "7a52e705d83401780ec487879c6b1b6ebb9f34b0",
            "name": "Test",
            "timezone": "Europe/Istanbul"
        }
    },
    "user_of": {
        "542bad58b3bced1a67000003": {
            "_id": "542bad58b3bced1a67000003",
            "category": "6",
            "country": "TR",
            "key": "7a52e705d83401780ec487879c6b1b6ebb9f34b0",
            "name": "Test",
            "timezone": "Europe/Istanbul"
        }
    }
}
{"result":"User does not exist"}

Path Params

api_key
string
required

User's API_KEY

Query Params

callback
string

(optional) name of callback function for JSONP output

 

Retrieve information about apps which were created by the user, who is the owner of the API_KEY

Suggest Edits

/o/apps/details

Retrieve detailed information about app users (available from v16.12)

 
gethttps://try.count.ly/o/apps/details?api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o/apps/details?app_id=app_id&api_key=api_key'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o/apps/details',
  qs: { app_id: 'app_id', api_key: 'api_key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o/apps/details?app_id=app_id&api_key=api_key")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o/apps/details?app_id=app_id&api_key=api_key");

xhr.send(data);
import requests

url = "https://try.count.ly/o/apps/details"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{  
   "app":{  
      "owner":"gorkem",
      "created_at":1479234325,
      "edited_at":1480499355,
      "last_data":1480499355
   },
   "global_admin":[  
      {  
         "_id":"56e531f23934b132475d0e69",
         "full_name":"Arturs",
         "username":"as"
      },
      {  
         "_id":"56e53338a941253d470e0d35",
         "full_name":"Gorkem",
         "username":"gorkem"
      }
   ],
   "admin":[  
      {  
         "_id":"56e7300389cef9ff30cf6aa0",
         "full_name":"Onur",
         "username":"oas"
      }
   ],
   "user":[  
      {  
         "_id":"56e7300389cef9ff30cf6aa0",
         "full_name":"me",
         "username":"me"
      }
   ]
}
{"result":"User does not exist"}

Query Params

api_key
string

User's API_KEY

app_id
string

id of the app for which to fetch info

callback
string

(optional) name of callback function for JSONP output

 

Retrieve information about apps which were created by the user, who is the owner of the API_KEY

Suggest Edits

/o?method=locations

Retrieve locations of the app

 
gethttps://try.count.ly/o?method=locations&api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o?app_id=app_id&api_key=api_key&method=locations'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key',
     method: 'locations' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o?app_id=app_id&api_key=api_key&method=locations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o?app_id=app_id&api_key=api_key&method=locations");

xhr.send(data);
import requests

url = "https://try.count.ly/o"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "2015": {
    "2": {
      "2": {
        "20": {
          "e": 7,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 60
        },
        "e": 7,
        "t": 1,
        "JP": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 1,
        "u": 1,
        "f": {
          "0": 1
        },
        "l": {
          "0": 1
        },
        "d": 60
      },
      "3": {
        "22": {
          "e": 3,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 30
        },
        "e": 3,
        "t": 1,
        "DE": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 1,
        "u": 1,
        "f": {
          "0": 1
        },
        "l": {
          "0": 1
        },
        "d": 30
      },
      "4": {
        "18": {
          "e": 3,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 30
        },
        "e": 3,
        "t": 1,
        "GB": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 1,
        "u": 1,
        "f": {
          "0": 1
        },
        "l": {
          "0": 1
        },
        "d": 30
      },
      "5": {
        "10": {
          "e": 1,
          "t": 1,
          "n": 1,
          "u": 1
        },
        "11": {
          "e": 2,
          "d": 30
        },
        "e": 3,
        "t": 1,
        "JP": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 1,
        "u": 1,
        "f": {
          "0": 1
        },
        "l": {
          "0": 1
        },
        "d": 30
      },
      "10": {
        "10": {
          "e": 3,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 30
        },
        "e": 3,
        "t": 1,
        "GB": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 1,
        "u": 1,
        "f": {
          "0": 1
        },
        "l": {
          "0": 1
        },
        "d": 30
      },
      "13": {
        "8": {
          "e": 5,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 30
        },
        "e": 5,
        "t": 1,
        "US": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 1,
        "u": 1,
        "f": {
          "0": 1
        },
        "l": {
          "0": 1
        },
        "d": 30,
        "ds": {
          "1": 1
        }
      },
      "17": {
        "0": {
          "e": 6,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 30
        },
        "e": 6,
        "t": 1,
        "US": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 1,
        "u": 1,
        "f": {
          "0": 1
        },
        "l": {
          "0": 1
        },
        "d": 30
      },
      "20": {
        "2": {
          "e": 10,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 60
        },
        "e": 10,
        "t": 1,
        "US": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 1,
        "u": 1,
        "f": {
          "0": 1
        },
        "l": {
          "0": 1
        },
        "d": 60,
        "ds": {
          "2": 1
        }
      },
      "23": {
        "9": {
          "e": 6,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 60
        },
        "10": {
          "e": 7,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 30
        },
        "e": 13,
        "t": 2,
        "Unknown": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 2,
        "u": 2,
        "f": {
          "0": 2
        },
        "l": {
          "0": 2
        },
        "JP": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "d": 90,
        "ds": {
          "1": 1,
          "2": 1
        }
      },
      "u": 10,
      "Unknown": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "f": {
        "0": 10
      },
      "l": {
        "0": 10
      },
      "JP": {
        "u": 3,
        "t": 3,
        "n": 3
      },
      "GB": {
        "u": 2,
        "t": 2,
        "n": 2
      },
      "US": {
        "u": 3,
        "t": 3,
        "n": 3
      },
      "DE": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "ds": {
        "1": 2,
        "2": 2
      },
      "e": 53,
      "t": 10,
      "n": 10,
      "d": 390
    },
    "u": 10,
    "w8": {
      "u": 3,
      "Unknown": {
        "u": 1
      },
      "f": {
        "0": 3
      },
      "l": {
        "0": 3
      },
      "JP": {
        "u": 1
      },
      "US": {
        "u": 1
      },
      "ds": {
        "1": 1,
        "2": 2
      }
    },
    "Unknown": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "f": {
      "0": 10
    },
    "l": {
      "0": 10
    },
    "JP": {
      "u": 3,
      "t": 3,
      "n": 3
    },
    "w5": {
      "u": 3,
      "JP": {
        "u": 1
      },
      "f": {
        "0": 3
      },
      "l": {
        "0": 3
      },
      "DE": {
        "u": 1
      },
      "GB": {
        "u": 1
      }
    },
    "w6": {
      "u": 2,
      "GB": {
        "u": 1
      },
      "f": {
        "0": 2
      },
      "l": {
        "0": 2
      },
      "JP": {
        "u": 1
      }
    },
    "GB": {
      "u": 2,
      "t": 2,
      "n": 2
    },
    "US": {
      "u": 3,
      "t": 3,
      "n": 3
    },
    "w7": {
      "u": 2,
      "US": {
        "u": 2
      },
      "f": {
        "0": 2
      },
      "l": {
        "0": 2
      },
      "ds": {
        "1": 1
      }
    },
    "DE": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "ds": {
      "1": 2,
      "2": 2
    },
    "e": 53,
    "t": 10,
    "n": 10,
    "d": 390
  },
  "meta": {
    "f-ranges": [
      "0"
    ],
    "l-ranges": [
      "0"
    ],
    "countries": [
      "Unknown",
      "JP",
      "GB",
      "US",
      "DE"
    ],
    "d-ranges": [
      "1",
      "2"
    ]
  }
}

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

Query Params

period
string

For which time period to provide data, possible values (month, 60days, 30days, 7days, yesterday, hour or [startMiliseconds, endMiliseconds] as [1417730400000,1420149600000])

callback
string

(optional) name of callback function for JSONP output

 

Retrieves the raw location data of the app, the object is divided by time metrics, like year, month, date and can be processed by Countly JavaScript libraries

e - events or requests sent to server

n - new sessions

t - total sessions

u - unique locations

d - total session duration

ds - durations (counts)

f - frequency

l - loyalty

Suggest Edits

/o?method=sessions

Retrieve session information of the app

 
gethttps://try.count.ly/o?method=sessions&api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o?app_id=app_id&api_key=api_key&method=sessions'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key',
     method: 'sessions' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o?app_id=app_id&api_key=api_key&method=sessions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o?app_id=app_id&api_key=api_key&method=sessions");

xhr.send(data);
import requests

url = "https://try.count.ly/o"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "2015": {
    "2": {
      "2": {
        "20": {
          "e": 7,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 60
        },
        "e": 7,
        "t": 1,
        "JP": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 1,
        "u": 1,
        "f": {
          "0": 1
        },
        "l": {
          "0": 1
        },
        "d": 60
      },
      "3": {
        "22": {
          "e": 3,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 30
        },
        "e": 3,
        "t": 1,
        "DE": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 1,
        "u": 1,
        "f": {
          "0": 1
        },
        "l": {
          "0": 1
        },
        "d": 30
      },
      "4": {
        "18": {
          "e": 3,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 30
        },
        "e": 3,
        "t": 1,
        "GB": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 1,
        "u": 1,
        "f": {
          "0": 1
        },
        "l": {
          "0": 1
        },
        "d": 30
      },
      "5": {
        "10": {
          "e": 1,
          "t": 1,
          "n": 1,
          "u": 1
        },
        "11": {
          "e": 2,
          "d": 30
        },
        "e": 3,
        "t": 1,
        "JP": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 1,
        "u": 1,
        "f": {
          "0": 1
        },
        "l": {
          "0": 1
        },
        "d": 30
      },
      "10": {
        "10": {
          "e": 3,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 30
        },
        "e": 3,
        "t": 1,
        "GB": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 1,
        "u": 1,
        "f": {
          "0": 1
        },
        "l": {
          "0": 1
        },
        "d": 30
      },
      "13": {
        "8": {
          "e": 5,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 30
        },
        "e": 5,
        "t": 1,
        "US": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 1,
        "u": 1,
        "f": {
          "0": 1
        },
        "l": {
          "0": 1
        },
        "d": 30,
        "ds": {
          "1": 1
        }
      },
      "17": {
        "0": {
          "e": 6,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 30
        },
        "e": 6,
        "t": 1,
        "US": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 1,
        "u": 1,
        "f": {
          "0": 1
        },
        "l": {
          "0": 1
        },
        "d": 30
      },
      "20": {
        "2": {
          "e": 10,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 60
        },
        "e": 10,
        "t": 1,
        "US": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 1,
        "u": 1,
        "f": {
          "0": 1
        },
        "l": {
          "0": 1
        },
        "d": 60,
        "ds": {
          "2": 1
        }
      },
      "23": {
        "9": {
          "e": 6,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 60
        },
        "10": {
          "e": 7,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 30
        },
        "e": 13,
        "t": 2,
        "Unknown": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 2,
        "u": 2,
        "f": {
          "0": 2
        },
        "l": {
          "0": 2
        },
        "JP": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "d": 90,
        "ds": {
          "1": 1,
          "2": 1
        }
      },
      "u": 10,
      "Unknown": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "f": {
        "0": 10
      },
      "l": {
        "0": 10
      },
      "JP": {
        "u": 3,
        "t": 3,
        "n": 3
      },
      "GB": {
        "u": 2,
        "t": 2,
        "n": 2
      },
      "US": {
        "u": 3,
        "t": 3,
        "n": 3
      },
      "DE": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "ds": {
        "1": 2,
        "2": 2
      },
      "e": 53,
      "t": 10,
      "n": 10,
      "d": 390
    },
    "u": 10,
    "w8": {
      "u": 3,
      "Unknown": {
        "u": 1
      },
      "f": {
        "0": 3
      },
      "l": {
        "0": 3
      },
      "JP": {
        "u": 1
      },
      "US": {
        "u": 1
      },
      "ds": {
        "1": 1,
        "2": 2
      }
    },
    "Unknown": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "f": {
      "0": 10
    },
    "l": {
      "0": 10
    },
    "JP": {
      "u": 3,
      "t": 3,
      "n": 3
    },
    "w5": {
      "u": 3,
      "JP": {
        "u": 1
      },
      "f": {
        "0": 3
      },
      "l": {
        "0": 3
      },
      "DE": {
        "u": 1
      },
      "GB": {
        "u": 1
      }
    },
    "w6": {
      "u": 2,
      "GB": {
        "u": 1
      },
      "f": {
        "0": 2
      },
      "l": {
        "0": 2
      },
      "JP": {
        "u": 1
      }
    },
    "GB": {
      "u": 2,
      "t": 2,
      "n": 2
    },
    "US": {
      "u": 3,
      "t": 3,
      "n": 3
    },
    "w7": {
      "u": 2,
      "US": {
        "u": 2
      },
      "f": {
        "0": 2
      },
      "l": {
        "0": 2
      },
      "ds": {
        "1": 1
      }
    },
    "DE": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "ds": {
      "1": 2,
      "2": 2
    },
    "e": 53,
    "t": 10,
    "n": 10,
    "d": 390
  },
  "meta": {
    "f-ranges": [
      "0"
    ],
    "l-ranges": [
      "0"
    ],
    "countries": [
      "Unknown",
      "JP",
      "GB",
      "US",
      "DE"
    ],
    "d-ranges": [
      "1",
      "2"
    ]
  }
}

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

Query Params

period
string

For which time period to provide data, possible values (month, 60days, 30days, 7days, yesterday, hour or [startMiliseconds, endMiliseconds] as [1417730400000,1420149600000])

callback
string

(optional) name of callback function for JSONP output

 

Retrieves the raw session data of the app, the object is divided by time metrics, like year, month, date and can be processed by Countly JavaScript libraries

e - events or requests sent to server

n - new sessions

t - total sessions

u - unique locations

d - total session duration

ds - durations (counts)

f - frequency

l - loyalty

Suggest Edits

/o?method=users

Retrieve users of the app

 
gethttps://try.count.ly/o?method=users&api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o?app_id=app_id&api_key=api_key&method=users'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key',
     method: 'users' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o?app_id=app_id&api_key=api_key&method=users")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o?app_id=app_id&api_key=api_key&method=users");

xhr.send(data);
import requests

url = "https://try.count.ly/o"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "2015": {
    "2": {
      "2": {
        "20": {
          "e": 7,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 60
        },
        "e": 7,
        "t": 1,
        "JP": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 1,
        "u": 1,
        "f": {
          "0": 1
        },
        "l": {
          "0": 1
        },
        "d": 60
      },
      "3": {
        "22": {
          "e": 3,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 30
        },
        "e": 3,
        "t": 1,
        "DE": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 1,
        "u": 1,
        "f": {
          "0": 1
        },
        "l": {
          "0": 1
        },
        "d": 30
      },
      "4": {
        "18": {
          "e": 3,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 30
        },
        "e": 3,
        "t": 1,
        "GB": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 1,
        "u": 1,
        "f": {
          "0": 1
        },
        "l": {
          "0": 1
        },
        "d": 30
      },
      "5": {
        "10": {
          "e": 1,
          "t": 1,
          "n": 1,
          "u": 1
        },
        "11": {
          "e": 2,
          "d": 30
        },
        "e": 3,
        "t": 1,
        "JP": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 1,
        "u": 1,
        "f": {
          "0": 1
        },
        "l": {
          "0": 1
        },
        "d": 30
      },
      "10": {
        "10": {
          "e": 3,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 30
        },
        "e": 3,
        "t": 1,
        "GB": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 1,
        "u": 1,
        "f": {
          "0": 1
        },
        "l": {
          "0": 1
        },
        "d": 30
      },
      "13": {
        "8": {
          "e": 5,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 30
        },
        "e": 5,
        "t": 1,
        "US": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 1,
        "u": 1,
        "f": {
          "0": 1
        },
        "l": {
          "0": 1
        },
        "d": 30,
        "ds": {
          "1": 1
        }
      },
      "17": {
        "0": {
          "e": 6,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 30
        },
        "e": 6,
        "t": 1,
        "US": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 1,
        "u": 1,
        "f": {
          "0": 1
        },
        "l": {
          "0": 1
        },
        "d": 30
      },
      "20": {
        "2": {
          "e": 10,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 60
        },
        "e": 10,
        "t": 1,
        "US": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 1,
        "u": 1,
        "f": {
          "0": 1
        },
        "l": {
          "0": 1
        },
        "d": 60,
        "ds": {
          "2": 1
        }
      },
      "23": {
        "9": {
          "e": 6,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 60
        },
        "10": {
          "e": 7,
          "t": 1,
          "n": 1,
          "u": 1,
          "d": 30
        },
        "e": 13,
        "t": 2,
        "Unknown": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "n": 2,
        "u": 2,
        "f": {
          "0": 2
        },
        "l": {
          "0": 2
        },
        "JP": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "d": 90,
        "ds": {
          "1": 1,
          "2": 1
        }
      },
      "u": 10,
      "Unknown": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "f": {
        "0": 10
      },
      "l": {
        "0": 10
      },
      "JP": {
        "u": 3,
        "t": 3,
        "n": 3
      },
      "GB": {
        "u": 2,
        "t": 2,
        "n": 2
      },
      "US": {
        "u": 3,
        "t": 3,
        "n": 3
      },
      "DE": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "ds": {
        "1": 2,
        "2": 2
      },
      "e": 53,
      "t": 10,
      "n": 10,
      "d": 390
    },
    "u": 10,
    "w8": {
      "u": 3,
      "Unknown": {
        "u": 1
      },
      "f": {
        "0": 3
      },
      "l": {
        "0": 3
      },
      "JP": {
        "u": 1
      },
      "US": {
        "u": 1
      },
      "ds": {
        "1": 1,
        "2": 2
      }
    },
    "Unknown": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "f": {
      "0": 10
    },
    "l": {
      "0": 10
    },
    "JP": {
      "u": 3,
      "t": 3,
      "n": 3
    },
    "w5": {
      "u": 3,
      "JP": {
        "u": 1
      },
      "f": {
        "0": 3
      },
      "l": {
        "0": 3
      },
      "DE": {
        "u": 1
      },
      "GB": {
        "u": 1
      }
    },
    "w6": {
      "u": 2,
      "GB": {
        "u": 1
      },
      "f": {
        "0": 2
      },
      "l": {
        "0": 2
      },
      "JP": {
        "u": 1
      }
    },
    "GB": {
      "u": 2,
      "t": 2,
      "n": 2
    },
    "US": {
      "u": 3,
      "t": 3,
      "n": 3
    },
    "w7": {
      "u": 2,
      "US": {
        "u": 2
      },
      "f": {
        "0": 2
      },
      "l": {
        "0": 2
      },
      "ds": {
        "1": 1
      }
    },
    "DE": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "ds": {
      "1": 2,
      "2": 2
    },
    "e": 53,
    "t": 10,
    "n": 10,
    "d": 390
  },
  "meta": {
    "f-ranges": [
      "0"
    ],
    "l-ranges": [
      "0"
    ],
    "countries": [
      "Unknown",
      "JP",
      "GB",
      "US",
      "DE"
    ],
    "d-ranges": [
      "1",
      "2"
    ]
  }
}

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

Query Params

period
string

For which time period to provide data, possible values (month, 60days, 30days, 7days, yesterday, hour or [startMiliseconds, endMiliseconds] as [1417730400000,1420149600000])

callback
string

(optional) name of callback function for JSONP output

 

Retrieves the raw users data of the app, the object is divided by time metrics, like year, month, date and can be processed by Countly JavaScript libraries
e - events or requests sent to server

n - new sessions

t - total sessions

u - unique locations

d - total session duration

ds - durations (counts)

f - frequency

l - loyalty

Suggest Edits

/o?method=devices

Retrieve devices information of the app

 
gethttps://try.count.ly/o?method=devices&api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o?app_id=app_id&api_key=api_key&method=devices'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key',
     method: 'devices' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o?app_id=app_id&api_key=api_key&method=devices")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o?app_id=app_id&api_key=api_key&method=devices");

xhr.send(data);
import requests

url = "https://try.count.ly/o"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "2015": {
    "2": {
      "2": {
        "Fire Phone": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "3": {
        "iPhone 6": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "4": {
        "iPhone 5C": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "5": {
        "One S": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "10": {
        "One Touch Idol X": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "13": {
        "Optimus L5": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "17": {
        "iPhone Mini": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "20": {
        "iPhone 5C": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "23": {
        "iPhone 5": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "iPhone 5C": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "iPhone 5": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "Fire Phone": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "One S": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "iPhone 5C": {
        "u": 3,
        "t": 3,
        "n": 3
      },
      "One Touch Idol X": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "Optimus L5": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "iPhone 6": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "iPhone Mini": {
        "u": 1,
        "t": 1,
        "n": 1
      }
    },
    "iPhone 5": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "w8": {
      "iPhone 5": {
        "u": 1
      },
      "iPhone 5C": {
        "u": 2
      }
    },
    "Fire Phone": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "w5": {
      "Fire Phone": {
        "u": 1
      },
      "iPhone 6": {
        "u": 1
      },
      "iPhone 5C": {
        "u": 1
      }
    },
    "One S": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "w6": {
      "One S": {
        "u": 1
      },
      "One Touch Idol X": {
        "u": 1
      }
    },
    "iPhone 5C": {
      "u": 3,
      "t": 3,
      "n": 3
    },
    "One Touch Idol X": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "Optimus L5": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "w7": {
      "Optimus L5": {
        "u": 1
      },
      "iPhone Mini": {
        "u": 1
      }
    },
    "iPhone 6": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "iPhone Mini": {
      "u": 1,
      "t": 1,
      "n": 1
    }
  },
  "meta": {
    "devices": [
      "iPhone 5",
      "Fire Phone",
      "One S",
      "iPhone 5C",
      "One Touch Idol X",
      "Optimus L5",
      "iPhone 6",
      "iPhone Mini"
    ]
  }
}

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

Query Params

period
string

For which time period to provide data, possible values (month, 60days, 30days, 7days, yesterday, hour or [startMiliseconds, endMiliseconds] as [1417730400000,1420149600000])

callback
string

(optional) name of callback function for JSONP output

 

Retrieves the raw devices data of the app, the object is divided by time metrics, like year, month, date and can be processed by Countly JavaScript libraries
n - new devices
t - total devices
u - unique devices

Suggest Edits

/o?method=device_details

Retrieve device details data of the app

 
gethttps://try.count.ly/o?method=device_details&api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o?app_id=app_id&api_key=api_key&method=device_details'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key',
     method: 'device_details' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o?app_id=app_id&api_key=api_key&method=device_details")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o?app_id=app_id&api_key=api_key&method=device_details");

xhr.send(data);
import requests

url = "https://try.count.ly/o"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "2015": {
    "2": {
      "2": {
        "3:1": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "Android": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "a2:3": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "640x1136": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "3": {
        "2:1": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "iOS": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "i4:1": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "600x800": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "4": {
        "2:5": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "iOS": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "i4:0": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "720x1280": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "5": {
        "1:7": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "Android": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "a6:0": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "1080x1920": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "10": {
        "2:4": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "Android": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "a7:1": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "360x640": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "13": {
        "3:1": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "Android": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "a4:3": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "360x640": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "17": {
        "3:2": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "iOS": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "i6:1": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "360x640": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "20": {
        "2:9": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "Android": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "a4:0": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "1536x2048": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "23": {
        "2:1": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "Windows Phone": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "w4:2": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "480x800": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "2:8": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "Android": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "a4:1": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "240x400": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "2:1": {
        "u": 2,
        "t": 2,
        "n": 2
      },
      "Windows Phone": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "w4:2": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "480x800": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "3:1": {
        "u": 2,
        "t": 2,
        "n": 2
      },
      "Android": {
        "u": 6,
        "t": 6,
        "n": 6
      },
      "a2:3": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "640x1136": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "2:9": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "a4:0": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "1536x2048": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "2:8": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "a4:1": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "240x400": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "2:4": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "a7:1": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "360x640": {
        "u": 3,
        "t": 3,
        "n": 3
      },
      "a4:3": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "1:7": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "a6:0": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "1080x1920": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "iOS": {
        "u": 3,
        "t": 3,
        "n": 3
      },
      "i4:1": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "600x800": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "3:2": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "i6:1": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "2:5": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "i4:0": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "720x1280": {
        "u": 1,
        "t": 1,
        "n": 1
      }
    },
    "2:1": {
      "u": 2,
      "t": 2,
      "n": 2
    },
    "w8": {
      "2:1": {
        "u": 1
      },
      "Windows Phone": {
        "u": 1
      },
      "w4:2": {
        "u": 1
      },
      "480x800": {
        "u": 1
      },
      "2:9": {
        "u": 1
      },
      "Android": {
        "u": 2
      },
      "a4:0": {
        "u": 1
      },
      "1536x2048": {
        "u": 1
      },
      "2:8": {
        "u": 1
      },
      "a4:1": {
        "u": 1
      },
      "240x400": {
        "u": 1
      }
    },
    "Windows Phone": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "w4:2": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "480x800": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "3:1": {
      "u": 2,
      "t": 2,
      "n": 2
    },
    "w5": {
      "3:1": {
        "u": 1
      },
      "Android": {
        "u": 1
      },
      "a2:3": {
        "u": 1
      },
      "640x1136": {
        "u": 1
      },
      "2:1": {
        "u": 1
      },
      "iOS": {
        "u": 2
      },
      "i4:1": {
        "u": 1
      },
      "600x800": {
        "u": 1
      },
      "2:5": {
        "u": 1
      },
      "i4:0": {
        "u": 1
      },
      "720x1280": {
        "u": 1
      }
    },
    "Android": {
      "u": 6,
      "t": 6,
      "n": 6
    },
    "a2:3": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "640x1136": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "2:9": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "a4:0": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "1536x2048": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "2:8": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "a4:1": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "240x400": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "2:4": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "w6": {
      "2:4": {
        "u": 1
      },
      "Android": {
        "u": 2
      },
      "a7:1": {
        "u": 1
      },
      "360x640": {
        "u": 1
      },
      "1:7": {
        "u": 1
      },
      "a6:0": {
        "u": 1
      },
      "1080x1920": {
        "u": 1
      }
    },
    "a7:1": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "360x640": {
      "u": 3,
      "t": 3,
      "n": 3
    },
    "w7": {
      "3:1": {
        "u": 1
      },
      "Android": {
        "u": 1
      },
      "a4:3": {
        "u": 1
      },
      "360x640": {
        "u": 2
      },
      "3:2": {
        "u": 1
      },
      "iOS": {
        "u": 1
      },
      "i6:1": {
        "u": 1
      }
    },
    "a4:3": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "1:7": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "a6:0": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "1080x1920": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "iOS": {
      "u": 3,
      "t": 3,
      "n": 3
    },
    "i4:1": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "600x800": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "3:2": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "i6:1": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "2:5": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "i4:0": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "720x1280": {
      "u": 1,
      "t": 1,
      "n": 1
    }
  },
  "meta": {
    "app_versions": [
      "2:1",
      "3:1",
      "2:9",
      "2:8",
      "2:4",
      "1:7",
      "3:2",
      "2:5"
    ],
    "os": [
      "Windows Phone",
      "Android",
      "iOS"
    ],
    "os_versions": [
      "w4:2",
      "a2:3",
      "a4:0",
      "a4:1",
      "a7:1",
      "a4:3",
      "a6:0",
      "i4:1",
      "i6:1",
      "i4:0"
    ],
    "resolutions": [
      "480x800",
      "640x1136",
      "1536x2048",
      "240x400",
      "360x640",
      "1080x1920",
      "600x800",
      "720x1280"
    ]
  }
}

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

Query Params

period
string

For which time period to provide data, possible values (month, 60days, 30days, 7days, yesterday, hour or [startMiliseconds, endMiliseconds] as [1417730400000,1420149600000])

callback
string

(optional) name of callback function for JSONP output

 

Retrieves the raw device details data of the app segmented by display resolutions, display densities, os, os versions and app versions. The object is divided by time metrics, like year, month, date and can be processed by Countly JavaScript libraries

n - new instances

t - total instances

u - unique instances

Due to MongoDB inability to use key names that contain dots, all dots are replace by colons ":". So 1.2 becomes 1:2.

To differentiate platform versions, each platform version is formed by using first letter of platform name and version, so Windows 8.1 becomes w8:1

Suggest Edits

/o?method=carriers

Retrieve carriers of the app

 
gethttps://try.count.ly/o?method=carriers&api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o?app_id=app_id&api_key=api_key&method=carriers'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key',
     method: 'carriers' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o?app_id=app_id&api_key=api_key&method=carriers")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o?app_id=app_id&api_key=api_key&method=carriers");

xhr.send(data);
import requests

url = "https://try.count.ly/o"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "2015": {
    "2": {
      "2": {
        "Sprint": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "3": {
        "Verizon": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "4": {
        "Tele2": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "5": {
        "Rogers Wireless": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "10": {
        "\tAt&t": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "13": {
        "Vodafone": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "17": {
        "Bell Canada": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "20": {
        "Verizon": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "23": {
        "Rogers Wireless": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "Cricket Communications": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "Rogers Wireless": {
        "u": 2,
        "t": 2,
        "n": 2
      },
      "Cricket Communications": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "Verizon": {
        "u": 2,
        "t": 2,
        "n": 2
      },
      "Sprint": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "\tAt&t": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "Vodafone": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "Bell Canada": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "Tele2": {
        "u": 1,
        "t": 1,
        "n": 1
      }
    },
    "Rogers Wireless": {
      "u": 2,
      "t": 2,
      "n": 2
    },
    "w8": {
      "Rogers Wireless": {
        "u": 1
      },
      "Cricket Communications": {
        "u": 1
      },
      "Verizon": {
        "u": 1
      }
    },
    "Cricket Communications": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "Verizon": {
      "u": 2,
      "t": 2,
      "n": 2
    },
    "Sprint": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "w5": {
      "Sprint": {
        "u": 1
      },
      "Verizon": {
        "u": 1
      },
      "Tele2": {
        "u": 1
      }
    },
    "\tAt&t": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "w6": {
      "\tAt&t": {
        "u": 1
      },
      "Rogers Wireless": {
        "u": 1
      }
    },
    "Vodafone": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "w7": {
      "Vodafone": {
        "u": 1
      },
      "Bell Canada": {
        "u": 1
      }
    },
    "Bell Canada": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "Tele2": {
      "u": 1,
      "t": 1,
      "n": 1
    }
  },
  "meta": {
    "carriers": [
      "Rogers Wireless",
      "Cricket Communications",
      "Verizon",
      "Sprint",
      "\tAt&t",
      "Vodafone",
      "Bell Canada",
      "Tele2"
    ]
  }
}

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

Query Params

period
string

For which time period to provide data, possible values (month, 60days, 30days, 7days, yesterday, hour or [startMiliseconds, endMiliseconds] as [1417730400000,1420149600000])

callback
string

(optional) name of callback function for JSONP output

 

Retrieves the raw carriers data of the app, the object is divided by time metrics, like year, month, date and can be processed by Countly JavaScript libraries
n - new carries
t - total carries
u - unique carriers

Suggest Edits

/o?method=app_versions

Retrieve app versions data of the app

 
gethttps://try.count.ly/o?method=app_versions&api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o?app_id=app_id&api_key=api_key&method=app_versions'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key',
     method: 'app_versions' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o?app_id=app_id&api_key=api_key&method=app_versions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o?app_id=app_id&api_key=api_key&method=app_versions");

xhr.send(data);
import requests

url = "https://try.count.ly/o"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "2015": {
    "2": {
      "2": {
        "3:1": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "Android": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "a2:3": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "640x1136": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "3": {
        "2:1": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "iOS": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "i4:1": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "600x800": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "4": {
        "2:5": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "iOS": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "i4:0": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "720x1280": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "5": {
        "1:7": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "Android": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "a6:0": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "1080x1920": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "10": {
        "2:4": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "Android": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "a7:1": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "360x640": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "13": {
        "3:1": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "Android": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "a4:3": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "360x640": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "17": {
        "3:2": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "iOS": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "i6:1": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "360x640": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "20": {
        "2:9": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "Android": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "a4:0": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "1536x2048": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "23": {
        "2:1": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "Windows Phone": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "w4:2": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "480x800": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "2:8": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "Android": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "a4:1": {
          "t": 1,
          "n": 1,
          "u": 1
        },
        "240x400": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "2:1": {
        "u": 2,
        "t": 2,
        "n": 2
      },
      "Windows Phone": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "w4:2": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "480x800": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "3:1": {
        "u": 2,
        "t": 2,
        "n": 2
      },
      "Android": {
        "u": 6,
        "t": 6,
        "n": 6
      },
      "a2:3": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "640x1136": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "2:9": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "a4:0": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "1536x2048": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "2:8": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "a4:1": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "240x400": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "2:4": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "a7:1": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "360x640": {
        "u": 3,
        "t": 3,
        "n": 3
      },
      "a4:3": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "1:7": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "a6:0": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "1080x1920": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "iOS": {
        "u": 3,
        "t": 3,
        "n": 3
      },
      "i4:1": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "600x800": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "3:2": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "i6:1": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "2:5": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "i4:0": {
        "u": 1,
        "t": 1,
        "n": 1
      },
      "720x1280": {
        "u": 1,
        "t": 1,
        "n": 1
      }
    },
    "2:1": {
      "u": 2,
      "t": 2,
      "n": 2
    },
    "w8": {
      "2:1": {
        "u": 1
      },
      "Windows Phone": {
        "u": 1
      },
      "w4:2": {
        "u": 1
      },
      "480x800": {
        "u": 1
      },
      "2:9": {
        "u": 1
      },
      "Android": {
        "u": 2
      },
      "a4:0": {
        "u": 1
      },
      "1536x2048": {
        "u": 1
      },
      "2:8": {
        "u": 1
      },
      "a4:1": {
        "u": 1
      },
      "240x400": {
        "u": 1
      }
    },
    "Windows Phone": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "w4:2": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "480x800": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "3:1": {
      "u": 2,
      "t": 2,
      "n": 2
    },
    "w5": {
      "3:1": {
        "u": 1
      },
      "Android": {
        "u": 1
      },
      "a2:3": {
        "u": 1
      },
      "640x1136": {
        "u": 1
      },
      "2:1": {
        "u": 1
      },
      "iOS": {
        "u": 2
      },
      "i4:1": {
        "u": 1
      },
      "600x800": {
        "u": 1
      },
      "2:5": {
        "u": 1
      },
      "i4:0": {
        "u": 1
      },
      "720x1280": {
        "u": 1
      }
    },
    "Android": {
      "u": 6,
      "t": 6,
      "n": 6
    },
    "a2:3": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "640x1136": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "2:9": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "a4:0": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "1536x2048": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "2:8": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "a4:1": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "240x400": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "2:4": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "w6": {
      "2:4": {
        "u": 1
      },
      "Android": {
        "u": 2
      },
      "a7:1": {
        "u": 1
      },
      "360x640": {
        "u": 1
      },
      "1:7": {
        "u": 1
      },
      "a6:0": {
        "u": 1
      },
      "1080x1920": {
        "u": 1
      }
    },
    "a7:1": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "360x640": {
      "u": 3,
      "t": 3,
      "n": 3
    },
    "w7": {
      "3:1": {
        "u": 1
      },
      "Android": {
        "u": 1
      },
      "a4:3": {
        "u": 1
      },
      "360x640": {
        "u": 2
      },
      "3:2": {
        "u": 1
      },
      "iOS": {
        "u": 1
      },
      "i6:1": {
        "u": 1
      }
    },
    "a4:3": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "1:7": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "a6:0": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "1080x1920": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "iOS": {
      "u": 3,
      "t": 3,
      "n": 3
    },
    "i4:1": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "600x800": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "3:2": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "i6:1": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "2:5": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "i4:0": {
      "u": 1,
      "t": 1,
      "n": 1
    },
    "720x1280": {
      "u": 1,
      "t": 1,
      "n": 1
    }
  },
  "meta": {
    "app_versions": [
      "2:1",
      "3:1",
      "2:9",
      "2:8",
      "2:4",
      "1:7",
      "3:2",
      "2:5"
    ],
    "os": [
      "Windows Phone",
      "Android",
      "iOS"
    ],
    "os_versions": [
      "w4:2",
      "a2:3",
      "a4:0",
      "a4:1",
      "a7:1",
      "a4:3",
      "a6:0",
      "i4:1",
      "i6:1",
      "i4:0"
    ],
    "resolutions": [
      "480x800",
      "640x1136",
      "1536x2048",
      "240x400",
      "360x640",
      "1080x1920",
      "600x800",
      "720x1280"
    ]
  }
}

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

Query Params

period
string

For which time period to provide data, possible values (month, 60days, 30days, 7days, yesterday, hour or [startMiliseconds, endMiliseconds] as [1417730400000,1420149600000])

callback
string

(optional) name of callback function for JSONP output

 

Retrieves the raw device details data of the app (including app version), the object is divided by time metrics, like year, month, date and can be processed by Countly JavaScript libraries

n - new app version instances

t - total app version instances

u - unique app version instances

Note that app version names are modified per MongoDB inability to use dots in key names, so all dots in app version are replaces by colon ":"

Suggest Edits

/o?method=cities

Retrieve city locations of the app

 
gethttps://try.count.ly/o?method=cities&api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o?app_id=app_id&api_key=api_key&method=cities'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key',
     method: 'cities' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o?app_id=app_id&api_key=api_key&method=cities")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o?app_id=app_id&api_key=api_key&method=cities");

xhr.send(data);
import requests

url = "https://try.count.ly/o"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "2015": {
    "1": {
      "Unknown": {
        "u": 1
      },
      "Klaukkala": {
        "u": 1
      },
      "Tammela": {
        "u": 1
      }
    },
    "2": {
      "5": {
        "Unknown": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "12": {
        "Unknown": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "16": {
        "Unknown": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "22": {
        "Unknown": {
          "t": 1,
          "n": 1,
          "u": 1
        }
      },
      "Unknown": {
        "u": 4,
        "t": 4,
        "n": 4
      }
    },
    "Unknown": {
      "u": 5,
      "t": 4,
      "n": 4
    },
    "w4": {
      "Unknown": {
        "u": 1
      },
      "Tammela": {
        "u": 1
      }
    },
    "Klaukkala": {
      "u": 1
    },
    "w5": {
      "Klaukkala": {
        "u": 1
      }
    },
    "w6": {
      "Unknown": {
        "u": 1
      }
    },
    "w7": {
      "Unknown": {
        "u": 2
      }
    },
    "w8": {
      "Unknown": {
        "u": 1
      }
    },
    "Tammela": {
      "u": 1
    }
  },
  "meta": {
    "cities": [
      "Unknown",
      "Klaukkala",
      "Tammela"
    ]
  }
}

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

Query Params

period
string

For which time period to provide data, possible values (month, 60days, 30days, 7days, yesterday, hour or [startMiliseconds, endMiliseconds] as [1417730400000,1420149600000])

callback
string

(optional) name of callback function for JSONP output

 

Retrieves the raw city location data of the app, the object is divided by time metrics, like year, month, date and can be processed by Countly JavaScript libraries
Note: that you must enable collecting city data, by setting city_data to true in /api/config.js
n - new cities
t - total cities
u - unique cities

Suggest Edits

/o?method=events

Retrieve events of the app

 
gethttps://try.count.ly/o?method=events&api_key=api_key&app_id=app_id&event=event
curl --request GET \
  --url 'https://try.count.ly/o?event=event&app_id=app_id&api_key=api_key&method=events'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o',
  qs: 
   { event: 'event',
     app_id: 'app_id',
     api_key: 'api_key',
     method: 'events' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o?event=event&app_id=app_id&api_key=api_key&method=events")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o?event=event&app_id=app_id&api_key=api_key&method=events");

xhr.send(data);
import requests

url = "https://try.count.ly/o"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "2015": {
    "2": {
      "2": {
        "20": {
          "c": 1
        },
        "c": 1
      },
      "17": {
        "0": {
          "c": 1
        },
        "c": 1
      },
      "23": {
        "9": {
          "c": 1
        },
        "c": 1
      },
      "c": 3
    },
    "c": 3
  },
  "meta": {
    "level": [
      "[CLY]3",
      "[CLY]7",
      "[CLY]9"
    ],
    "segments": [
      "level",
      "mode",
      "difficulty"
    ],
    "mode": [
      "physics",
      "story"
    ],
    "difficulty": [
      "easy",
      "hard"
    ]
  }
}
{
  "2015": {
    "2": {
      "2": {
        "easy": {
          "c": 1
        }
      },
      "17": {
        "hard": {
          "c": 1
        }
      },
      "23": {
        "hard": {
          "c": 1
        }
      },
      "easy": {
        "c": 1
      },
      "hard": {
        "c": 2
      }
    },
    "easy": {
      "c": 1
    },
    "hard": {
      "c": 2
    }
  },
  "meta": {
    "level": [
      "[CLY]3",
      "[CLY]7",
      "[CLY]9"
    ],
    "segments": [
      "level",
      "mode",
      "difficulty"
    ],
    "mode": [
      "physics",
      "story"
    ],
    "difficulty": [
      "easy",
      "hard"
    ]
  }
}

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

event
string
required

(optional) Name of event for which to retrieve data, if not provided will return data for first event ever occured

Query Params

period
string

For which time period to provide data, possible values (month, 60days, 30days, 7days, yesterday, hour or [startMiliseconds, endMiliseconds] as [1417730400000,1420149600000])

events
string

(optional) JSON array as string, where you may provide multiple event names and will return merged data of all these events

callback
string

(optional) name of callback function for JSONP output

segmentation
string

(optional) Fetch data for specific segmentation of event

 

Retrieves the raw event data of the app segmented by provided event segmentation. The object is divided by time metrics, like year, month, date and can be processed by Countly JavaScript libraries
c - total count
s - total sum

Suggest Edits

/o?method=get_events

Retrieve list of events of the app

 
gethttps://try.count.ly/o?method=get_events&api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o?app_id=app_id&api_key=api_key&method=get_events'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key',
     method: 'get_events' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o?app_id=app_id&api_key=api_key&method=get_events")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o?app_id=app_id&api_key=api_key&method=get_events");

xhr.send(data);
import requests

url = "https://try.count.ly/o"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
    "_id": "542bad58b3bced1a67000003",
    "list": [
        "test",
        "test1",
        "test2"
    ],
    "segments": {
      	"test1": [
            "version",
            "country",
            "market"
        ],
      	"test2":[
            "country",
            "market"
        ]
    ]
}

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

Query Params

callback
string

(optional) name of callback function for JSONP output

action
string

(optional) Only acceptable value is refresh, which will return only data for today

 

Retrieves the list of events and segments of the app

Suggest Edits

/o?method=get_period_obj

Get information about period object selected in dashboard

 
gethttps://try.count.ly/o?method=get_period_obj&api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o?app_id=app_id&api_key=api_key&method=get_period_obj'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key',
     method: 'get_period_obj' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o?app_id=app_id&api_key=api_key&method=get_period_obj")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o?app_id=app_id&api_key=api_key&method=get_period_obj");

xhr.send(data);
import requests

url = "https://try.count.ly/o"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "activePeriod": 2015,
  "periodMax": 3,
  "periodMin": 1,
  "previousPeriod": 2014,
  "currentPeriodArr": [
    "2015.1.1",
    "2015.1.2",
    "2015.1.3",
    "2015.1.4",
    "2015.1.5",
    "2015.1.6",
    "2015.1.7",
    "2015.1.8",
    "2015.1.9",
    "2015.1.10",
    "2015.1.11",
    "2015.1.12",
    "2015.1.13",
    "2015.1.14",
    "2015.1.15",
    "2015.1.16",
    "2015.1.17",
    "2015.1.18",
    "2015.1.19",
    "2015.1.20",
    "2015.1.21",
    "2015.1.22",
    "2015.1.23",
    "2015.1.24",
    "2015.1.25",
    "2015.1.26",
    "2015.1.27",
    "2015.1.28",
    "2015.1.29",
    "2015.1.30",
    "2015.1.31",
    "2015.2.1",
    "2015.2.2",
    "2015.2.3",
    "2015.2.4",
    "2015.2.5",
    "2015.2.6",
    "2015.2.7",
    "2015.2.8",
    "2015.2.9",
    "2015.2.10",
    "2015.2.11",
    "2015.2.12",
    "2015.2.13",
    "2015.2.14",
    "2015.2.15",
    "2015.2.16",
    "2015.2.17",
    "2015.2.18",
    "2015.2.19",
    "2015.2.20",
    "2015.2.21",
    "2015.2.22",
    "2015.2.23",
    "2015.2.24",
    "2015.2.25",
    "2015.2.26",
    "2015.2.27",
    "2015.2.28",
    "2015.3.1",
    "2015.3.2",
    "2015.3.3",
    "2015.3.4"
  ],
  "previousPeriodArr": [
    "2013.12.31",
    "2014.1.1",
    "2014.1.2",
    "2014.1.3",
    "2014.1.4",
    "2014.1.5",
    "2014.1.6",
    "2014.1.7",
    "2014.1.8",
    "2014.1.9",
    "2014.1.10",
    "2014.1.11",
    "2014.1.12",
    "2014.1.13",
    "2014.1.14",
    "2014.1.15",
    "2014.1.16",
    "2014.1.17",
    "2014.1.18",
    "2014.1.19",
    "2014.1.20",
    "2014.1.21",
    "2014.1.22",
    "2014.1.23",
    "2014.1.24",
    "2014.1.25",
    "2014.1.26",
    "2014.1.27",
    "2014.1.28",
    "2014.1.29",
    "2014.1.30",
    "2014.1.31",
    "2014.2.1",
    "2014.2.2",
    "2014.2.3",
    "2014.2.4",
    "2014.2.5",
    "2014.2.6",
    "2014.2.7",
    "2014.2.8",
    "2014.2.9",
    "2014.2.10",
    "2014.2.11",
    "2014.2.12",
    "2014.2.13",
    "2014.2.14",
    "2014.2.15",
    "2014.2.16",
    "2014.2.17",
    "2014.2.18",
    "2014.2.19",
    "2014.2.20",
    "2014.2.21",
    "2014.2.22",
    "2014.2.23",
    "2014.2.24",
    "2014.2.25",
    "2014.2.26",
    "2014.2.27",
    "2014.2.28",
    "2014.3.1",
    "2014.3.2",
    "2014.3.3"
  ],
  "uniquePeriodArr": [],
  "uniquePeriodCheckArr": [],
  "previousUniquePeriodArr": [],
  "previousUniquePeriodCheckArr": [],
  "dateString": "MMM",
  "daysInPeriod": 63,
  "isSpecialPeriod": false,
  "reqMonthDbDateIds": [
    "2013:12",
    "2014:1",
    "2014:2",
    "2014:3",
    "2015:1",
    "2015:2",
    "2015:3"
  ],
  "reqZeroDbDateIds": [
    "2013:0",
    "2014:0",
    "2015:0"
  ]
}

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

Query Params

callback
string

(optional) name of callback function for JSONP output

period
string

For which time period to generate, possible values (month, 60days, 30days, 7days, yesterday, hour or [startMiliseconds, endMiliseconds] as [1417730400000,1420149600000])

 

Retrieve data about periods

Suggest Edits

/o?method=total_users

Retrieve current user breakdown by metric

 
gethttps://try.count.ly/o?method=total_users&api_key=api_key&app_id=app_id&metric=metric
curl --request GET \
  --url 'https://try.count.ly/o?metric=metric&app_id=app_id&api_key=api_key&method=total_users'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o',
  qs: 
   { metric: 'metric',
     app_id: 'app_id',
     api_key: 'api_key',
     method: 'total_users' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o?metric=metric&app_id=app_id&api_key=api_key&method=total_users")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o?metric=metric&app_id=app_id&api_key=api_key&method=total_users");

xhr.send(data);
import requests

url = "https://try.count.ly/o"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[  
   {  
      "_id":"GH",
      "u":1
   },
   {  
      "_id":"DZ",
      "u":1
   },
   {  
      "_id":"BG",
      "u":2
   },
   {  
      "_id":"DJ",
      "u":1
   },
   {  
      "_id":"SV",
      "u":1
   },
   {  
      "_id":"SI",
      "u":2
   },
   {  
      "_id":"SA",
      "u":2
   },
   {  
      "_id":"LV",
      "u":1
   },
   {  
      "_id":"MY",
      "u":2
   },
   {  
      "_id":"DK",
      "u":5
   },
   {  
      "_id":"EE",
      "u":3
   },
   {  
      "_id":"VI",
      "u":1
   },
   {  
      "_id":"SY",
      "u":3
   },
   {  
      "_id":"CR",
      "u":4
   },
   {  
      "_id":"NG",
      "u":2
   },
   {  
      "_id":"VE",
      "u":2
   },
   {  
      "_id":"PA",
      "u":2
   },
   {  
      "_id":"BE",
      "u":16
   },
   {  
      "_id":"BZ",
      "u":1
   },
   {  
      "_id":"NL",
      "u":23
   },
   {  
      "_id":"TR",
      "u":7
   },
   {  
      "_id":"FJ",
      "u":1
   },
   {  
      "_id":"GB",
      "u":76
   },
   {  
      "_id":"US",
      "u":747
   },
   {  
      "_id":"AR",
      "u":5
   },
   {  
      "_id":"ZA",
      "u":17
   },
   {  
      "_id":"TJ",
      "u":1
   },
   {  
      "_id":"SE",
      "u":17
   },
   {  
      "_id":"PE",
      "u":2
   },
   {  
      "_id":"Unknown",
      "u":364
   },
   {  
      "_id":"CL",
      "u":6
   },
   {  
      "_id":"SG",
      "u":3
   },
   {  
      "_id":"HN",
      "u":1
   },
   {  
      "_id":"IR",
      "u":13
   },
   {  
      "_id":"CA",
      "u":40
   },
   {  
      "_id":"AU",
      "u":25
   },
   {  
      "_id":"NA",
      "u":2
   },
   {  
      "_id":"BR",
      "u":46
   },
   {  
      "_id":"PL",
      "u":5
   },
   {  
      "_id":"AE",
      "u":4
   },
   {  
      "_id":"KE",
      "u":4
   },
   {  
      "_id":"JP",
      "u":129
   },
   {  
      "_id":"DE",
      "u":62
   },
   {  
      "_id":"A2",
      "u":1
   },
   {  
      "_id":"KR",
      "u":57
   },
   {  
      "_id":"IT",
      "u":20
   },
   {  
      "_id":"HK",
      "u":4
   },
   {  
      "_id":"MA",
      "u":6
   },
   {  
      "_id":"SD",
      "u":2
   },
   {  
      "_id":"LK",
      "u":1
   },
   {  
      "_id":"FR",
      "u":46
   },
   {  
      "_id":"IN",
      "u":13
   },
   {  
      "_id":"RO",
      "u":5
   },
   {  
      "_id":"EG",
      "u":13
   },
   {  
      "_id":"TN",
      "u":5
   },
   {  
      "_id":"PT",
      "u":5
   },
   {  
      "_id":"MX",
      "u":16
   },
   {  
      "_id":"TW",
      "u":26
   },
   {  
      "_id":"MD",
      "u":1
   },
   {  
      "_id":"AT",
      "u":4
   },
   {  
      "_id":"BH",
      "u":1
   },
   {  
      "_id":"CI",
      "u":1
   },
   {  
      "_id":"CH",
      "u":13
   },
   {  
      "_id":"CZ",
      "u":6
   },
   {  
      "_id":"PH",
      "u":3
   },
   {  
      "_id":"CN",
      "u":174
   },
   {  
      "_id":"ES",
      "u":10
   },
   {  
      "_id":"UA",
      "u":12
   },
   {  
      "_id":"FI",
      "u":10
   },
   {  
      "_id":"PF",
      "u":1
   },
   {  
      "_id":"RU",
      "u":17
   },
   {  
      "_id":"ID",
      "u":15
   },
   {  
      "_id":"CO",
      "u":9
   },
   {  
      "_id":"TH",
      "u":4
   },
   {  
      "_id":"IL",
      "u":3
   },
   {  
      "_id":"VN",
      "u":9
   },
   {  
      "_id":"NO",
      "u":11
   },
   {  
      "_id":"KZ",
      "u":2
   },
   {  
      "_id":"IE",
      "u":5
   },
   {  
      "_id":"GR",
      "u":1
   },
   {  
      "_id":"NZ",
      "u":1
   },
   {  
      "_id":"BY",
      "u":1
   }
]
[  
   {  
      "_id":"users",
      "u":2024
   }
]

Query Params

api_key
string

API_KEY of user, with permission to access this app

app_id
string

ID of the app for which to query

metric
string

Metric for which to fetch current user data

callback
string

(optional) name of callback function for JSONP output

 

The data retrieved is current segmentation of users by provided metric. Mostly used to correct estimation, this api can also be used simply to get breakdown of current users by provided segment

Suggest Edits

/o/analytics/dashboard

Retrieve analytics data for dashboard

 
gethttps://try.count.ly/o/analytics/dashboard?api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o/analytics/dashboard?app_id=app_id&api_key=api_key'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o/analytics/dashboard',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o/analytics/dashboard?app_id=app_id&api_key=api_key")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o/analytics/dashboard?app_id=app_id&api_key=api_key");

xhr.send(data);
import requests

url = "https://try.count.ly/o/analytics/dashboard"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "30days": {
    "dashboard": {
      "total_sessions": {
        "total": 10,
        "change": "NA",
        "trend": "u"
      },
      "total_users": {
        "total": 10,
        "change": "NA",
        "trend": "u",
        "is_estimate": true
      },
      "new_users": {
        "total": 10,
        "change": "NA",
        "trend": "u"
      },
      "total_time": {
        "total": "6.5 min",
        "change": "NA",
        "trend": "u"
      },
      "avg_time": {
        "total": "0.7 min",
        "change": "NA",
        "trend": "u"
      },
      "avg_requests": {
        "total": "5.3",
        "change": "NA",
        "trend": "u"
      }
    },
    "top": {
      "platforms": [
        {
          "name": "Android",
          "percent": 60
        },
        {
          "name": "iOS",
          "percent": 30
        },
        {
          "name": "Windows Phone",
          "percent": 10
        }
      ],
      "resolutions": [
        {
          "name": "360x640",
          "percent": 60
        },
        {
          "name": "480x800",
          "percent": 20
        },
        {
          "name": "640x1136",
          "percent": 20
        }
      ],
      "carriers": [
        {
          "name": "Rogers Wireless",
          "percent": 40
        },
        {
          "name": "Verizon",
          "percent": 40
        },
        {
          "name": "Cricket Communications",
          "percent": 20
        }
      ],
      "users": [
        {
          "name": "23 Feb",
          "percent": 50
        },
        {
          "name": "2 Feb",
          "percent": 25
        },
        {
          "name": "3 Feb",
          "percent": 25
        }
      ]
    },
    "period": "2 Feb - 3 Mar"
  },
  "7days": {
    "dashboard": {
      "total_sessions": {
        "total": 0,
        "change": "∞",
        "trend": "d"
      },
      "total_users": {
        "total": 0,
        "change": "∞",
        "trend": "d",
        "is_estimate": true
      },
      "new_users": {
        "total": 0,
        "change": "∞",
        "trend": "d"
      },
      "total_time": {
        "total": "0.0 min",
        "change": "∞",
        "trend": "d"
      },
      "avg_time": {
        "total": "0.0 min",
        "change": "∞",
        "trend": "d"
      },
      "avg_requests": {
        "total": "0.0",
        "change": "∞",
        "trend": "d"
      }
    },
    "top": {
      "platforms": [],
      "resolutions": [],
      "carriers": [],
      "users": []
    },
    "period": "25 Feb - 3 Mar"
  },
  "today": {
    "dashboard": {
      "total_sessions": {
        "total": 0,
        "change": "NA",
        "trend": "u"
      },
      "total_users": {
        "total": 0,
        "change": "NA",
        "trend": "u",
        "is_estimate": false
      },
      "new_users": {
        "total": 0,
        "change": "NA",
        "trend": "u"
      },
      "total_time": {
        "total": "0.0 min",
        "change": "NA",
        "trend": "u"
      },
      "avg_time": {
        "total": "0.0 min",
        "change": "NA",
        "trend": "u"
      },
      "avg_requests": {
        "total": "0.0",
        "change": "NA",
        "trend": "u"
      }
    },
    "top": {
      "platforms": [],
      "resolutions": [],
      "carriers": [],
      "users": []
    },
    "period": "00:00 - 10:24"
  }
}

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

Query Params

callback
string

(optional) name of callback function for JSONP output

 

Retrieves the pre processed data to display at countly dashboard.
It displays data in 3 ranges:
recent 30 days
recent 7 days
and today

Each time period provides dashboard data, some top metrics and period name

Dashboard data can contain total sessions, total users, new users, total time, average time and average request.
Each data contains:
total amount or sum of instances for this period,
change in percentage or NA if not available
trend, which can be u for up and d for down

Top contains some top metrics as platforms, resolutions, carriers and users with percentage amount

Suggest Edits

/o/analytics/countries

Retrieve analytics data about countries

 
gethttps://try.count.ly/o/analytics/countries?api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o/analytics/countries?app_id=app_id&api_key=api_key'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o/analytics/countries',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o/analytics/countries?app_id=app_id&api_key=api_key")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o/analytics/countries?app_id=app_id&api_key=api_key");

xhr.send(data);
import requests

url = "https://try.count.ly/o/analytics/countries"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "30days": [
    {
      "country": "Japan",
      "code": "jp",
      "t": 3,
      "u": 3,
      "n": 3
    },
    {
      "country": "United States",
      "code": "us",
      "t": 3,
      "u": 6,
      "n": 3
    },
    {
      "country": "United Kingdom",
      "code": "gb",
      "t": 2,
      "u": 4,
      "n": 2
    },
    {
      "country": "Unknown",
      "code": "unknown",
      "t": 1,
      "u": 1,
      "n": 1
    },
    {
      "country": "Germany",
      "code": "de",
      "t": 1,
      "u": 2,
      "n": 1
    }
  ],
  "7days": [],
  "today": []
}

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

Query Params

callback
string

(optional) name of callback function for JSONP output

 

Retrieves the pre processed data about countries.
And similar to dashboard data, country data is divided in same time periods: 30 days, 7 days and today
It provides country name and code and:
t - total amount of sessions
u - unique amount of sessions
n - new amount of sessions

Suggest Edits

/o/analytics/sessions

Retrieve session data for specified period

 
gethttps://try.count.ly/o/analytics/sessions?api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o/analytics/sessions?app_id=app_id&api_key=api_key'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o/analytics/sessions',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o/analytics/sessions?app_id=app_id&api_key=api_key")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o/analytics/sessions?app_id=app_id&api_key=api_key");

xhr.send(data);
import requests

url = "https://try.count.ly/o/analytics/sessions"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "_id": "2015-2-2",
    "t": 1,
    "n": 1,
    "u": 1,
    "d": 60,
    "e": 7
  },
  {
    "_id": "2015-2-3",
    "t": 1,
    "n": 1,
    "u": 1,
    "d": 30,
    "e": 3
  },
  {
    "_id": "2015-2-4",
    "t": 1,
    "n": 1,
    "u": 1,
    "d": 30,
    "e": 3
  },
  {
    "_id": "2015-2-5",
    "t": 1,
    "n": 1,
    "u": 1,
    "d": 30,
    "e": 3
  },
  {
    "_id": "2015-2-6",
    "t": 0,
    "n": 0,
    "u": 0,
    "d": 0,
    "e": 0
  },
  {
    "_id": "2015-2-7",
    "t": 0,
    "n": 0,
    "u": 0,
    "d": 0,
    "e": 0
  },
  {
    "_id": "2015-2-8",
    "t": 0,
    "n": 0,
    "u": 0,
    "d": 0,
    "e": 0
  },
  {
    "_id": "2015-2-9",
    "t": 0,
    "n": 0,
    "u": 0,
    "d": 0,
    "e": 0
  },
  {
    "_id": "2015-2-10",
    "t": 1,
    "n": 1,
    "u": 1,
    "d": 30,
    "e": 3
  },
  {
    "_id": "2015-2-11",
    "t": 0,
    "n": 0,
    "u": 0,
    "d": 0,
    "e": 0
  },
  {
    "_id": "2015-2-12",
    "t": 0,
    "n": 0,
    "u": 0,
    "d": 0,
    "e": 0
  },
  {
    "_id": "2015-2-13",
    "t": 1,
    "n": 1,
    "u": 1,
    "d": 30,
    "e": 5
  },
  {
    "_id": "2015-2-14",
    "t": 0,
    "n": 0,
    "u": 0,
    "d": 0,
    "e": 0
  },
  {
    "_id": "2015-2-15",
    "t": 0,
    "n": 0,
    "u": 0,
    "d": 0,
    "e": 0
  },
  {
    "_id": "2015-2-16",
    "t": 0,
    "n": 0,
    "u": 0,
    "d": 0,
    "e": 0
  },
  {
    "_id": "2015-2-17",
    "t": 1,
    "n": 1,
    "u": 1,
    "d": 30,
    "e": 6
  },
  {
    "_id": "2015-2-18",
    "t": 0,
    "n": 0,
    "u": 0,
    "d": 0,
    "e": 0
  },
  {
    "_id": "2015-2-19",
    "t": 0,
    "n": 0,
    "u": 0,
    "d": 0,
    "e": 0
  },
  {
    "_id": "2015-2-20",
    "t": 1,
    "n": 1,
    "u": 1,
    "d": 60,
    "e": 10
  },
  {
    "_id": "2015-2-21",
    "t": 0,
    "n": 0,
    "u": 0,
    "d": 0,
    "e": 0
  },
  {
    "_id": "2015-2-22",
    "t": 0,
    "n": 0,
    "u": 0,
    "d": 0,
    "e": 0
  },
  {
    "_id": "2015-2-23",
    "t": 2,
    "n": 2,
    "u": 2,
    "d": 90,
    "e": 13
  },
  {
    "_id": "2015-2-24",
    "t": 0,
    "n": 0,
    "u": 0,
    "d": 0,
    "e": 0
  },
  {
    "_id": "2015-2-25",
    "t": 0,
    "n": 0,
    "u": 0,
    "d": 0,
    "e": 0
  },
  {
    "_id": "2015-2-26",
    "t": 0,
    "n": 0,
    "u": 0,
    "d": 0,
    "e": 0
  },
  {
    "_id": "2015-2-27",
    "t": 0,
    "n": 0,
    "u": 0,
    "d": 0,
    "e": 0
  },
  {
    "_id": "2015-2-28",
    "t": 0,
    "n": 0,
    "u": 0,
    "d": 0,
    "e": 0
  },
  {
    "_id": "2015-3-1",
    "t": 0,
    "n": 0,
    "u": 0,
    "d": 0,
    "e": 0
  },
  {
    "_id": "2015-3-2",
    "t": 0,
    "n": 0,
    "u": 0,
    "d": 0,
    "e": 0
  },
  {
    "_id": "2015-3-3",
    "t": 0,
    "n": 0,
    "u": 0,
    "d": 0,
    "e": 0
  }
]

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

Query Params

period
string

For which time period to provide data, possible values (month, 60days, 30days, 7days, yesterday, hour or [startMiliseconds, endMiliseconds] as [1417730400000,1420149600000])

callback
string

(optional) name of callback function for JSONP output

 

Returns session related data as an array.
Each array item has following properties;

_id: Date in one of the following formats YYYY-M, YYYY-M-D, YYYY-M-D H:00

u: Total (unique) users

t: Total sessions

n: New users

d: Total session duration (in seconds)

e: Total write API requests received

Suggest Edits

/o/analytics/metric

Retrieve metric data for specified period

 
gethttps://try.count.ly/o/analytics/metric?api_key=api_key&app_id=app_id&metric=metric
curl --request GET \
  --url 'https://try.count.ly/o/analytics/metric?metric=metric&app_id=app_id&api_key=api_key'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o/analytics/metric',
  qs: 
   { metric: 'metric',
     app_id: 'app_id',
     api_key: 'api_key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o/analytics/metric?metric=metric&app_id=app_id&api_key=api_key")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o/analytics/metric?metric=metric&app_id=app_id&api_key=api_key");

xhr.send(data);
import requests

url = "https://try.count.ly/o/analytics/metric"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "_id": "Rogers Wireless",
    "t": 2,
    "n": 2,
    "u": 2
  },
  {
    "_id": "Verizon",
    "t": 2,
    "n": 2,
    "u": 4
  },
  {
    "_id": "Cricket Communications",
    "t": 1,
    "n": 1,
    "u": 1
  },
  {
    "_id": "Sprint",
    "t": 1,
    "n": 1,
    "u": 2
  },
  {
    "_id": "\tAt&t",
    "t": 1,
    "n": 1,
    "u": 2
  },
  {
    "_id": "Vodafone",
    "t": 1,
    "n": 1,
    "u": 2
  },
  {
    "_id": "Bell Canada",
    "t": 1,
    "n": 1,
    "u": 2
  },
  {
    "_id": "Tele2",
    "t": 1,
    "n": 1,
    "u": 2
  }
]

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

metric
string
required

Metric name available from o?method apis

Query Params

period
string

For which time period to provide data, possible values (month, 60days, 30days, 7days, yesterday, hour or [startMiliseconds, endMiliseconds] as [1417730400000,1420149600000])

callback
string

(optional) name of callback function for JSONP output

 

Returns metric related data as an array. Each array item has following properties:

_id: Group/segment. For example if you are fetching data for devices this will be the device name.

u: Total (unique) users

t: Total sessions

n: New users

Available metrics to query:

  • app_versions
  • carriers
  • countries
  • density
  • devices
  • langs
  • os
  • os_versions
  • resolutions
Suggest Edits

/o/analytics/tops

Retrieve up to top 3 values for specified period

 
gethttps://try.count.ly/o/analytics/tops?api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o/analytics/tops?app_id=app_id&api_key=api_key'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o/analytics/tops',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o/analytics/tops?app_id=app_id&api_key=api_key")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o/analytics/tops?app_id=app_id&api_key=api_key");

xhr.send(data);
import requests

url = "https://try.count.ly/o/analytics/tops"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "platforms": [
    {
      "name": "Android",
      "percent": 60
    },
    {
      "name": "iOS",
      "percent": 30
    },
    {
      "name": "Windows Phone",
      "percent": 10
    }
  ],
  "resolutions": [
    {
      "name": "360x640",
      "percent": 60
    },
    {
      "name": "480x800",
      "percent": 20
    },
    {
      "name": "640x1136",
      "percent": 20
    }
  ],
  "carriers": [
    {
      "name": "Rogers Wireless",
      "percent": 40
    },
    {
      "name": "Verizon",
      "percent": 40
    },
    {
      "name": "Cricket Communications",
      "percent": 20
    }
  ],
  "countries": [
    {
      "name": "JP",
      "percent": 37
    },
    {
      "name": "US",
      "percent": 37
    },
    {
      "name": "GB",
      "percent": 26
    }
  ]
}

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

Query Params

period
string

For which time period to provide data, possible values (month, 60days, 30days, 7days, yesterday, hour or [startMiliseconds, endMiliseconds] as [1417730400000,1420149600000])

callback
string

(optional) name of callback function for JSONP output

 

Retrieves up to 3 top values with percentages for platforms, resolutions, carries and countries

Suggest Edits

/o/analytics/loyalty

Retrieves loyalty data for specified period

 
gethttps://try.count.ly/o/analytics/loyalty?api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o/analytics/loyalty?app_id=app_id&api_key=api_key'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o/analytics/loyalty',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o/analytics/loyalty?app_id=app_id&api_key=api_key")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o/analytics/loyalty?app_id=app_id&api_key=api_key");

xhr.send(data);
import requests

url = "https://try.count.ly/o/analytics/loyalty"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "l": "0",
    "t": 1148,
    "percent": "95.2"
  },
  {
    "l": "1",
    "t": 26,
    "percent": "2.2"
  },
  {
    "l": "2",
    "t": 16,
    "percent": "1.3"
  },
  {
    "l": "3",
    "t": 7,
    "percent": "0.6"
  },
  {
    "l": "4",
    "t": 6,
    "percent": "0.5"
  },
  {
    "l": "5",
    "t": 2,
    "percent": "0.2"
  },
  {
    "l": "6",
    "t": 1,
    "percent": "0.1"
  }
]

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

Query Params

period
string

For which time period to provide data, possible values (month, 60days, 30days, 7days, yesterday, hour or [startMiliseconds, endMiliseconds] as [1417730400000,1420149600000])

callback
string

(optional) name of callback function for JSONP output

 

Retrieves loyalty data, where

  • l - loyalty bucket id
  • t - amount of users in bucket for that period
  • percent - percentage of users in bucket for that period

Loyalty buckets are:

  • "1"
  • "2"
  • "3-5"
  • "6-9"
  • "10-19"
  • "20-49"
  • "50-99"
  • "100-499"
  • "> 500"
Suggest Edits

/o/analytics/frequency

Retrieves frequency data for specified period

 
gethttps://try.count.ly/o/analytics/frequency?api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o/analytics/frequency?app_id=app_id&api_key=api_key'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o/analytics/frequency',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o/analytics/frequency?app_id=app_id&api_key=api_key")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o/analytics/frequency?app_id=app_id&api_key=api_key");

xhr.send(data);
import requests

url = "https://try.count.ly/o/analytics/frequency"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "f": "0",
    "t": 1148,
    "percent": "95.2"
  },
  {
    "f": "11",
    "t": 20,
    "percent": "1.7"
  },
  {
    "f": "10",
    "t": 13,
    "percent": "1.1"
  },
  {
    "f": "2",
    "t": 8,
    "percent": "0.7"
  },
  {
    "f": "8",
    "t": 3,
    "percent": "0.2"
  },
  {
    "f": "6",
    "t": 3,
    "percent": "0.2"
  },
  {
    "f": "5",
    "t": 3,
    "percent": "0.2"
  },
  {
    "f": "4",
    "t": 3,
    "percent": "0.2"
  },
  {
    "f": "3",
    "t": 2,
    "percent": "0.2"
  },
  {
    "f": "7",
    "t": 2,
    "percent": "0.2"
  },
  {
    "f": "1",
    "t": 1,
    "percent": "0.1"
  }
]

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

Query Params

period
string

For which time period to provide data, possible values (month, 60days, 30days, 7days, yesterday, hour or [startMiliseconds, endMiliseconds] as [1417730400000,1420149600000])

callback
string

(optional) name of callback function for JSONP output

 

Retrieves frequency data, where

  • f - frequency bucket id
  • t - amount of users in bucket for that period
  • percent - percentage of users in bucket for that period

Frequency buckets are:

  • "1-24 hours"
  • "1 day"
  • "2 days"
  • "3 days"
  • "4 days"
  • "5 days"
  • "6 days"
  • "7 days"
  • "8-14 days"
  • "15-30 days"
  • "30+ days"
Suggest Edits

/o/analytics/durations

Retrieves durations data for specified period

 
gethttps://try.count.ly/o/analytics/durations?api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o/analytics/durations?app_id=app_id&api_key=api_key'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o/analytics/durations',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o/analytics/durations?app_id=app_id&api_key=api_key")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o/analytics/durations?app_id=app_id&api_key=api_key");

xhr.send(data);
import requests

url = "https://try.count.ly/o/analytics/durations"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "ds": "0",
    "t": 602,
    "percent": "39.2"
  },
  {
    "ds": "3",
    "t": 226,
    "percent": "14.7"
  },
  {
    "ds": "1",
    "t": 205,
    "percent": "13.3"
  },
  {
    "ds": "4",
    "t": 174,
    "percent": "11.3"
  },
  {
    "ds": "2",
    "t": 126,
    "percent": "8.2"
  },
  {
    "ds": "5",
    "t": 92,
    "percent": "6.0"
  },
  {
    "ds": "7",
    "t": 85,
    "percent": "5.5"
  },
  {
    "ds": "6",
    "t": 26,
    "percent": "1.7"
  }
]

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

Query Params

period
string

For which time period to provide data, possible values (month, 60days, 30days, 7days, yesterday, hour or [startMiliseconds, endMiliseconds] as [1417730400000,1420149600000])

callback
string

(optional) name of callback function for JSONP output

 

Retrieves durations data, where

  • ds - durations bucket id
  • t - amount of users in bucket for that period
  • percent - percentage of users in bucket for that period

Durations buckets are:

  • "0-10 seconds"
  • "11-30 seconds"
  • "31-60 seconds"
  • "1-3 minutes"
  • "3-10 minutes"
  • "10-30 minutes"
  • "30-60 minutes"
  • "> 1 hours"
Suggest Edits

/o/ping

Server health check

 
gethttps://try.count.ly/o/ping
curl --request GET \
  --url https://try.count.ly/o/ping
var request = require("request");

var options = { method: 'GET', url: 'https://try.count.ly/o/ping' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o/ping")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o/ping");

xhr.send(data);
import requests

url = "https://try.count.ly/o/ping"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{"result":"Success"}
{"result":"DB Error"}
 

This api allows to check if Countly server is running and has connection to the database

Suggest Edits

/i/users/create

Create new user

 
gethttps://try.count.ly/i/users/create?api_key=api_key&args=args
curl --request GET \
  --url 'https://try.count.ly/i/users/create?args=args&api_key=api_key'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/i/users/create',
  qs: 
   { args: 'args',
     api_key: 'api_key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/i/users/create?args=args&api_key=api_key")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/i/users/create?args=args&api_key=api_key");

xhr.send(data);
import requests

url = "https://try.count.ly/i/users/create"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "full_name":"Test User",
  "username":"test",
  "email":"test@domain.com",
  "created_at":1412158042,
  "_id":"542bd25ab3bced1a67000005",
  "api_key":"f9d9ad2d9ebf5c0b9144e1740ca8f769"
}

Path Params

api_key
string
required

Admin API_KEY

args
string
required

JSON object as string with user data.

Query Params

callback
string

(optional) name of callback function for JSONP output

 

Creates new users from values provided in args parameter as stringified JSON

The value that can be included in args are:

'full_name': { 'required': true, 'type': 'String' },// name of the user

'username': { 'required': true, 'type': 'String' },// username of the user

'password': { 'required': true, 'type': 'String' }, //user's password

'email': { 'required': true, 'type': 'String' },// user's email

'admin_of': { 'required': false, 'type': 'Array' },// list of apps which user will be admin of

'user_of': { 'required': false, 'type': 'Array' }, //list of apps which user will be user of

'global_admin': { 'required': false, 'type': 'Boolean' }// is user a global admin

Suggest Edits

/i/users/update

Update user

 
gethttps://try.count.ly/i/users/update?api_key=api_key&args=args
curl --request GET \
  --url 'https://try.count.ly/i/users/update?args=args&api_key=api_key'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/i/users/update',
  qs: 
   { args: 'args',
     api_key: 'api_key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/i/users/update?args=args&api_key=api_key")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/i/users/update?args=args&api_key=api_key");

xhr.send(data);
import requests

url = "https://try.count.ly/i/users/update"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{"result":"Success"}

Path Params

api_key
string
required

Admin API_KEY

args
string
required

JSON object as string with user data.

Query Params

callback
string

(optional) name of callback function for JSONP output

 

Update user's information from values provided in args parameter as stringified JSON

The value that can be included in args are:

'user_id': { 'required': true, 'type': 'String' }, //ID of user to update

'full_name': { 'required': false, 'type': 'String' }, //new full name

'username': { 'required': false, 'type': 'String' }, //new username

'password': { 'required': false, 'type': 'String' }, //new password

'email': { 'required': false, 'type': 'String' }, //new email

'admin_of': { 'required': false, 'type': 'Array' }, //list of apps to make admin of

'user_of': { 'required': false, 'type': 'Array' }, //list of apps is user of

'global_admin': { 'required': false, 'type': 'Boolean' }, //should be global admin

'send_notification': { 'required': false, 'type': 'Boolean' } //send email notification about changes

Suggest Edits

/i/users/delete

Delete users

 
gethttps://try.count.ly/i/users/delete?api_key=api_key&args=args
curl --request GET \
  --url 'https://try.count.ly/i/users/delete?args=args&api_key=api_key'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/i/users/delete',
  qs: 
   { args: 'args',
     api_key: 'api_key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/i/users/delete?args=args&api_key=api_key")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/i/users/delete?args=args&api_key=api_key");

xhr.send(data);
import requests

url = "https://try.count.ly/i/users/delete"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{"result":"Success"}

Path Params

api_key
string
required

Admin API_KEY

args
string
required

JSON object as string with list of user ids to delete.

Query Params

callback
string

(optional) name of callback function for JSONP output

 

Delete users with provided user ids from args parameter's user_ids list property. args parameter should be passed as stringified JSON

Example args content:
{user_ids:["542bd25ab3bced1a67000005", "542bd25ab3bced1a67000006", "542bd25ab3bced1a67000007"]}

Suggest Edits

/i/apps/create

Create new app

 
gethttps://try.count.ly/i/apps/create?api_key=api_key&args=args
curl --request GET \
  --url 'https://try.count.ly/i/apps/create?args=args&api_key=api_key'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/i/apps/create',
  qs: 
   { args: 'args',
     api_key: 'api_key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/i/apps/create?args=args&api_key=api_key")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/i/apps/create?args=args&api_key=api_key");

xhr.send(data);
import requests

url = "https://try.count.ly/i/apps/create"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "name":"Test App",
  "country":"TR",
  "timezone":"Europe/Istanbul",
  "category":"6",
  "_id":"542bd7c2b3bced1a67000006",
  "key":"4170b44d6459bba992acaa857ac5b25d7fac6cc1"
}

Path Params

api_key
string
required

Admin API_KEY

args
string
required

JSON object as string with app data.

Query Params

callback
string

(optional) name of callback function for JSONP output

 

Creates new app from values provided in args parameter as stringified JSON

args can contain this properties:

'name': { 'required': true, 'type': 'String' }, //name of the app

'country': { 'required': false, 'type': 'String' }, //your country

'type': { 'required': false, 'type': 'String' }, // type of the app, mobile, web, et

'category': { 'required': false, 'type': 'String' },// ID of app category

'timezone': { 'required': false, 'type': 'String' }// timezone in which to display statistics

Example request could look like

/i/apps/create?api_key=your-api-key&args={"name":"Test App","type":"mobile"}

Suggest Edits

/i/apps/update

Update app information

 
gethttps://try.count.ly/i/apps/update?api_key=api_key&args=args
curl --request GET \
  --url 'https://try.count.ly/i/apps/update?args=args&api_key=api_key'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/i/apps/update',
  qs: 
   { args: 'args',
     api_key: 'api_key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/i/apps/update?args=args&api_key=api_key")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/i/apps/update?args=args&api_key=api_key");

xhr.send(data);
import requests

url = "https://try.count.ly/i/apps/update"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "name":"Test",
  "country":"TR",
  "timezone":"Europe/Istanbul",
  "category":"6"
}

Path Params

api_key
string
required

Admin API_KEY

args
string
required

JSON object as string with user data.

Query Params

callback
string

(optional) name of callback function for JSONP output

 

Update app information from values provided in args parameter as stringified JSON

args can contain this properties:

'app_id': { 'required': true, 'type': 'String'}, //ID of the app to change information

'name': { 'required': false, 'type': 'String' },// new app name

'category': { 'required': false, 'type': 'String' },// new app category ID

'timezone': { 'required': false, 'type': 'String' },//new timezone

'country': { 'required': false, 'type': 'String' } //new app country

Suggest Edits

/i/apps/reset

Reset all app data and events

 
gethttps://try.count.ly/i/apps/reset?api_key=api_key&args=args
http://try.count.ly/i/apps/reset?args={"app_id":"582b5315efe8d0485fe121de","period":"all"}&api_key=1232
A binary file was returned

You couldn't be authenticated

{"result":"Success"}

Query Params

api_key
string

Admin API_KEY

args
string

JSON object as string with data as app_id and period for which to delete data

callback
string

(optional) name of callback function for JSONP output

 

Reset all app data (sessions, events, metrics, etc) with provided app id from args parameter's app_id property. Parameter period controls which data will be deleter.
args parameter should be passed as stringified JSON

Example args content: {"app_id":"542bad58b3bced1a67000003", "period":"all"}

If period parameter is all, then data for all periods will be deleted.
If period parameter is reset, then not only all data will be deleted, but also all app configuration will be reset. Like deletes all created campaigns, bookmarked drill queries, etc.

Other period parameter values indicate the period for which app data should be preserved and older data deleted:

  • 1month - delete data older than 1 month
  • 3month - delete data older than 3 month
  • 6month - delete data older thanb6 month
  • 1year - delete data older than 1 year
  • 2year -delete data older than 2 years
Suggest Edits

/i/apps/delete

Delete app

 
gethttps://try.count.ly/i/apps/delete?api_key=api_key&args=args
curl --request GET \
  --url 'https://try.count.ly/i/apps/delete?args=args&api_key=api_key'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/i/apps/delete',
  qs: 
   { args: 'args',
     api_key: 'api_key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/i/apps/delete?args=args&api_key=api_key")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/i/apps/delete?args=args&api_key=api_key");

xhr.send(data);
import requests

url = "https://try.count.ly/i/apps/delete"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{"result":"Success"}

Path Params

api_key
string
required

Admin API_KEY

args
string
required

JSON object as string with user data.

 

Delete app with provided app id from args parameter's app_id property. args parameter should be passed as stringified JSON

Example args content: {app_id:"542bad58b3bced1a67000003"}

Suggest Edits

/i

Writing sessions, metrics and events

 
gethttps://try.count.ly/i?app_key=app_key&device_id=device_id
curl --request GET \
  --url 'https://try.count.ly/i?device_id=device_id&app_key=app_key'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/i',
  qs: { device_id: 'device_id', app_key: 'app_key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/i?device_id=device_id&app_key=app_key")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/i?device_id=device_id&app_key=app_key");

xhr.send(data);
import requests

url = "https://try.count.ly/i"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{"result":"Success"}

Query Params

app_key
string

APP_KEY of an app for which to report

device_id
string

Your generated or device specific unique device ID to identify user

begin_session
int32

(optional) Should provide value 1 to indicate session start

session_duration
int32

(optional) provides session duration in seconds, can be used as heartbeat to update current sessions duration, recommended time every 60 seconds

end_session
int32

(optional) Should provide value 1 to indicate session end

ip_address
string

(optional, can only be used with begin_session) IP address of user to determine user location, if not provided, countly will try to establish ip address based on connection data

timestamp
int32

(optional) 10 digit UTC timestamp for recording past data.

hour
string

(optional) current user local hour (0 - 23)

dow
string

(optional) day of the week (0-sunday, 1 - monday, ... 6 - saturday)

metrics
string

(optional, can only be used with begin_session) JSON object as string to provide metrics to track with the user

events
string

(optional) JSON array as string containing event objects

user_details
string

(optional) JSON object as string containing information about users

country_code
string

(optional) ISO Country code for the user's country

city
string

(optional) Name of the user's city

location
string

(optional) users lat,lng

old_device_id
string

(optional) provide when changing device ID, so server would merge the data

 

This is main path where to submit session data, metrics and events.

If you want to develop SDK for Countly, you would need to implement calls that you need in your SDK to Countly REST API from this page.

Each session should start with begin_session=1, then it should be extended with session_duration=seconds, to indicate the duration of the session. Session duration should not exceed time period specified in /api/config.js as session_duration_limit which by default is 120 seconds.
So you need to update session at least once in this period, to collect correct session duration information. The recommended period is every 60 seconds.
When user exists app or ends session, you can provided end_session=1 to indicate that this session ended for user.

Mandatory Parameters

Parameters listed below are mandatory for every write API request.

app_key

Application key for the current application. Can be obtained from your dashboard after creating your application.

device_id

Unique id for the user device. You can retrieve device specific ID or generate any unique ID you can using libraries like Open UDID

Optional Parameters

Session

begin_session

Indicates the start of the user session. begin_session should be used with the API call you make at the beginning of user's session. begin_session should be given the value 1.

end_session

Indicates the end of the user session. end_session should be used with the API call you make at the end of user's session. end_session should be given the value 1.

session_duration

Heartbeat like parameter for extending session duration of the user for session_duration seconds.

Metrics

JSON object containing key, value pairs. metrics can only be sent together with begin_session.

Currently below predefined metrics are valid;

 metrics={
      "_os": "Android",
      "_os_version": "4.1",
      "_device": "Samsung Galaxy",
      "_resolution": "1200x800",
      "_carrier": "Vodafone",
      "_app_version": "1.2",
      "_density": "MDPI",
   		"_locale": "en_US",
      "_store": "com.android.vending"
  }

Events

JSON array containing event objects. Each event object can have below properties;

  • key (Mandatory, String)
  • count (Mandatory, Integer)
  • sum (Optional, Double)
  • dur (Optional, Double)
  • segmentation (Optional, Dictionary Object)
  • timestamp (Optional)
  • hour (Optional)
  • dow (Optional)
    A sample event array will look like this;
 [
          {
              "key": "level_success",
              "count": 4
          },
          {
              "key": "level_fail",
              "count": 2
          },
          {
              "key": "in_app_purchase",
              "count": 3,
              "sum": 2.97,
              "dur": 1000,
              "segmentation": {
                  "app_version": "1.0",
                  "country": "Germany"
              }
          }
]

Ater this request we will be able to;

See how many times user completed a level successfully or failed.
See how many times in app purchase occurred and the total amount of these IAPs.
Segment IAP data into two levels, one is app_version and the other is country. So we will be able to identify which application version performed best in terms of IAP and which countries tend to do IAP more.

User details

JSON object containing key, value pairs.

All values are optional and currently you can pass this information about user:

user_details={
    "name": "Arturs Sosins",
    "username": "ar2rsawseen",
    "email": "test@test.com",
    "organization": "Countly",
    "phone": "+37112345678",
    //Web URL to picture
    "picture": "https://pbs.twimg.com/profile_images/1442562237/012_n_400x400.jpg", 
    "gender": "M",
  	"byear": 1987, //birth year
  	"custom":{
      "key1":"value1",
      "key2":"value2",
      ...
    }
  }

If you set value as null, you will delete the property.

Additionally you can upload picture of the user to the server by sending POST request to the same URL you would provide user information to.

If you don't have any user information to provide, you can simply upload profile picture to
"/i?app_key=APP_KEY&device_id=DEVICE_ID&user_details"

Accepted picture formats are .png, .gif and .jpeg and picture will be resized to maximal 150x150 dimensions.

Modifying custom user data

You can provide custom properties for user using custom key and providing JSON object with key and values to store for this user.

Note: dots (.) and dollar signs ($) in key names will be stripped out.

Also you can modify custom properties, like increment value stored on server by 1, or store array of values (including unique only values) under same key.

Here are example of possible modifications:

user_details={
  	"custom":{
      //simply set key value
      "key":"value",
      //increment value on server by 2
      "key2":{"$inc":2},
      //multiply value on server by 2
      "key3":{"$mul":2},
      //store maximal value between provided and server value
      "key4":{"$max":10},
      //store minimal value between provided and server value
      "key5":{"$min":10},
      //store value if it does not exist on server yet
      "key6":{"$setOnce":"initial value"},
      //add one value to array
      "key7":{"$push":"value"},
      //add multiple values to array
      "key8":{"$push":["value1","value2"]},
      //add value to array, if it is already in array, it won't add it
      "key9":{"$addToSet":"value"},
      //add values to array, if values is already in array, it won't add them
      "key10":{"$addToSet":["value1","value2"]},
      //remove one value from array
      "key11":{"$pull":"value"},
      //remove multiple values from array
      "key12":{"$pull":["value1","value2"]},
      ...
    }
  }

List of possible commands:

  • $inc - to increment value on server by provided value (if no value on server, assumes it is 0)
  • $mul - to multiply value on server by provided value (if no value on server, assumes it is 0)
  • $max - to store maximal value from the one on server and provided value (if no value on server, uses provided value)
  • $min - to store minimal value from the one on server and provided value (if no value on server, uses provided value)
  • $setOnce - set's value to key, only if property was not defined before for this user
  • $push - add one or many values to array property (can have multiple same values, if property is not array, converts it to array)
  • $addToSet - add one or many values to array property (will only store unique values in array, if property is not array, converts it to array)
  • $pull - remove one or many values from array property (only removes value from array properties)

Change ID and merge data

old_device_id

If for some reason you want to change device_id that was provided to Countly for specific user, you can use new device id as device_ID parameter and specify old device ID as old_device_id parameter. That way Countly will switch the device ID used for this user from old one to new one transferring all data to it. If user with new device ID already existing, then their data will be merged together into single user.

device_id=myNewId&old_device_id=myOldId

Additional parameters

timestamp

10 digit UTC timestamp for recording past data.

hour

Current user local hour (0 - 23)

dow

Currenr user day of the week (0-sunday, 1 - monday, ... 6 - saturday)

ip_address

IP address of the user. By default IP address of the user is detected from the connection but you can send it manually using this parameter. ip_address parameter can only be used with the begin_session request.

country_code and city

Additionally to passing the IP address from which location can be determined, it is also possible to directly provide user's country and city. For country you only need to provide ISO standard two letter country code. For city you may provide city name as string value

location

If you can provide user's location coordinates, you can do that though this parameter, passing value as location=lat,lng

For example, location=56.42345,123.45325

Push notifications

To specify that device is capable of receiving push notifications, you need to provide a token to Countly server by adding this parameters to your request

token_session=1 saying that you will provide token in this request

test_mode=0 saying this is not a test request

{platform}_token = {your token here} - providing push notification token for your device's platform

token_session=1&test_mode=0&android_token=12345678

To notify Countly that user received push notification send an [CLY]_push_open event with i segment and value of message ID. In similar manner you can notify Countly server when push notification was opened or an action was performed using [CLY]_push_action and [CLY]_push_sent events with same i segment and message ID value

events=[
          {
              "key": "[CLY]_push_open",
              "count": 1,
              "segmentation": {
                  "i": "123456789012345678901234"
              }
          },
          {
              "key": "[CLY]_push_action",
              "count": 1,
              "segmentation": {
                  "i": "123456789012345678901234"
              }
          },
  				{
              "key": "[CLY]_push_sent",
              "count": 1,
              "segmentation": {
                  "i": "123456789012345678901234"
              }
          }
]

Crash Analytics

crash - JSON object containing key, value pairs.

All values except _os, _app_version and _error are optional, but more information you provide, more information you will have when resolving crashes

Currently supported fields are:

crash={
	//device metrics
	"_os":"Android",
	"_os_version":"4.1",
	"_manufacture":"Samsung", //may not be provided for ios or be constant, like Apple
	"_device": "Galaxy S4", //model for Android, iPhone1,1 etc for iOS
	"_resolution": "1900x1080",
	"_app_version":"2.1",
	"_cpu": "armv7", //type of cpu used on device (for ios will be based on device)
	"_opengl":"2.1", //version of open gl supported

	//state of device
	"_ram_current":1024, //in megabytes
	"_ram_total":4096,
	"_disk_current":3000, //in megabytes
	"_disk_total":10240,
  "_bat":99, //battery level from 0 to 100
	//or provide "_bat_current" and "_bat_total" if other scale
	"_orientation":"portrait", //in which device was held, landscape, portrait, etc

	//bools
	"_root":false, //true if device is rooted/jailbroken, false or not provided if not
	"_online":true, //true if device is connected to the internet (WiFi or 3G), false or 	not provided if not connected
	"_muted":false, //true if volume is off, device is in muted state
	"_background":false, //true if app was in background when it crashed

	//error info
	"_name":"Null Pointer exception", //optional if provided by OS/Platform, else will use first line of 		stack
	"_error":"Some error stack here", //error stack, can provide multiple separated by blank new line
	"_nonfatal":false, //true if handled exception, false or not provided if unhandled crash
	"_logs":"logs provided here",//some additional logs provided, if any 
	"_run":180, //running time since app start in seconds

	//custom key/values provided by developers
	"_custom":{
  	"facebook_sdk": "3.5",
  	"admob": "6.5"
	}
}

You can provide custom properties for crash using custom key and providing JSON object with key and values to store for this crash report and server will segment values for you for the same crash.

Views

You can report what views did user view and for how long. This is done by adding event with key [CLY]_view and event dur property for duration, and providing additional values as event segments, as:

  • name - name of the view
  • visit - 1 or true to count a visit to this view
  • segment - single segment option (platform for mobile apps, domain for websites)
  • start - 1 or true if user started session with this view

The usual flow is to create event when user visits view, and report duration when user exits it.

Here is the example for scenario, where user starts app with view1, views it for 60 seconds and moves to view2, views it for 30 seconds and exists app.

events=[
          {
              "key": "[CLY]_view",
              "count": 1,
              "segmentation": {
                  "name": "view1",
                  "segment": "Android",
                  "visit": 1,
                  "start": 1
              }
          }
]
events=[
					//firstly report previous view duration
          {
              "key": "[CLY]_view",
              "count": 1,
              "dur": 60,
              "segmentation": {
                  "name": "view1",
                  "segment": "Android"
              }
          },
          //then report new view
          {
              "key": "[CLY]_view",
              "count": 1,
              "segmentation": {
                  "name": "view2",
                  "segment": "Android",
                  "visit": 1
              }
          }
]
events=[
					//report last view duration on exit
          {
              "key": "[CLY]_view",
              "count": 1,
              "dur": 30,
              "segmentation": {
                  "name": "view2",
                  "segment": "Android"
              }
          }
]

View actions

Additionally it is possible to report actions taken on views to display on heat maps. For that you need to create [CLY]_action event with segment properties as:

  • type - action type, as click, touch, longpress,etc
  • x - x coordinate of action
  • y - y coordinate of action
  • width - width of the screen
  • height - height of the screen

As example:

events=[
          {
              "key": "[CLY]_action",
              "count": 1,
              "segmentation": {
                  "type": "click",
                  "x": 120,
                  "y": 200,
                  "width": 1920,
                	"height": 1200
              }
          }
]

Star Rating

SDK can provide a dialog for user to rate the app. To store this rating on server you need to submit custom event with key "[CLY]_star_rating" with these segments:

  • platform - platform on which application runs
  • app_version - application's version number
  • rating - user's 1-to-5 rating

Star rating plugin should be enabled on server for this data to be properly recorded

Attribution

There is a way you can attribute a click from campaign to an install through API. Usually it is used to import attribution from third party sites as a postback to Count.ly server. You at least need to provide campaign ID (the last part of your campaign url).

If possible, provide also Countly generated user ID (which is usually passed to campaigns url too),mostly for the situations where you can pass data to app install like Google Play INSTALL_REFERRER.

You can provide any number of other conversion segments and their values, they all need to be prefixed by campaign_

To sum it up:

campaign_id

ID of the campaign you created in Countly

campaign_user

Countly generated user ID based on digital fingerprint of the user, that you can pass with the link to install if platform supports it

campaign_{param}

Any other parameters/segments that you want to pa with this conversion

Suggest Edits

/i/bulk

Bulk session, metric, event data writing

 
posthttps://try.count.ly/i/bulk?app_key=app_key
curl --request POST \
  --url 'https://try.count.ly/i/bulk?app_key=app_key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://try.count.ly/i/bulk',
  qs: { app_key: 'app_key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/i/bulk?app_key=app_key")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://try.count.ly/i/bulk?app_key=app_key");

xhr.send(data);
import requests

url = "https://try.count.ly/i/bulk"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{"result":"Success"}

Path Params

app_key
string
required

(optional) global app_key, you can also provide separate app_key for each request in it's object

Form Data

requests
string

JSON Array as string with request objects that you would usually pass to /i api path

 

Bulk method limitations

Countly v16.02 had issues with parallelization. Basically there is no guarantee that bulk requests will be executed in the order you provided them, they also can be executed simultaneously.

If order of execution does not matter (as events, crashes, user info), you can use bulk API. But if order of execution matters, like in sessions, then results may be inconsistent with what you would receive if you execute all requests separately.

This has been since fixed in Countly v16.06

Basically instead of sending separate requests to /i with session data, metrics and events, you can combine them in one single HTTP request (for example when sending older data with timestamp, while user did not have Internet connection)

For that you would need to convert normal /i request parameters into JSON object, so for example, sending bulk data which combine 4 normal requests:

1) to start session with metrics

2) to update session duration

3) to send an event

4) to end session

[
  {
    "device_id":"1234567890", 
    "app_key":"9a4d196c01d3ca82876c0398ab774e5e", 
    "begin_session":1, 
    "metrics":
    {
      "_os": "IOS",
      "_os_version": "7.1",
      "_resolution": "2048x1536", 
      "_density": "200dpi", 
      "_device": "iPod",
      "_carrier": "Telecom",
      "_app_version": "1.2"
    }
  },
  {
    "device_id":"1234567890", 
    "app_key":"9a4d196c01d3ca82876c0398ab774e5e", 
    "session_duration":30
  },
  {
    "device_id":"1234567890", 
    "app_key":"9a4d196c01d3ca82876c0398ab774e5e", 
    "events":
    [
      {
        "key": "test2", 
        "count": 2, 
        "sum":1.50, 
        "segmentation": 
        {
          "country": "Latvia",
          "market": "googleplay"
        }
      }
    ]
  },
  {
    "device_id":"1234567890", 
    "app_key":"9a4d196c01d3ca82876c0398ab774e5e", 
    "end_session":1
  }
];

Also, it's possible to combine the 'start_session', 'metrics', 'session_duration', 'events' and 'end_session' together into one JSON block, with the appropriate device_id and api_key. You only need to make sure that the order is correct.

Here's an example:

var params = [
{"device_id":DEVICE_ID, "app_key":APP_KEY, "begin_session":1, "metrics":{"os": "Android"}},
{"device_id":DEVICE_ID, "app_key":APP_KEY, "session_duration":30},
{"device_id":DEVICEID+"A", "app_key":APP_KEY, "end_session":1}
];
Suggest Edits

/o?method=live

Get online user data (available in live plugin)

 
gethttps://try.count.ly/o?method=live&api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o?app_id=app_id&api_key=api_key&method=live'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key',
     method: 'live' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o?app_id=app_id&api_key=api_key&method=live")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o?app_id=app_id&api_key=api_key&method=live");

xhr.send(data);
import requests

url = "https://try.count.ly/o"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{"o":13,"n":12,"mo":13,"mn":12}

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

Query Params

callback
string

(optional) name of callback function for JSONP output

 

Retrieves information about users currently online and new users online, and maximal amounts of users that was online.

o - online users

n - new users online

mo - maximal users online

mn - maximal new users online

Suggest Edits

/o?method=live_graph

Get online user data fro graph (available in live plugin)

 
gethttps://try.count.ly/o?method=live_graph&api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o?app_id=app_id&api_key=api_key&method=live_graph'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key',
     method: 'live_graph' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o?app_id=app_id&api_key=api_key&method=live_graph")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o?app_id=app_id&api_key=api_key&method=live_graph");

xhr.send(data);
import requests

url = "https://try.count.ly/o"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":0,"n":0},{"o":2,"n":1},{"o":3,"n":3},{"o":11,"n":9},{"o":10,"n":10},{"o":0,"n":0}]

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

Query Params

callback
string

(optional) name of callback function for JSONP output

 

Retrieve array of users online and new users online for the last 10 minutes with a span of 10 seconds

Online user graph example

Online user graph example

Suggest Edits

/o?method=retention

Get retention data (available in retention plugin)

 
gethttps://try.count.ly/o?method=retention&api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o?app_id=app_id&api_key=api_key&method=retention'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key',
     method: 'retention' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o?app_id=app_id&api_key=api_key&method=retention")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o?app_id=app_id&api_key=api_key&method=retention");

xhr.send(data);
import requests

url = "https://try.count.ly/o"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "1": 2,
    "2": 2,
    "3": 1,
    "_id": "20150623",
    "tu": 7
  },
  {
    "1": 1,
    "2": 1,
    "_id": "20150624",
    "tu": 13
  },
  {
    "1": 2,
    "2": 2,
    "3": 1,
    "_id": "20150625",
    "tu": 26
  },
  {
    "1": 2,
    "_id": "20150626",
    "tu": 8
  }
]

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

Query Params

callback
string

(optional) name of callback function for JSONP output

period
string

period as daily, weekly or monthly

 

Retrieves user retention data.

  • _id - represents the date of data in "yyyymmdd" format
  • tu - total new users joined in that date
  • 1 - how many of joined users left on date +1 day
  • 2 - how many of joined users left on date +2 days
  • etc
Suggest Edits

/o?method=get_funnels

Get list of funnels (available in funnel plugin)

 
gethttps://try.count.ly/o?method=get_funnels&api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o?app_id=app_id&api_key=api_key&method=get_funnels'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key',
     method: 'get_funnels' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o?app_id=app_id&api_key=api_key&method=get_funnels")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o?app_id=app_id&api_key=api_key&method=get_funnels");

xhr.send(data);
import requests

url = "https://try.count.ly/o"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "_id":"9d6670f04d68f32fa8da0157c3043d03",
    "name":"Test Funnel",
    "steps":
    [
      "test1",
      "test2"
    ]
  },
  {
    "_id":"9d6670f04d68f32fa8da0157c3043d04",
    "name":"Test Funnel 2",
    "steps":
    [
      "test",
      "test1"
    ]
  },
]

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

Query Params

callback
string

(optional) name of callback function for JSONP output

 

Get list of funnels with funnel names, ids and steps of events needed for funnel

Suggest Edits

/o?method=funnel

Get user data of passing specific funnel (available in funnel plugin)

 
gethttps://try.count.ly/o?method=funnel&api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o?app_id=app_id&api_key=api_key&method=funnel'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key',
     method: 'funnel' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o?app_id=app_id&api_key=api_key&method=funnel")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o?app_id=app_id&api_key=api_key&method=funnel");

xhr.send(data);
import requests

url = "https://try.count.ly/o"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "steps":
  [
    {
      "step":"test1",
      "users":1,
      "times":11,
      "percent":100
    },
    {
      "step":"test2",
      "users":0,
      "times":0,
      "percent":0
    }
  ],
  "total_users":1,
  "success_users":0,
  "success_rate":0
}

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

Query Params

funnel
string

Funnel ID

period
string

Period for funnel data, possible values: month, day, yesterday, hour, 7days, 30days, 60days

callback
string

(optional) name of callback function for JSONP output

 

Retrieve information about how many users passed which steps of the specific funnel for specified period of time

Suggest Edits

/o?method=drill_bookmarks

Get bookmarked filter query from drill (available in drill plugin)

 
gethttps://try.count.ly/o?method=drill_bookmarks&api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o?app_id=app_id&api_key=api_key&method=drill_bookmarks'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key',
     method: 'drill_bookmarks' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o?app_id=app_id&api_key=api_key&method=drill_bookmarks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o?app_id=app_id&api_key=api_key&method=drill_bookmarks");

xhr.send(data);
import requests

url = "https://try.count.ly/o"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "_id":"8cd8feb0692c558cbedeb5572615009b",
    "app_id":"542c20cdd83506df6c000068",
    "event_app_id":"4c056cb1cd6ae9a996c5314d314d4211",
    "event_key":"test1",
    "query_obj":"{\"sg.country\":{\"$in\":[\"Turkey\"]}}",
    "query_text":"country = Turkey"
  }
]

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

Query Params

event_key
string

the name of event for which filter was created

callback
string

(optional) name of callback function for JSONP output

 

Retrieve bookmarked Countly Drill data query

Suggest Edits

/o?method=user_details

Get list of users (available in users plugin)

 
gethttps://try.count.ly/o?method=user_details&api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o?app_id=app_id&api_key=api_key&method=user_details'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key',
     method: 'user_details' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o?app_id=app_id&api_key=api_key&method=user_details")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o?app_id=app_id&api_key=api_key&method=user_details");

xhr.send(data);
import requests

url = "https://try.count.ly/o"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "iTotalRecords":100,
  "iTotalDisplayRecords":100,
  "aaData":[
   {
     "_id":"ec941f5016e2c863e3c403be0304a2c752284589",
     "hasInfo":true,
     "name":"Aaron Baker",
     "email":"so@fiv.gov",
     "sc":1,
     "ls":1416567197,
     "cc":"FR",
     "cty":"Saint-gildas-des-boi",
     "d":"Kindle Fire HDX",
     "sd":0,
     "tsd":210,
     "picture":"http://www.gravatar.com/avatar/ede9ee2e1b7171630cc0dc07f3d298f4?d=identicon&s=150"
   },{
     "_id":"58cff84f90f89c0ec42c37898c62c4a63679f61c",
     "hasInfo":true,
     "name":"Addie Underwood",
     "email":"wopilfov@hihfok.net",
     "sc":1,
     "ls":1416567195,
     "cc":"ES",
     "cty":"Unknown",
     "d":"Windows Phone",
     "sd":0,
     "tsd":30,
     "picture":"http://www.gravatar.com/avatar/93e22d0a6b1d30f47b43398ddeaa5c75?d=identicon&s=150"
   }
  ]
}

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

Query Params

iDisplayStart
int32

Offset from which to start displaying users

iDisplayLength
int32

How many users to display from offset

sSearch
string

Full word search on names of users or email addresses

filter
string

Filter users, possible values: user-all, user-known, user-anonymous

query
string

Json string encoded mongodb query

callback
string

(optional) name of callback function for JSONP output

 

This API allows to query information about app users. You can also paginate data using offset and length of results.

The fields that can be provided for each user are:

  • _id - ID of user
  • hasInfo - if there is any info about user
  • name - full name of the user
  • email - email address of the user
  • sc - session count
  • ls - timestamp last seen
  • cc - country code
  • cty - city
  • d - device
  • sd - duration of last session in seconds
  • tsd - total duration of all sessions in seconds
  • picture - link (internal or external) to the picture of user or avatar
Suggest Edits

/o?method=user_details&uid

Retrieves detailed information about specific user (available in users plugin)

 
gethttps://try.count.ly/o?method=user_details&uid=uid&api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o?app_id=app_id&api_key=api_key&uid=uid&method=user_details'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key',
     uid: 'uid',
     method: 'user_details' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o?app_id=app_id&api_key=api_key&uid=uid&method=user_details")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o?app_id=app_id&api_key=api_key&uid=uid&method=user_details");

xhr.send(data);
import requests

url = "https://try.count.ly/o"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "_id":"e9a698e0aebb4fc584a1ddf04ad480c95a768e3e",
  "hasInfo":true,
  "name":"Hester McKinney",
  "username":"pan",
  "email":"lezuwor@bu.gov",
  "organization":"Aptijaz",
  "phone":"(617) 788-8341",
  "gender":"M",
  "byear":1984,
  "sc":3,
  "fs":1416568278,
  "ls":1416568859,
  "did":"fa9a96cd-b2b7-2891-3902-56c459ba73d7",
  "cc":"TW",
  "cty":"Unknown",
  "c":"Rogers Wireless",
  "d":"Optimus L5",
  "av":"3:2",
  "p":"Android",
  "pv":"a7:1",
  "r":"320x480",
  "dnst":"240dpi",
  "uid":"7",
  "lsid":"546f1ddbcf9ba9b12d009f24",
  "sd":0,
  "tsd":210,
  "lest":1416568348,
  "picture":"http://www.gravatar.com/avatar/92a5fd55a5e69a7647bc399ddc477d8a?d=identicon&s=150",
  "sessions":[
    {
      "_id":"546f1ddbcf9ba9b12d009f24",
      "ts":1416568278000,
      "sd":210,
      "nts":""
    }
  ],
  "tpa":0,
  "tpc":0,
  "events":[
    {
      "_id":"546f1e08cf9ba9b12d00a1b9"
      ,"key":"Buy",
      "ts":1399316845000,
      "c":1,
      "s":0,
      "sg":{
        "screen":"Main screen"
      }
    },
    {
      "_id":"546f1e1ccf9ba9b12d00a39b",
      "key":"Logout",
      "ts":1416568348000,
      "c":1,
      "s":0,
      "sg":{}
    }
  ],
  "funnels":[
    {
      "_id":"be61da5d2a14a3972a86354f453bb8df",
      "name":"Purchase",
      "steps":["Login","Purchase","Logout"],
      "step":1,
      "actionTimes":[1416568868000]
    }
  ]
}

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

uid
string
required

ID of the user for which to query information

Query Params

callback
string

(optional) name of callback function for JSONP output

 

This API is used to query all available information about the user.

User ID is formed as sha1 hash from app_key and deviceID you set in your SDK, for example in nodejs getting user ID would looke like:

uid = crypto.createHash('sha1').update(app_key + device_id + "").digest('hex');

This request can provide details as:

  • _id - ID of user
  • uid - internal user ID
  • hasInfo - if there is any info about user
  • name - full name of the user
  • email - email address of the user
  • username - nickname of the user
  • organization - organization user works for or participatesin
  • phone - user's phone number
  • gender - gender of the user, possible values: M or F or null if not known
  • byear - year of birth
  • sc - session count
  • fs - timestamp of first session start
  • ls - timestamp of last session start
  • did - device ID
  • c - carrier
  • cc - country code
  • cty - city
  • d - device
  • p - platform
  • pv - platform version
  • r - resolution
  • dnst - density
  • sd - duration of last session in seconds
  • tsd - total duration of all sessions in seconds
  • picture - link (internal or external) to the picture of user or avatar
  • tpa - total purchase amount
  • tpc - total purchase count
  • sessions - array with user sessions:
    • _id - session ID
    • ts - session start timestamp
    • sd - session duration
    • nts - next session timestamp (may be "" if last session)
  • events - array with user events:
    • _id - event ID
    • key - key of the event
    • ts - timestamp of event
    • c - count provided with event
    • s - sum provided with event
    • sg - segments of event
  • funnels - array with user funnel progress
    • _id - funnel ID
    • name - name of the funnel
    • steps - array with event keys for the funnel
    • step - current step which user completed
    • actionTimes - array of timestamps at which each action was completed
Suggest Edits

/o?method=segmentation

Breakdown of data for specific event by provided bucket

 
gethttps://try.count.ly/o?method=segmentation&api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o?app_id=app_id&api_key=api_key&method=segmentation'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key',
     method: 'segmentation' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o?app_id=app_id&api_key=api_key&method=segmentation")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o?app_id=app_id&api_key=api_key&method=segmentation");

xhr.send(data);
import requests

url = "https://try.count.ly/o"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{  
   "data":{  
      "2016.5.29":{  
         "u":17,
         "t":17,
         "s":0,
         "dur":74
      },
      "2016.6.1":{  
         "u":12,
         "t":12,
         "s":0,
         "dur":63
      },
      "2016.5.27":{  
         "u":6,
         "t":6,
         "s":0,
         "dur":37
      },
      "2016.5.26":{  
         "u":10,
         "t":10,
         "s":0,
         "dur":49
      },
      "2016.5.28":{  
         "u":18,
         "t":18,
         "s":0,
         "dur":90
      },
      "2016.5.30":{  
         "u":16,
         "t":16,
         "s":0,
         "dur":76
      },
      "2016.5.31":{  
         "u":11,
         "t":11,
         "s":0,
         "dur":33
      }
   },
   "meta":[  

   ],
   "lu":"2016-06-13T12:37:10.405Z"
}
{  
   "data":{  
      "2016.4.26":{  
         "notification":{  
            "u":1,
            "t":1,
            "s":0,
            "dur":5
         },
         "twitter":{  
            "u":7,
            "t":7,
            "s":0,
            "dur":41
         },
         "unknown":{  
            "u":4,
            "t":4,
            "s":0,
            "dur":5
         }
      },
      "2016.4.29":{  
         "notification":{  
            "u":6,
            "t":6,
            "s":0,
            "dur":30
         },
         "twitter":{  
            "u":7,
            "t":7,
            "s":0,
            "dur":44
         },
         "unknown":{  
            "u":10,
            "t":10,
            "s":0,
            "dur":51
         }
      },
      "2016.5.1":{  
         "notification":{  
            "u":4,
            "t":4,
            "s":0,
            "dur":18
         },
         "unknown":{  
            "u":10,
            "t":10,
            "s":0,
            "dur":59
         },
         "twitter":{  
            "u":1,
            "t":1,
            "s":0,
            "dur":8
         }
      },
      "2016.4.24":{  
         "notification":{  
            "u":1,
            "t":1,
            "s":0,
            "dur":8
         },
         "twitter":{  
            "u":6,
            "t":6,
            "s":0,
            "dur":30
         },
         "unknown":{  
            "u":3,
            "t":3,
            "s":0,
            "dur":19
         }
      },
   },
   "meta":[  
      "twitter",
      "unknown",
      "notification"
   ],
   "notification":{  
      "t":325,
      "u":323,
      "s":0,
      "dur":1704
   },
   "twitter":{  
      "t":360,
      "u":350,
      "s":0,
      "dur":1853
   },
   "unknown":{  
      "t":334,
      "u":330,
      "s":0,
      "dur":1574
   },
   "lu":"2016-06-13T12:44:41.397Z"
}

Path Params

api_key
string
required

API_KEY of user, with permission to access this app

app_id
string
required

ID of the app for which to query

Query Params

event
string

Which event to query

period
string

For which time period to provide data, possible values (month, 60days, 30days, 7days, yesterday, hour or [startMiliseconds, endMiliseconds] as [1417730400000,1420149600000])

bucket
string

period by which to breakdown data: hourly, daily, weekly, monthly

projectionKey
string

Show top results by specific segment value

queryObject
string

Json string encoded mongodb query

callback
string

(optional) name of callback function for JSONP output

 

This api allows to query events that were recorded in drill. Event can be any custom event sent to Countly server, as well as internal events like:

  • [CLY]_session for sessions
  • [CLY]_crash for crahses
  • [CLY]_view for views
  • [CLY]_action for actions
  • [CLY]_push_action for actions performed on push notifications
  • [CLY]_push_open for opened push notifications
  • [CLY]_push_sent for sent push notifications

It provides following properties for each bucket:

  • u - unique users
  • t - total times/count
  • s - sum property if provided for event
  • dur - duration property if provided for event

meta property lists breakdown by segments for queries with projection key

Suggest Edits

/o?method=segmentation_meta

Fetches all segment data for provided event

 
gethttps://try.count.ly/o?method=segmentation_meta&api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o?app_id=app_id&api_key=api_key&method=segmentation_meta'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key',
     method: 'segmentation_meta' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o?app_id=app_id&api_key=api_key&method=segmentation_meta")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o?app_id=app_id&api_key=api_key&method=segmentation_meta");

xhr.send(data);
import requests

url = "https://try.count.ly/o"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{  
   "e":"[CLY]_session",
   "app_id":"56e53239a941253d470d7c52",
   "up":{  
      "cty":{  
         "values":[  
            "Riga",
            "Unknown",
            "Ashburn",
            "Newark",
            "Tokyo"
         ],
         "type":"l"
      },
      "cc":{  
         "values":[  
            "LV",
            "Unknown",
            "JP",
            "CN",
            "US"
         ],
         "type":"l"
      },
      "fs":{  
         "type":"d"
      },
      "ls":{  
         "type":"d"
      },
      "sc":{  
         "type":"n"
      },
      "lat":{  
         "type":"n"
      },
      "lng":{  
         "type":"n"
      },
      "av":{  
         "values":[  
            "1:4",
            "3:1",
            "1:7",
            "1:3"
         ],
         "type":"l"
      },
      "d":{  
         "values":[  
            "iPod7,1",
            "iPad3,6",
            "MB860",
            "Lumia 540",
            "iPhone8,1"
         ],
         "type":"l"
      },
      "p":{  
         "values":[  
            "iOS",
            "Android",
            "Windows Phone"
         ],
         "type":"l"
      },
      "pv":{  
         "values":[  
            "i8:4:1",
            "i10:1:1",
            "a4:3:1",
            "w8",
            "i7:1:2"
         ],
         "type":"l"
      },
      "c":{  
         "values":[  
            "Verizon",
            "Telus",
            "Tele2",
            "Orange",
            "Vodafone"
         ],
         "type":"l"
      },
      "r":{  
         "values":[  
            "640x1136",
            "600x800",
            "480x800",
            "768x1366",
            "240x400"
         ],
         "type":"l"
      },
      "dnst":{  
         "values":[  
            "i@3",
            "i@2",
            "aXXHDPI",
            "w2:5"
         ],
         "type":"l"
      },
      "la":{  
         "values":[  
            "fr",
            "de",
            "ja",
            "it",
            "en",
            "ko"
         ],
         "type":"l"
      },
      "gender":{  
         "values":[  
            "M",
            "F"
         ],
         "type":"l"
      },
      "src":{  
         "type":"bl"
      },
      "name":{  
         "type":"s"
      },
      "username":{  
         "type":"s"
      },
      "email":{  
         "type":"s"
      },
      "organization":{  
         "type":"s"
      },
      "phone":{  
         "type":"s"
      },
      "byear":{  
         "type":"n"
      },
      "cdfs":{  
         "type":"n"
      },
      "lv":{  
         "type":"bl"
      },
      "tsd":{  
         "type":"n"
      },
      "cwfs":{  
         "type":"n"
      },
      "lp":{  
         "type":"d"
      },
      "lpa":{  
         "type":"n"
      },
      "tp":{  
         "type":"n"
      },
      "tpc":{  
         "type":"n"
      }
   },
   "custom":{  
      "Twitter Login":{  
         "values":[  
            "true"
         ],
         "type":"l"
      },
      "Twitter Login name":{  
         "values":[  
            "@rimanije",
            "@ne",
            "@ker",
            "@vip",
            "@ite",
            "@voseero",
            "@ocboite"
         ],
         "type":"l"
      },
      "Has Apple Watch OS":{  
         "values":[  
            "true"
         ],
         "type":"l"
      },
      "Facebook Login":{  
         "values":[  
            "true"
         ],
         "type":"l"
      }
   }
}

Query Params

api_key
string

API_KEY of user, with permission to access this app

app_id
string

ID of the app for which to query

event
string

Which event to query

callback
string

(optional) name of callback function for JSONP output

 

This api returns all segment values for all properties in drill for provided event, except from big list properties, which have too many values and are stored separately.

Suggest Edits

/o?method=segmentation_big_meta

Fetches segments for big list properties (available since 16.12)

 
gethttps://try.count.ly/o?method=segmentation_big_meta&api_key=api_key&app_id=app_id
curl --request GET \
  --url 'https://try.count.ly/o?app_id=app_id&api_key=api_key&method=segmentation_big_meta'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/o',
  qs: 
   { app_id: 'app_id',
     api_key: 'api_key',
     method: 'segmentation_big_meta' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/o?app_id=app_id&api_key=api_key&method=segmentation_big_meta")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/o?app_id=app_id&api_key=api_key&method=segmentation_big_meta");

xhr.send(data);
import requests

url = "https://try.count.ly/o"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[  
   "com.xiaomi.market",
   "com.hiapk.marketpho",
   "com.aliyun.wireless.vos.appstore",
   "com.lenovo.leos.appstore",
   "com.tencent.android.qqdownloader",
   "com.diguayouxi",
   "com.keenhi.mid.kitservice",
   "com.wandoujia.phoenix2",
   "com.google.vending",
   "com.miui.supermarket",
   "com.bbk.appstore",
   "com.taobao.appcenter",
   "com.huawei.appmarket",
   "com.slideme.sam.manager",
   "com.amazon.venezia",
   "com.yingyonghui.market",
   "me.onemobile.android",
   "cn.goapk.market",
   "com.nduoa.nmarket",
   "cm.aptoide.pt",
   "com.mappn.gfan",
   "com.sec.android.app.samsungapps",
   "com.android.browser",
   "com.hiapk.marketpad",
   "com.dragon.android.pandaspace",
   "com.qihoo.appstore",
   "com.android.vending",
   "com.lenovo.leos.appstore.pad",
   "com.oppo.market",
   "com.appslib.vending",
   "com.moto.mobile.appstore",
   "com.aspire.mm",
   "com.rim.marketintent",
   "com.google.android.feedback",
   "com.baidu.appsearch",
   "com.nokia.payment.iapenabler",
   "um.market.android"
]

Query Params

api_key
string

API_KEY of user, with permission to access this app

app_id
string

ID of the app for which to query

event
string

Which event to query

callback
string

(optional) name of callback function for JSONP output

prop
string

Property for which to fetch data (up.src, up.lv)

search
string

Regex search in the segment values

 

Due to UI limitations by default this api outputs maximum of 200 items (configurable). But it is possible to pre filter with a regex through search parameter to return only set of values for which user is searching

Suggest Edits

/i/pushes/prepare

 
posthttps://try.count.ly/i/pushes/prepare?api_key=api_key&args=args
curl --request POST \
  --url 'https://try.count.ly/i/pushes/prepare?args.apps=args.apps&args.platforms=args.platforms&args=args&api_key=api_key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://try.count.ly/i/pushes/prepare',
  qs: 
   { 'args.apps': 'args.apps',
     'args.platforms': 'args.platforms',
     args: 'args',
     api_key: 'api_key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/i/pushes/prepare?args.apps=args.apps&args.platforms=args.platforms&args=args&api_key=api_key")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://try.count.ly/i/pushes/prepare?args.apps=args.apps&args.platforms=args.platforms&args=args&api_key=api_key");

xhr.send(data);
import requests

url = "https://try.count.ly/i/pushes/prepare"

querystring = {"args.apps":"args.apps","args.platforms":"args.platforms","args":"args","api_key":"api_key"}

response = requests.request("POST", url, params=querystring)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "_id":"5880a1270eb44470b3f706b8",
  "apps":["52aadacf4d6c638517000001"],
  "appNames":["XXX"],
  "platforms":["i"],
  "result":{
    "status":1,
    "total":0,
    "processed":0,
    "sent":0,
    "error":null
  },
  "expiryDate":"2017-01-26T11:21:11.792Z",
  "tz":false,
  "created":null,
  "test":false,
  "id":"5880a1270eb44470b3f706b8",
  "build":{
    "total":2120763
  }
}
{
  "_id":"5880a1270eb44470b3f706b8",
  "apps":["52aadacf4d6c638517000001"],
  "appNames":["XXX"],
  "platforms":["i"],
  "result":{
    "status":1,
    "total":2120763,
    "processed":0,
    "sent":0,
    "error":null
  },
  "expiryDate":"2017-01-26T11:21:11.792Z",
  "tz":false,
  "created":null,
  "test":false,
  "build":{
    "count":{
      "haw":64,
      "ln":1,
      "ca":380,
      "gsw":495,
      "bg":269,
      "ka":61,
      "nb":29456,
      "en":1691457,
      "pt":35531,
      "sv":26919,
      "ar":74598,
      "is":429,
      "uz":6,
      "hu":1653,
      "...": 0,
    },
    "total":2120763,
    "tzs":null
  }
}

Path Params

api_key
string
required

Admin API_KEY.

args
string
required

Stringified JSON object with future message data.

Query Params

args._id
string

ObjectID of previous build for this message if any

args.apps
array of strings
required

Array of app IDs

args.platforms
array of strings
required

Array of platform types (i for iOS & a for Android are supported)

args.userConditions
object

Conditions for app_users collections (JSON object)

args.drillConditions
object

Conditions for Drill query

args.test
boolean

Whether to send this message to test users or production users

args.geo
string

ID of geo location

args.tz
boolean

Send this message in user timezones

 

In most cases, process of sending a message involves 2 steps:

  1. Preparation, that is extracting push tokens from database and saving them in separate collection. This step also allows calculation of audience and gathering distinct user locales used in this message.
  2. Actual sending. That is taking prepared collection of tokens and sending push notifications to APN or GCM.

When using API rather than Countly Dashboard, (1) can be done in background, so only request (2) is required. But in any case, (1) will be performed.

This request performs step (1). It builds audience collection(s) and returns number of users found in the database along with number of users for each locale (tab 2 of example response).

Note that sometimes, when calculation process takes too much time, request will return temporary result (tab 1 of example response) with only one total key in build property of returned JSON. Temporary total number represents total number of push-enabled users for all app-platform combinations supplied in request, meaning it's not final and it shouldn't be used for any important decisions. In this case the request can be submitted again, with same parameters and with _id returned in first response, to check if process of message preparing is finished. When done, response build key will have count subobject with locale information and optionally tzs key containing all timezones of audience built.

Suggest Edits

/i/pushes/validate

 
gethttps://try.count.ly/i/pushes/validate?api_key=api_key&appId=:appId&platform=platform&test=:test
curl --request GET \
  --url 'https://try.count.ly/i/pushes/validate?platform=platform&key=key&test=%3Atest&appId=%3AappId&api_key=api_key'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/i/pushes/validate',
  qs: 
   { platform: 'platform',
     key: 'key',
     test: ':test',
     appId: ':appId',
     api_key: 'api_key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/i/pushes/validate?platform=platform&key=key&test=%3Atest&appId=%3AappId&api_key=api_key")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/i/pushes/validate?platform=platform&key=key&test=%3Atest&appId=%3AappId&api_key=api_key");

xhr.send(data);
import requests

url = "https://try.count.ly/i/pushes/validate"

querystring = {"platform":"platform","key":"key","test":":test","appId":":appId","api_key":"api_key"}

response = requests.request("GET", url, params=querystring)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "cid": "8cd8feb0692c558cbedeb5572615009b"
}
{
  "ok": false
}

Path Params

api_key
string
required

Admin API_KEY.

Query Params

platform
string
required

"i" for iOS, "a" for Android

key
string
required

Base64-encode P12 APN certificate or Google Server key

secret
string

Passphrase for APN certificate if any

type
string

Type of credentials: "apn_universal" or "gcm"

 

This method validates supplied credentials by initiating connection to APN or GCM service and sending a valid message to invalid device token. If service responds with an error of invalid credentials, method returns JSON object with error key containing error message. In case of success, it returns JSON object with credentials _id saved in the database which can be added to any application later on.

Suggest Edits

/i/pushes/refresh

 
gethttps://try.count.ly/i/pushes/refresh?api_key=api_key&mid=mid
curl --request GET \
  --url 'https://try.count.ly/i/pushes/refresh?mid=mid&api_key=api_key'
var request = require("request");

var options = { method: 'GET',
  url: 'https://try.count.ly/i/pushes/refresh',
  qs: 
   { mid: 'mid',
     api_key: 'api_key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://try.count.ly/i/pushes/refresh?mid=mid&api_key=api_key")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://try.count.ly/i/pushes/refresh?mid=mid&api_key=api_key");

xhr.send(data);
import requests

url = "https://try.count.ly/i/pushes/refresh"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "_id":"5485c40d7506eb130a000003",
  "apps":["547df8507b67dc8918000001"],
  "appNames":["AAA"],
  "platforms":["i","a"],
  "conditions":{},
  "messagePerLocale":{
    "default":"OOpla"
  },
  "sound":"default",
  "result":{
    "status":8,
    "total":123,
    "processed":123,
    "sent":123,
    "delivered":90,
    "actioned":43
  },
  "expiryDate":"2014-12-15T15:30:21.510Z",
  "created":"2014-12-08T15:30:21.509Z",
  "type":"message",
  "locales":{
    "en":1,
    "default":1
  },
  "test":false,
  "date":"2014-12-08T15:30:21.510Z",
  "pushly":[
    {
      "id":"5485c40d7506eb130a000003|547df8507b67dc8918000001|ap.547df8507b67dc8918000001",
      "query":{
        "appId":"547df8507b67dc8918000001",
        "conditions":{}
      },
      "result":{
        "status":8,
        "total":100,
        "processed":100,
        "sent":70,
        "error":null
      }
    },
    {
      "id":"5485c40d7506eb130a000003|547df8507b67dc8918000001|ip.547df8507b67dc8918000001",
      "query":{
        "appId":"547df8507b67dc8918000001",
        "conditions":{}
      },
      "result":{
        "status":8,
        "total":23,
        "processed":23,
        "sent":20,
        "error":null
      }
    }

  ],
  "sent":"2014-12-08T15:30:24.143Z"
}

Path Params

api_key
string
required

Admin API_KEY.

mid
string
required

ID of message to refresh

 

This method just retrieves message object from database and returns it. It's useful when you want to check status of message which is being sent right now.

Note that there is pushly property which contains partial messages for a particular app-platform-test combination. Those are atomic messages from Countly perspective and are useful only if you want to know how recipients of this message are distributed across various apps or platforms. Another use case is when an error occurred only with one of those partial messages, but others are processed well and you want to know the reason of that error.

Top result property of message is just an aggregation of all its partial messages from pushly property.

Suggest Edits

/i/pushes/create

 
posthttps://try.count.ly/i/pushes/create?api_key=api_key&args=args
curl --form 'args={"apps":["APP_ID"],"platforms":["a", "i"],"tz":false,"test":true,"type":"message","messagePerLocale":{"default": "Default message","en": "Message in English","de": "... in Deutsch","ru": "... на Русском", "default|t": "Default message title", "default|0|t": "Default button 0 title", "default|0|l": "http://default.button0.link.com", "default|1|t": "Default button 1 title", "default|1|l": "http://default.button1.link.com", "ru|t": "Заголовок сообщения на Русском", "en|1|t": "Button 1 title in English"},"userConditions":{"custom.age":"18"},"locales":[{"value":"default","title":"Default","count":1,"percent":100},{"value":"en","title":"English","count":1,"percent":100}], "buttons": 2, "sound":"default","media": "https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png", "source":"dash"}' https://example.com/i/pushes/create?api_key=API_KEY