Get website analytics
curl --request GET \
--url https://api.lindo.ai/v1/workspace/website/{website_id}/analytics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.lindo.ai/v1/workspace/website/{website_id}/analytics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.lindo.ai/v1/workspace/website/{website_id}/analytics', 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.lindo.ai/v1/workspace/website/{website_id}/analytics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.lindo.ai/v1/workspace/website/{website_id}/analytics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.lindo.ai/v1/workspace/website/{website_id}/analytics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lindo.ai/v1/workspace/website/{website_id}/analytics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"result": {
"total_requests": 5000,
"total_visitors": 1200,
"avg_response_time": 120,
"total_pages": 15,
"total_blogs": 8,
"traffic_over_time": [
{
"timestamp": "2024-01-15T10:00:00Z",
"requests": 1500,
"visitors": 250,
"avg_response_time": 150,
"errors": 5
}
],
"top_pages": [
{
"path": "/about",
"requests": 500,
"visitors": 100,
"avg_response_time": 120
}
],
"top_countries": [
{
"country": "US",
"requests": 800,
"visitors": 150
}
],
"top_browsers": [
{
"browser": "Chrome",
"count": 600,
"visitors": 120
}
],
"top_devices": [
{
"device": "Desktop",
"count": 700,
"visitors": 140
}
],
"top_os": [
{
"os": "Windows",
"count": 500,
"visitors": 100
}
],
"top_referers": [
{
"domain": "google.com",
"count": 300,
"visitors": 80
}
],
"top_campaigns": [
{
"campaign": "summer_sale",
"count": 200,
"visitors": 50
}
]
}
}{
"success": false,
"errors": [
"Client already exists"
],
"message": "Validation failed"
}{
"success": false,
"errors": [
"Client already exists"
],
"message": "Validation failed"
}{
"success": false,
"errors": [
"Client already exists"
],
"message": "Validation failed"
}Analytics
Get website analytics
Retrieves analytics data for a specific website including traffic metrics, visitor counts, and performance data. Supports optional date range filtering.
GET
/
v1
/
workspace
/
website
/
{website_id}
/
analytics
Get website analytics
curl --request GET \
--url https://api.lindo.ai/v1/workspace/website/{website_id}/analytics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.lindo.ai/v1/workspace/website/{website_id}/analytics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.lindo.ai/v1/workspace/website/{website_id}/analytics', 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.lindo.ai/v1/workspace/website/{website_id}/analytics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.lindo.ai/v1/workspace/website/{website_id}/analytics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.lindo.ai/v1/workspace/website/{website_id}/analytics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lindo.ai/v1/workspace/website/{website_id}/analytics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"result": {
"total_requests": 5000,
"total_visitors": 1200,
"avg_response_time": 120,
"total_pages": 15,
"total_blogs": 8,
"traffic_over_time": [
{
"timestamp": "2024-01-15T10:00:00Z",
"requests": 1500,
"visitors": 250,
"avg_response_time": 150,
"errors": 5
}
],
"top_pages": [
{
"path": "/about",
"requests": 500,
"visitors": 100,
"avg_response_time": 120
}
],
"top_countries": [
{
"country": "US",
"requests": 800,
"visitors": 150
}
],
"top_browsers": [
{
"browser": "Chrome",
"count": 600,
"visitors": 120
}
],
"top_devices": [
{
"device": "Desktop",
"count": 700,
"visitors": 140
}
],
"top_os": [
{
"os": "Windows",
"count": 500,
"visitors": 100
}
],
"top_referers": [
{
"domain": "google.com",
"count": 300,
"visitors": 80
}
],
"top_campaigns": [
{
"campaign": "summer_sale",
"count": 200,
"visitors": 50
}
]
}
}{
"success": false,
"errors": [
"Client already exists"
],
"message": "Validation failed"
}{
"success": false,
"errors": [
"Client already exists"
],
"message": "Validation failed"
}{
"success": false,
"errors": [
"Client already exists"
],
"message": "Validation failed"
}Authorizations
Enter your API key (starts with lindo_sk_)
Path Parameters
Unique identifier of the website
Example:
"website_abc123"
Query Parameters
Start date for analytics data (ISO timestamp)
Example:
"2024-01-01T00:00:00Z"
End date for analytics data (ISO timestamp)
Example:
"2024-01-31T23:59:59Z"
Was this page helpful?
⌘I

