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

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

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}/time', 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}/time",
  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}/time"

	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}/time")
  .header("cookie", "_me_sess=")
  .asString();
require 'uri'
require 'net/http'

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

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
[
  {
    "path": "<string>",
    "duration": 123,
    "duration_percentage": 123,
    "visitors": 123,
    "duration_upper_quartile": 123,
    "duration_lower_quartile": 123
  }
]
{
  "error": {
    "code": 400,
    "message": "<string>"
  }
}
{
  "error": {
    "code": 401,
    "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

path
string
required

Pathname of the page.

duration
integer
required

Median time spent on page in milliseconds.

duration_percentage
number<float>
required

Percentage of time contributing to the total time spent on the website relative to all pages.

visitors
integer

Number of unique visitors for given page.

duration_upper_quartile
integer

Total time spent on page in milliseconds for the upper quartile (75%).

duration_lower_quartile
integer

Total time spent on page in milliseconds for the lower quartile (25%).