Get Agent Visits
curl --request GET \
--url https://api.peec.ai/customer/v1/agent-analytics/visits \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.peec.ai/customer/v1/agent-analytics/visits"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.peec.ai/customer/v1/agent-analytics/visits', 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.peec.ai/customer/v1/agent-analytics/visits",
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-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.peec.ai/customer/v1/agent-analytics/visits"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-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.peec.ai/customer/v1/agent-analytics/visits")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.peec.ai/customer/v1/agent-analytics/visits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"bot_id": "GPTBot",
"visits": 1402
},
{
"bot_id": "AppleBot",
"visits": 893
}
],
"total_count": 2,
"totalCount": 2
}Project
Get Agent Visits
Aggregate agent access log visits grouped by a chosen dimension (bot, response status, host, path).
GET
/
agent-analytics
/
visits
Get Agent Visits
curl --request GET \
--url https://api.peec.ai/customer/v1/agent-analytics/visits \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.peec.ai/customer/v1/agent-analytics/visits"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.peec.ai/customer/v1/agent-analytics/visits', 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.peec.ai/customer/v1/agent-analytics/visits",
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-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.peec.ai/customer/v1/agent-analytics/visits"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-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.peec.ai/customer/v1/agent-analytics/visits")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.peec.ai/customer/v1/agent-analytics/visits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"bot_id": "GPTBot",
"visits": 1402
},
{
"bot_id": "AppleBot",
"visits": 893
}
],
"total_count": 2,
"totalCount": 2
}Authorizations
APIKeyHeaderAPIKeyQueryBearerAuth
Query Parameters
Required if using a company api key
Example:
"or_f45b94ba-5e35-4982-93ed-285e72ee14eb"
Required range:
1 <= x <= 10000Required range:
0 <= x <= 9007199254740991full-date notation as defined by RFC 3339, section 5.6, for example, 2017-07-21
Pattern:
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$Example:
"2025-09-22"
full-date notation as defined by RFC 3339, section 5.6, for example, 2017-07-21
Pattern:
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$Example:
"2025-09-22"
Dimension(s) to group visit counts by.
Available options:
bot_id, response_status, request_host, request_path Example:
["bot_id"]
Optional list of bot IDs to filter by.
Example:
["AppleBot", "GoogleBot"]
Optional time_bucket for grouping visits by time.
Available options:
hour, day, week, month Example:
"day"
