Skip to main content
GET
/
website
/
{hostname}
/
devices
Get Device Stats
curl --request GET \
  --url http://localhost:8080/website/{hostname}/devices \
  --cookie _me_sess=
import requests

url = "http://localhost:8080/website/{hostname}/devices"

headers = {"cookie": "_me_sess="}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {cookie: '_me_sess='}};

fetch('http://localhost:8080/website/{hostname}/devices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/website/{hostname}/devices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "_me_sess=",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "http://localhost:8080/website/{hostname}/devices"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("cookie", "_me_sess=")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("http://localhost:8080/website/{hostname}/devices")
.header("cookie", "_me_sess=")
.asString();
require 'uri'
require 'net/http'

url = URI("http://localhost:8080/website/{hostname}/devices")

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

request = Net::HTTP::Get.new(url)
request["cookie"] = '_me_sess='

response = http.request(request)
puts response.read_body
[
  {
    "device": "<string>",
    "visitors": 123,
    "visitors_percentage": 123,
    "bounce_percentage": 123,
    "duration": 123
  }
]
{
"error": {
"code": 400,
"message": "<string>"
}
}
{
"error": {
"code": 401,
"message": "<string>"
}
}
{
"error": {
"code": 403,
"message": "<string>"
}
}
{
"error": {
"code": 404,
"message": "<string>"
}
}
{
"error": {
"code": 500,
"message": "<string>"
}
}

Authorizations

_me_sess
string
cookie
required

Session token for authentication.

Path Parameters

hostname
string<hostname>
required

Hostname for the website.

Required string length: 1 - 253

Query Parameters

summary
boolean
default:false

Return a summary of the stats.

start
string<date-time>

Period start date using date-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z).

end
string<date-time>

Period end date using fdate-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z).

path
object

Path of the page.

referrer
object

Referrer URL of the page hit.

utm_source
object

UTM source of the page hit.

utm_medium
object

UTM medium of the page hit.

utm_campaign
object

UTM campaign of the page hit.

browser
object

Browser name.

os
object

Operating system name.

device
object

Device type.

country
object

Country name.

language
object

Language code.

prop_name
object

Name of the property.

prop_value
object

Value of the property.

limit
integer

Limit the number of results.

Required range: 1 <= x <= 5000
offset
integer

Offset the results paired with the limit parameter.

Required range: 0 <= x <= 5000

Cookies

_me_sess
string
required

Session token for authentication.

Example:

"_me_sess=token; Path=/; HttpOnly; SameSite=Lax; Secure"

Response

OK

device
string
required

Device name.

visitors
integer
required

Number of unique visitors from device.

visitors_percentage
number<float>
required

Percentage of unique visitors from device relative to all visitors.

bounce_percentage
number<float>

Bounce rate percentage from device.

duration
integer

Total time spent on page from device in milliseconds.