List Agent Analytics Pages
curl --request GET \
--url https://api.lightsage.com/v2/agent-analytics/sites/{site_id}/pages \
--header 'X-Lightsage-Api-Key: <api-key>'import requests
url = "https://api.lightsage.com/v2/agent-analytics/sites/{site_id}/pages"
headers = {"X-Lightsage-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Lightsage-Api-Key': '<api-key>'}};
fetch('https://api.lightsage.com/v2/agent-analytics/sites/{site_id}/pages', 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.lightsage.com/v2/agent-analytics/sites/{site_id}/pages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Lightsage-Api-Key: <api-key>"
],
]);
$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.lightsage.com/v2/agent-analytics/sites/{site_id}/pages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Lightsage-Api-Key", "<api-key>")
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.lightsage.com/v2/agent-analytics/sites/{site_id}/pages")
.header("X-Lightsage-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lightsage.com/v2/agent-analytics/sites/{site_id}/pages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Lightsage-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"site_id": "<string>",
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"agent": "<string>",
"pages": [
{
"path": "<string>",
"coding": 123,
"user": 123,
"search": 123,
"training": 123,
"other": 123,
"people": 123,
"ai_total": 123,
"last_seen": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Agent Analytics
List Agent Analytics Pages
Returns the pages AI agents and bots read on a site in the date range, with visits per traffic type. Sorted by AI visits unless sort is set. With type, returns only pages that traffic type visited. With agent, returns only the pages that one coding agent read.
GET
/
v2
/
agent-analytics
/
sites
/
{site_id}
/
pages
List Agent Analytics Pages
curl --request GET \
--url https://api.lightsage.com/v2/agent-analytics/sites/{site_id}/pages \
--header 'X-Lightsage-Api-Key: <api-key>'import requests
url = "https://api.lightsage.com/v2/agent-analytics/sites/{site_id}/pages"
headers = {"X-Lightsage-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Lightsage-Api-Key': '<api-key>'}};
fetch('https://api.lightsage.com/v2/agent-analytics/sites/{site_id}/pages', 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.lightsage.com/v2/agent-analytics/sites/{site_id}/pages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Lightsage-Api-Key: <api-key>"
],
]);
$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.lightsage.com/v2/agent-analytics/sites/{site_id}/pages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Lightsage-Api-Key", "<api-key>")
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.lightsage.com/v2/agent-analytics/sites/{site_id}/pages")
.header("X-Lightsage-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lightsage.com/v2/agent-analytics/sites/{site_id}/pages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Lightsage-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"site_id": "<string>",
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"agent": "<string>",
"pages": [
{
"path": "<string>",
"coding": 123,
"user": 123,
"search": 123,
"training": 123,
"other": 123,
"people": 123,
"ai_total": 123,
"last_seen": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Path Parameters
Query Parameters
Inclusive range start; defaults to 6 days before the end date. The range may span at most 90 days.
Inclusive range end in UTC; defaults to today.
Required range:
1 <= x <= 500Only pages whose path contains this text.
Maximum string length:
200Traffic type to sort by, most visits first, or last_seen for the latest visit first.
Available options:
coding, user, search, training, other, people, ai_total, last_seen Only pages this traffic type visited.
Available options:
coding, user, search, training, other, people Only pages this coding agent read, by the name the sources list gives it, such as codex or cursor.
Maximum string length:
100Response
Successful Response