curl --request GET \
--url https://api.example.com/api/v1/merchants/{merchant_id}/collections/{collection_id}/analytics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/merchants/{merchant_id}/collections/{collection_id}/analytics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/merchants/{merchant_id}/collections/{collection_id}/analytics', 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.example.com/api/v1/merchants/{merchant_id}/collections/{collection_id}/analytics",
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://api.example.com/api/v1/merchants/{merchant_id}/collections/{collection_id}/analytics"
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://api.example.com/api/v1/merchants/{merchant_id}/collections/{collection_id}/analytics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/merchants/{merchant_id}/collections/{collection_id}/analytics")
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{
"collection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"period": {
"start": "2023-12-25",
"end": "2023-12-25"
},
"summary": {
"period": {
"start": "2023-12-25",
"end": "2023-12-25"
},
"total_revenue": {
"value": 0,
"currency": "",
"delta_pct": 123
},
"total_views": {
"value": 0,
"delta_pct": 123
},
"total_clicks": {
"value": 0,
"delta_pct": 123
},
"avg_ctr": {
"value": 0,
"delta_pts": 123
},
"units_sold": {
"value": 0,
"delta_pct": 123
},
"avg_str": {
"value": 123,
"delta_pts": 123
},
"add_to_carts": {
"value": 0
},
"collection_views": {
"value": 0,
"delta_pct": 123
},
"dead_stock": {
"value": 0
},
"avg_stock_coverage_days": 123,
"rpm": {
"value": 0,
"currency": ""
},
"velocity": {
"value": 0
},
"auto_lift": {
"pinned_ctr": 0,
"auto_ctr": 0
},
"top_product": {
"main_product_id": "<string>",
"title": "<string>",
"image_url": "<string>",
"revenue": 123
},
"inventory_scope_unknown": false
},
"inventory": {
"hidden": 0,
"low_stock": 123,
"ok": 123,
"unknown": 0,
"at_risk": 0,
"total": 0,
"avg_stock_coverage_days": 123,
"variants_in_stock": 0,
"variants_total": 0,
"variant_availability_pct": 123
},
"scroll_depth": 123,
"top_products": [],
"needs_attention": [],
"pinned_vs_auto": [],
"sell_through_by_tier": [],
"position_performance": [],
"total_products": 0
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Get Collection Analytics Endpoint
curl --request GET \
--url https://api.example.com/api/v1/merchants/{merchant_id}/collections/{collection_id}/analytics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/merchants/{merchant_id}/collections/{collection_id}/analytics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/merchants/{merchant_id}/collections/{collection_id}/analytics', 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.example.com/api/v1/merchants/{merchant_id}/collections/{collection_id}/analytics",
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://api.example.com/api/v1/merchants/{merchant_id}/collections/{collection_id}/analytics"
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://api.example.com/api/v1/merchants/{merchant_id}/collections/{collection_id}/analytics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/merchants/{merchant_id}/collections/{collection_id}/analytics")
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{
"collection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"period": {
"start": "2023-12-25",
"end": "2023-12-25"
},
"summary": {
"period": {
"start": "2023-12-25",
"end": "2023-12-25"
},
"total_revenue": {
"value": 0,
"currency": "",
"delta_pct": 123
},
"total_views": {
"value": 0,
"delta_pct": 123
},
"total_clicks": {
"value": 0,
"delta_pct": 123
},
"avg_ctr": {
"value": 0,
"delta_pts": 123
},
"units_sold": {
"value": 0,
"delta_pct": 123
},
"avg_str": {
"value": 123,
"delta_pts": 123
},
"add_to_carts": {
"value": 0
},
"collection_views": {
"value": 0,
"delta_pct": 123
},
"dead_stock": {
"value": 0
},
"avg_stock_coverage_days": 123,
"rpm": {
"value": 0,
"currency": ""
},
"velocity": {
"value": 0
},
"auto_lift": {
"pinned_ctr": 0,
"auto_ctr": 0
},
"top_product": {
"main_product_id": "<string>",
"title": "<string>",
"image_url": "<string>",
"revenue": 123
},
"inventory_scope_unknown": false
},
"inventory": {
"hidden": 0,
"low_stock": 123,
"ok": 123,
"unknown": 0,
"at_risk": 0,
"total": 0,
"avg_stock_coverage_days": 123,
"variants_in_stock": 0,
"variants_total": 0,
"variant_availability_pct": 123
},
"scroll_depth": 123,
"top_products": [],
"needs_attention": [],
"pinned_vs_auto": [],
"sell_through_by_tier": [],
"position_performance": [],
"total_products": 0
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Query Parameters
Response
Successful Response
Rich payload for the Collection Analytics drawer. scroll_depth is
always None for now -- there is no scroll tracking, documented as a data
gap. summary reuses the same aggregate as the /metrics endpoint.
Inventory health for the in-scope products.
hidden is the count of manually-hidden products. low_stock counts
visible products with 0 < inventory <= LOW_STOCK_UNITS; ok counts
visible products with inventory > LOW_STOCK_UNITS. Fully out-of-stock
visible products (inventory == 0) are counted in total but not in
ok/low_stock. total is the number of in-scope products
(visible + hidden). at_risk is hidden + low_stock (degrading to
the hidden lower bound when inventory is unknown). unknown counts
visible products with metrics whose inventory level is unknown — they are
in neither ok nor low_stock and must not be read as out of stock;
in a fully blanked/quantity-less scope that is every product with metrics.
Unknown products' variants are excluded from variants_in_stock/
variants_total (their variant rows would read as 0 in stock), and
their sales still count toward the coverage denominator, so
avg_stock_coverage_days is understated in proportion to the unknown
share under partial coverage.
avg_stock_coverage_days is total_inventory / (units_sold / period_days)
and None when nothing sold in the period. When no member has a known
inventory level (blanked scope or quantity-less feed), low_stock/ok
and the coverage are None (unknown), and at_risk is the hidden
lower bound.
variant_availability_pct (0-100) is in-stock variants ÷ total variants
across the in-scope products with known inventory (variants_in_stock /
variants_total are the raw sums over that same subset — see the
unknown exclusion above). None when the merchant has no
variant-level inventory data.
Show child attributes
Show child attributes
Was this page helpful?

