curl --request GET \
--url https://api.lightsage.com/v2/library/redirects/{redirect_id}/insights \
--header 'X-Lightsage-Api-Key: <api-key>'import requests
url = "https://api.lightsage.com/v2/library/redirects/{redirect_id}/insights"
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/library/redirects/{redirect_id}/insights', 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/library/redirects/{redirect_id}/insights",
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/library/redirects/{redirect_id}/insights"
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/library/redirects/{redirect_id}/insights")
.header("X-Lightsage-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lightsage.com/v2/library/redirects/{redirect_id}/insights")
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{
"id": "<string>",
"title": "<string>",
"from_url": "<string>",
"to_url": "<string>",
"status": "working",
"label": "<string>",
"headline": "<string>",
"reason": "<string>",
"answer": "<string>",
"lede": "<string>",
"days_live": 123,
"tracked": true,
"host": "<string>",
"numbers": {
"requests_before": 123,
"errors_before": 123,
"requests_after": 123,
"redirected_after": 123,
"failing_after": 123,
"visits_per_day_before": 123,
"visits_per_day_after": 123
},
"citations": {
"old_before": 123,
"old_after": 123,
"new_before": 123,
"new_after": 123
},
"live_on": "2023-12-25",
"task_id": "<string>",
"added_at": "<string>",
"updated_at": "<string>",
"eval": {
"name": "<string>",
"endpoint_id": "<string>",
"lineage_id": "<string>",
"tested": true,
"matches_destination": true,
"task_id": "<string>",
"passed_before": 123,
"runs_before": 123,
"passed_after": 123,
"runs_after": 123,
"tool_calls_before": 123,
"tool_calls_after": 123,
"time_ms_before": 123,
"time_ms_after": 123
},
"daily": [
{
"date": "2023-12-25",
"errored": 123,
"redirected": 123,
"served": 123
}
],
"latest_requests": [
{
"requested_at": "<string>",
"path": "<string>",
"status_code": 123,
"agent": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Redirect Insights
Whether agents that ask for the old address are now redirected: what Agent Analytics recorded at the old address in the 14 days before the redirect went live and since, agent visits to the new page, the eval fix that redirects the same address, and AI citations of both addresses.
curl --request GET \
--url https://api.lightsage.com/v2/library/redirects/{redirect_id}/insights \
--header 'X-Lightsage-Api-Key: <api-key>'import requests
url = "https://api.lightsage.com/v2/library/redirects/{redirect_id}/insights"
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/library/redirects/{redirect_id}/insights', 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/library/redirects/{redirect_id}/insights",
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/library/redirects/{redirect_id}/insights"
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/library/redirects/{redirect_id}/insights")
.header("X-Lightsage-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lightsage.com/v2/library/redirects/{redirect_id}/insights")
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{
"id": "<string>",
"title": "<string>",
"from_url": "<string>",
"to_url": "<string>",
"status": "working",
"label": "<string>",
"headline": "<string>",
"reason": "<string>",
"answer": "<string>",
"lede": "<string>",
"days_live": 123,
"tracked": true,
"host": "<string>",
"numbers": {
"requests_before": 123,
"errors_before": 123,
"requests_after": 123,
"redirected_after": 123,
"failing_after": 123,
"visits_per_day_before": 123,
"visits_per_day_after": 123
},
"citations": {
"old_before": 123,
"old_after": 123,
"new_before": 123,
"new_after": 123
},
"live_on": "2023-12-25",
"task_id": "<string>",
"added_at": "<string>",
"updated_at": "<string>",
"eval": {
"name": "<string>",
"endpoint_id": "<string>",
"lineage_id": "<string>",
"tested": true,
"matches_destination": true,
"task_id": "<string>",
"passed_before": 123,
"runs_before": 123,
"passed_after": 123,
"runs_after": 123,
"tool_calls_before": 123,
"tool_calls_after": 123,
"time_ms_before": 123,
"time_ms_after": 123
},
"daily": [
{
"date": "2023-12-25",
"errored": 123,
"redirected": 123,
"served": 123
}
],
"latest_requests": [
{
"requested_at": "<string>",
"path": "<string>",
"status_code": 123,
"agent": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Response
Successful Response
Whether agents that ask for the old address are now redirected, from what Agent Analytics recorded at the old address since the redirect went live. not_working when requests that still got an error or the old page are at least as many as requests that were redirected (this can show before 7 days). Otherwise checking until it has been live 7 days and at least one agent has asked for the old address, then working (redirected requests outnumber the rest; answer says so when some still fail). cant_check when the old address is on a site Agent Analytics does not track. Only 301, 302, 303, 307 and 308 count as redirected. Agent Analytics does not record where a redirect points, so working means agents are sent on, not that they reach to_url.
working, not_working, checking, cant_check