curl --request GET \
--url https://www.closient.com/analytics/api/v1/traffic \
--header 'X-API-Key: <api-key>'import requests
url = "https://www.closient.com/analytics/api/v1/traffic"
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://www.closient.com/analytics/api/v1/traffic', 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://www.closient.com/analytics/api/v1/traffic",
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://www.closient.com/analytics/api/v1/traffic"
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://www.closient.com/analytics/api/v1/traffic")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.closient.com/analytics/api/v1/traffic")
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{
"breadcrumb": [
{
"name": "Salsa Fresca Foods",
"type": "organization"
},
{
"id": "8kPq2mWvNc4RtYuIoPaSdF",
"name": "Salsa Fresca",
"type": "brand"
}
],
"interval": "day",
"metric": "resolves",
"period": {
"end": "2026-07-08T00:00:00Z",
"start": "2026-07-01T00:00:00Z"
},
"previous_period_total": 142,
"scope": {
"id": "8kPq2mWvNc4RtYuIoPaSdF",
"name": "Salsa Fresca",
"type": "brand"
},
"series": [
{
"data": [
12,
19,
7,
0,
23,
31,
18
],
"has_children": true,
"id": "3nRt7yUiOpAsDfGhJkLzXc",
"name": "Salsa Fresca Medium 16oz",
"total": 110,
"type": "product_group"
},
{
"data": [
8,
11,
4,
0,
14,
19,
12
],
"has_children": true,
"id": "5vBnM3qWeRtYuIoPaSdFgH",
"name": "Salsa Fresca Hot 16oz",
"total": 68,
"type": "product_group"
}
],
"timestamps": [
"2026-07-01",
"2026-07-02",
"2026-07-03",
"2026-07-04",
"2026-07-05",
"2026-07-06",
"2026-07-07"
],
"total": 178
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}Hierarchical traffic time series for a scope
Returns a stacked time series suitable for an ECharts stacked area / bar chart, plus a breadcrumb describing the drill-down path. The shape mirrors the Customer Analytics Dashboard contract.
Scopes form a hierarchy organization → brand → product_group (optional) → product; the response’s series[*].type discriminator tells the frontend whether clicking a stacked segment should drill into a product group, an ungrouped product, or stop.
Data comes from the pre-aggregated ScanDailySummary table — no raw event scans are queried at request time. Today’s partial day is excluded; pre-aggregation runs nightly.
Caller must be a member of organization_id or a 404 is returned. scope_id (when supplied) must belong to that organization or a 404 is returned.
curl --request GET \
--url https://www.closient.com/analytics/api/v1/traffic \
--header 'X-API-Key: <api-key>'import requests
url = "https://www.closient.com/analytics/api/v1/traffic"
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://www.closient.com/analytics/api/v1/traffic', 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://www.closient.com/analytics/api/v1/traffic",
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://www.closient.com/analytics/api/v1/traffic"
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://www.closient.com/analytics/api/v1/traffic")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.closient.com/analytics/api/v1/traffic")
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{
"breadcrumb": [
{
"name": "Salsa Fresca Foods",
"type": "organization"
},
{
"id": "8kPq2mWvNc4RtYuIoPaSdF",
"name": "Salsa Fresca",
"type": "brand"
}
],
"interval": "day",
"metric": "resolves",
"period": {
"end": "2026-07-08T00:00:00Z",
"start": "2026-07-01T00:00:00Z"
},
"previous_period_total": 142,
"scope": {
"id": "8kPq2mWvNc4RtYuIoPaSdF",
"name": "Salsa Fresca",
"type": "brand"
},
"series": [
{
"data": [
12,
19,
7,
0,
23,
31,
18
],
"has_children": true,
"id": "3nRt7yUiOpAsDfGhJkLzXc",
"name": "Salsa Fresca Medium 16oz",
"total": 110,
"type": "product_group"
},
{
"data": [
8,
11,
4,
0,
14,
19,
12
],
"has_children": true,
"id": "5vBnM3qWeRtYuIoPaSdFgH",
"name": "Salsa Fresca Hot 16oz",
"total": 68,
"type": "product_group"
}
],
"timestamps": [
"2026-07-01",
"2026-07-02",
"2026-07-03",
"2026-07-04",
"2026-07-05",
"2026-07-06",
"2026-07-07"
],
"total": 178
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}Query Parameters
Response
OK
Stacked traffic time series for a scope, ready for ECharts.
Shape mirrors the ticket's Response shape example. The frontend feeds
timestamps to the X-axis and each SeriesEntryOut to a
stacked series; total / previous_period_total power the summary
cards above the chart.