curl --request GET \
--url https://api.lightsage.com/v2/agent-preference/head-to-head \
--header 'X-Lightsage-Api-Key: <api-key>'import requests
url = "https://api.lightsage.com/v2/agent-preference/head-to-head"
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-preference/head-to-head', 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-preference/head-to-head",
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-preference/head-to-head"
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-preference/head-to-head")
.header("X-Lightsage-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lightsage.com/v2/agent-preference/head-to-head")
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{
"company": {
"name": "<string>",
"domain": "<string>"
},
"summary": {
"wins": 123,
"losses": 123,
"ties": 123,
"comparisons": 123,
"win_rate": 123
},
"count": 123,
"attempts_considered": 123,
"limit": 123,
"truncated": true,
"data": [
{
"wins": 123,
"losses": 123,
"ties": 123,
"comparisons": 123,
"competitor_name": "<string>",
"win_rate": 123,
"competitor_id": "<string>",
"competitor_domain": "<string>",
"eval_ids": [
"<string>"
]
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Retrieve Head To Head
Returns how often agents recommended your company over each tracked competitor: wins, losses, ties, and win rate per competitor plus a combined record. Calculated from the most recent attempts across all Agent Preference evals, up to limit; truncated reports whether older attempts were left out.
curl --request GET \
--url https://api.lightsage.com/v2/agent-preference/head-to-head \
--header 'X-Lightsage-Api-Key: <api-key>'import requests
url = "https://api.lightsage.com/v2/agent-preference/head-to-head"
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-preference/head-to-head', 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-preference/head-to-head",
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-preference/head-to-head"
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-preference/head-to-head")
.header("X-Lightsage-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lightsage.com/v2/agent-preference/head-to-head")
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{
"company": {
"name": "<string>",
"domain": "<string>"
},
"summary": {
"wins": 123,
"losses": 123,
"ties": 123,
"comparisons": 123,
"win_rate": 123
},
"count": 123,
"attempts_considered": 123,
"limit": 123,
"truncated": true,
"data": [
{
"wins": 123,
"losses": 123,
"ties": 123,
"comparisons": 123,
"competitor_name": "<string>",
"win_rate": 123,
"competitor_id": "<string>",
"competitor_domain": "<string>",
"eval_ids": [
"<string>"
]
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Query Parameters
Most recent attempts to include in the records.
1 <= x <= 500Response
Successful Response
Your company, the side every record is counted from.
Show child attributes
Show child attributes
Combined record across every competitor.
Show child attributes
Show child attributes
The number of items in data.
Recent attempts read to build the records. Attempts without a usable recommendation are read but not counted as comparisons.
True when older attempts exist beyond limit and were not counted.
One record per competitor, most comparisons first.
Show child attributes
Show child attributes