Skip to main content
GET
/
ad-metrics
/
{storeUrl}
/
cohorts
Get cohort metrics
curl --request GET \
  --url https://app.bily.ai/api/customer/v1/ad-metrics/{storeUrl}/cohorts \
  --header 'x-api-key: <api-key>'
const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};

fetch('https://app.bily.ai/api/customer/v1/ad-metrics/{storeUrl}/cohorts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
import requests

url = "https://app.bily.ai/api/customer/v1/ad-metrics/{storeUrl}/cohorts"

headers = {"x-api-key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
[
  {
    "shop": "<string>",
    "cohort_month": "<string>",
    "months_since_first_purchase": 123,
    "cohort_size": 123,
    "active_customers": 123,
    "revenue": 123,
    "orders": 123,
    "ltv_revenue": 123,
    "retention_rate": 123,
    "revenue_per_customer": 123
  }
]
{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}
{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}
{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}
{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}
{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}

Authorizations

x-api-key
string
header
required

A server-side Bily API key created under Settings > MCP > Access key fallback. Select the intended store before creating it.

Headers

x-bily-organization-id
string

An organization ID returned by GET /context or GET /organizations. Required for GET /stores and optional for store-scoped paths.

Example:

"org_01J8W7T9G3E6ZQ4M2K5N8P1R0S"

Path Parameters

storeUrl
string
required

The exact store URL returned by GET /context or GET /stores.

Example:

"store.example.com"

Query Parameters

startDate
string<date>
required

First date to include, in YYYY-MM-DD format.

endDate
string<date>
required

Last date to include, in YYYY-MM-DD format.

Response

Request completed successfully.

shop
string
required
cohort_month
string
required
months_since_first_purchase
integer
required
cohort_size
integer
required
active_customers
integer
required
revenue
number
required
orders
number
required
ltv_revenue
number
required
retention_rate
number
required
revenue_per_customer
number