Get traffic summary
curl --request GET \
--url https://devtune.ai/api/v2/projects/{projectId}/traffic/summary \
--header 'Authorization: Bearer <token>'import requests
url = "https://devtune.ai/api/v2/projects/{projectId}/traffic/summary"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://devtune.ai/api/v2/projects/{projectId}/traffic/summary', 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://devtune.ai/api/v2/projects/{projectId}/traffic/summary",
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://devtune.ai/api/v2/projects/{projectId}/traffic/summary"
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://devtune.ai/api/v2/projects/{projectId}/traffic/summary")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://devtune.ai/api/v2/projects/{projectId}/traffic/summary")
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{
"data": {
"totalEvents": 123,
"totalEventsStatus": "measured",
"botEvents": 123,
"botEventsStatus": "measured",
"referralEvents": 123,
"referralEventsStatus": "measured",
"uniqueSessions": 123,
"uniqueSessionsStatus": "measured",
"botSessions": 123,
"botSessionsStatus": "measured",
"referralSessions": 123,
"referralSessionsStatus": "measured",
"referralEventsObserved": 123,
"referralSourceChanged": true,
"coverage": {
"coveredDays": {
"totalEvents": 1,
"botEvents": 1,
"referralEvents": 1,
"uniqueSessions": 1,
"botSessions": 1,
"referralSessions": 1
},
"windowDays": 30
},
"daily": [
{
"date": "2023-12-25",
"totalEvents": 123,
"botEvents": 123,
"referralEvents": 123,
"uniqueSessions": 123,
"botSessions": 123,
"referralSessions": 123,
"referralEventsObserved": 123,
"referralSource": "edge_middleware",
"referralSourceChanged": true
}
],
"codingAgents": {
"state": "observed",
"coverage": "complete",
"countedFrom": "2023-11-07T05:31:56Z",
"answerFetches": 123,
"unattributedAnswerFetches": 123,
"totalEvents": 123,
"agents": [
{
"label": "<string>",
"llmPlatform": "<string>",
"events": 123
}
],
"platforms": [
{
"llmPlatform": "<string>",
"events": 123
}
]
},
"sensors": {
"asOf": "2023-11-07T05:31:56Z",
"sources": [
{
"source": "cloudflare",
"state": "active",
"lastAcceptedAt": "2023-11-07T05:31:56Z",
"freshnessWindowHours": 2,
"observedHostnames": [
{
"hostname": "<string>",
"lastAcceptedAt": "2023-11-07T05:31:56Z"
}
],
"configuredDomains": [
"<string>"
]
}
]
},
"edgeSensorSdk": {
"latestVersion": "<string>",
"reportedVersions": [
{
"version": "<string>",
"lastReportedAt": "2023-11-07T05:31:56Z"
}
],
"outdatedVersion": {
"version": "<string>",
"lastReportedAt": "2023-11-07T05:31:56Z"
},
"upgradeAvailable": true
},
"window": {
"days": 123,
"dateFrom": "2023-12-25",
"dateTo": "2023-12-25"
},
"edgeSensorVercelLinks": [
{
"vercelProjectId": "<string>",
"vercelOwnerId": "<string>",
"vercelOwnerSlug": "<string>",
"vercelProjectName": "<string>",
"environments": [
"production"
],
"lastSeenAt": "2023-11-07T05:31:56Z"
}
],
"vercelDrain": {
"connection": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"vercelTeamId": "<string>",
"vercelProjectIds": [
"<string>"
],
"lastReceivedAt": "2023-11-07T05:31:56Z",
"lastError": "<string>",
"health": {
"drainStatus": "enabled",
"disabledReason": "<string>",
"deliveryState": "healthy",
"deliveryAttempts": 123,
"deliveryFailures": 123,
"checkedAt": "2023-11-07T05:31:56Z"
},
"behindCdn": true,
"addressesHidden": true,
"hosts": [
{
"hostname": "<string>",
"source": "vercel_drain",
"lastReceivedAt": "2023-11-07T05:31:56Z"
}
],
"activatedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
},
"pendingRemovals": 123,
"abandonedRemovals": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"drainId": "<string>",
"vercelTeamId": "<string>",
"abandonedAt": "2023-11-07T05:31:56Z"
}
]
},
"provenance": {
"state": "unavailable"
},
"gitbook": {
"state": "available",
"connection": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "active",
"organizationId": "<string>",
"siteId": "<string>",
"siteUrl": "<string>",
"lastSyncedAt": "2023-11-07T05:31:56Z",
"firstSyncCompletedAt": "2023-11-07T05:31:56Z",
"lastSyncError": "<string>",
"hosts": [
{
"hostname": "<string>",
"source": "gitbook"
}
],
"createdAt": "2023-11-07T05:31:56Z"
},
"verification": "unverified",
"notFoundDemand": "page_views_only",
"contributions": [
{
"hostname": "<string>",
"requests": 123,
"notFoundRequests": 123
}
]
}
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>",
"details": {
"retryable": true,
"retryAfterSeconds": 2
}
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>",
"details": {
"retryable": true,
"retryAfterSeconds": 2
}
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>",
"details": {
"retryable": true,
"retryAfterSeconds": 2
}
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>",
"details": {
"retryable": true,
"retryAfterSeconds": 2
}
}AI Traffic
Get traffic summary
Daily counts are null on UTC days without machine-sensor coverage and 0 on covered days with no events. Window totals sum covered days only and are null when no day was covered, or when the window is only partly covered and the sum is 0. Each total has a <field>Status sibling: measured when its coverage.coveredDays equals coverage.windowDays, lower_bound when the window is partly covered and the total is at least that number, unmeasured when the total is null. coverage.coveredDays reports measured days per count, each over coverage.windowDays. Observed bot rows retain their counts even when sensor state is unknown. Coverage follows the selected domain and pathPrefix; sensor state is project-wide. botEvents includes crawls and answer fetches. Empty bot counts and combined event and session counts need server-side coverage from edge middleware, Cloudflare or a Vercel log drain. With no server-side coverage or observed bot rows, combined counts are null. Referrals retain snippet coverage. pathPrefix requires domain. Requires the `traffic.read` scope.
GET
/
projects
/
{projectId}
/
traffic
/
summary
Get traffic summary
curl --request GET \
--url https://devtune.ai/api/v2/projects/{projectId}/traffic/summary \
--header 'Authorization: Bearer <token>'import requests
url = "https://devtune.ai/api/v2/projects/{projectId}/traffic/summary"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://devtune.ai/api/v2/projects/{projectId}/traffic/summary', 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://devtune.ai/api/v2/projects/{projectId}/traffic/summary",
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://devtune.ai/api/v2/projects/{projectId}/traffic/summary"
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://devtune.ai/api/v2/projects/{projectId}/traffic/summary")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://devtune.ai/api/v2/projects/{projectId}/traffic/summary")
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{
"data": {
"totalEvents": 123,
"totalEventsStatus": "measured",
"botEvents": 123,
"botEventsStatus": "measured",
"referralEvents": 123,
"referralEventsStatus": "measured",
"uniqueSessions": 123,
"uniqueSessionsStatus": "measured",
"botSessions": 123,
"botSessionsStatus": "measured",
"referralSessions": 123,
"referralSessionsStatus": "measured",
"referralEventsObserved": 123,
"referralSourceChanged": true,
"coverage": {
"coveredDays": {
"totalEvents": 1,
"botEvents": 1,
"referralEvents": 1,
"uniqueSessions": 1,
"botSessions": 1,
"referralSessions": 1
},
"windowDays": 30
},
"daily": [
{
"date": "2023-12-25",
"totalEvents": 123,
"botEvents": 123,
"referralEvents": 123,
"uniqueSessions": 123,
"botSessions": 123,
"referralSessions": 123,
"referralEventsObserved": 123,
"referralSource": "edge_middleware",
"referralSourceChanged": true
}
],
"codingAgents": {
"state": "observed",
"coverage": "complete",
"countedFrom": "2023-11-07T05:31:56Z",
"answerFetches": 123,
"unattributedAnswerFetches": 123,
"totalEvents": 123,
"agents": [
{
"label": "<string>",
"llmPlatform": "<string>",
"events": 123
}
],
"platforms": [
{
"llmPlatform": "<string>",
"events": 123
}
]
},
"sensors": {
"asOf": "2023-11-07T05:31:56Z",
"sources": [
{
"source": "cloudflare",
"state": "active",
"lastAcceptedAt": "2023-11-07T05:31:56Z",
"freshnessWindowHours": 2,
"observedHostnames": [
{
"hostname": "<string>",
"lastAcceptedAt": "2023-11-07T05:31:56Z"
}
],
"configuredDomains": [
"<string>"
]
}
]
},
"edgeSensorSdk": {
"latestVersion": "<string>",
"reportedVersions": [
{
"version": "<string>",
"lastReportedAt": "2023-11-07T05:31:56Z"
}
],
"outdatedVersion": {
"version": "<string>",
"lastReportedAt": "2023-11-07T05:31:56Z"
},
"upgradeAvailable": true
},
"window": {
"days": 123,
"dateFrom": "2023-12-25",
"dateTo": "2023-12-25"
},
"edgeSensorVercelLinks": [
{
"vercelProjectId": "<string>",
"vercelOwnerId": "<string>",
"vercelOwnerSlug": "<string>",
"vercelProjectName": "<string>",
"environments": [
"production"
],
"lastSeenAt": "2023-11-07T05:31:56Z"
}
],
"vercelDrain": {
"connection": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"vercelTeamId": "<string>",
"vercelProjectIds": [
"<string>"
],
"lastReceivedAt": "2023-11-07T05:31:56Z",
"lastError": "<string>",
"health": {
"drainStatus": "enabled",
"disabledReason": "<string>",
"deliveryState": "healthy",
"deliveryAttempts": 123,
"deliveryFailures": 123,
"checkedAt": "2023-11-07T05:31:56Z"
},
"behindCdn": true,
"addressesHidden": true,
"hosts": [
{
"hostname": "<string>",
"source": "vercel_drain",
"lastReceivedAt": "2023-11-07T05:31:56Z"
}
],
"activatedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
},
"pendingRemovals": 123,
"abandonedRemovals": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"drainId": "<string>",
"vercelTeamId": "<string>",
"abandonedAt": "2023-11-07T05:31:56Z"
}
]
},
"provenance": {
"state": "unavailable"
},
"gitbook": {
"state": "available",
"connection": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "active",
"organizationId": "<string>",
"siteId": "<string>",
"siteUrl": "<string>",
"lastSyncedAt": "2023-11-07T05:31:56Z",
"firstSyncCompletedAt": "2023-11-07T05:31:56Z",
"lastSyncError": "<string>",
"hosts": [
{
"hostname": "<string>",
"source": "gitbook"
}
],
"createdAt": "2023-11-07T05:31:56Z"
},
"verification": "unverified",
"notFoundDemand": "page_views_only",
"contributions": [
{
"hostname": "<string>",
"requests": 123,
"notFoundRequests": 123
}
]
}
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>",
"details": {
"retryable": true,
"retryAfterSeconds": 2
}
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>",
"details": {
"retryable": true,
"retryAfterSeconds": 2
}
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>",
"details": {
"retryable": true,
"retryAfterSeconds": 2
}
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>",
"details": {
"retryable": true,
"retryAfterSeconds": 2
}
}Authorizations
bearerAuthoauthBearer