cURL
curl --request GET \
--url https://api.staging.qyl.dev/api/v1/sessions/statsimport requests
url = "https://api.staging.qyl.dev/api/v1/sessions/stats"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.staging.qyl.dev/api/v1/sessions/stats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.staging.qyl.dev/api/v1/sessions/stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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 := "https://api.staging.qyl.dev/api/v1/sessions/stats"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.staging.qyl.dev/api/v1/sessions/stats")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.qyl.dev/api/v1/sessions/stats")
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{
"active_sessions": 1,
"total_sessions": 1,
"unique_users": 1,
"avg_duration_ms": 123,
"sessions_with_errors": 1,
"sessions_with_genai": 1,
"bounce_rate": 0.5,
"by_device_type": [
{
"device_type": "desktop",
"count": 1,
"percentage": 50
}
],
"by_country": [
{
"country_code": "<string>",
"country_name": "<string>",
"count": 1,
"percentage": 50
}
]
}{
"type": "about:blank",
"title": "Internal Server Error",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"error_code": "<string>"
}Sessions
Get apiv1sessionsstats
Get session statistics
GET
/
api
/
v1
/
sessions
/
stats
cURL
curl --request GET \
--url https://api.staging.qyl.dev/api/v1/sessions/statsimport requests
url = "https://api.staging.qyl.dev/api/v1/sessions/stats"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.staging.qyl.dev/api/v1/sessions/stats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.staging.qyl.dev/api/v1/sessions/stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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 := "https://api.staging.qyl.dev/api/v1/sessions/stats"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.staging.qyl.dev/api/v1/sessions/stats")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.qyl.dev/api/v1/sessions/stats")
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{
"active_sessions": 1,
"total_sessions": 1,
"unique_users": 1,
"avg_duration_ms": 123,
"sessions_with_errors": 1,
"sessions_with_genai": 1,
"bounce_rate": 0.5,
"by_device_type": [
{
"device_type": "desktop",
"count": 1,
"percentage": 50
}
],
"by_country": [
{
"country_code": "<string>",
"country_name": "<string>",
"count": 1,
"percentage": 50
}
]
}{
"type": "about:blank",
"title": "Internal Server Error",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"error_code": "<string>"
}Response
The request has succeeded.
Aggregated session statistics
Active sessions count
Required range:
x >= 0Total sessions in time range
Required range:
x >= 0Unique users in time range
Required range:
x >= 0Average session duration in milliseconds
Sessions with errors
Required range:
x >= 0Sessions with GenAI usage
Required range:
x >= 0Bounce rate (single-page sessions)
Required range:
0 <= x <= 1Sessions by device type
Show child attributes
Show child attributes
Sessions by country
Show child attributes
Show child attributes
Was this page helpful?
